cosmetics
[tomato.git] / release / src / router / openvpn / socks.h
blob3c60a5b0b4bc6822492d9127368ac8ee734e6e75
1 /*
2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single TCP/UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
6 * packet compression.
8 * Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sales@openvpn.net>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program (see the file COPYING included with this
21 * distribution); if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * 2004-01-30: Added Socks5 proxy support
27 * (Christof Meerwald, http://cmeerw.org)
30 #ifndef SOCKS_H
31 #define SOCKS_H
33 #ifdef ENABLE_SOCKS
35 #include "buffer.h"
37 struct openvpn_sockaddr;
38 struct link_socket_actual;
40 struct socks_proxy_info {
41 bool defined;
42 bool retry;
44 char server[128];
45 int port;
48 void socks_adjust_frame_parameters (struct frame *frame, int proto);
50 struct socks_proxy_info *socks_proxy_new (const char *server,
51 int port,
52 bool retry,
53 struct auto_proxy_info *auto_proxy_info);
55 void socks_proxy_close (struct socks_proxy_info *sp);
57 void establish_socks_proxy_passthru (struct socks_proxy_info *p,
58 socket_descriptor_t sd, /* already open to proxy */
59 const char *host, /* openvpn server remote */
60 const int port, /* openvpn server port */
61 volatile int *signal_received);
63 void establish_socks_proxy_udpassoc (struct socks_proxy_info *p,
64 socket_descriptor_t ctrl_sd, /* already open to proxy */
65 socket_descriptor_t udp_sd,
66 struct openvpn_sockaddr *relay_addr,
67 volatile int *signal_received);
69 void socks_process_incoming_udp (struct buffer *buf,
70 struct link_socket_actual *from);
72 int socks_process_outgoing_udp (struct buffer *buf,
73 const struct link_socket_actual *to);
75 #endif
76 #endif