OpenVPN
socks.h
Go to the documentation of this file.
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.
7  *
8  * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
9  *
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.
13  *
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.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 /*
25  * 2004-01-30: Added Socks5 proxy support
26  * (Christof Meerwald, http://cmeerw.org)
27  */
28 
29 #ifndef SOCKS_H
30 #define SOCKS_H
31 
32 #include "buffer.h"
33 
34 struct openvpn_sockaddr;
35 struct link_socket_actual;
36 
38  bool defined;
39 
40  char server[128];
41  const char *port;
42  char authfile[256];
43 };
44 
45 void socks_adjust_frame_parameters(struct frame *frame, int proto);
46 
47 struct socks_proxy_info *socks_proxy_new(const char *server,
48  const char *port,
49  const char *authfile);
50 
51 void socks_proxy_close(struct socks_proxy_info *sp);
52 
54  socket_descriptor_t sd, /* already open to proxy */
55  const char *host, /* openvpn server remote */
56  const char *servname, /* openvpn server port */
57  volatile int *signal_received);
58 
60  socket_descriptor_t ctrl_sd, /* already open to proxy */
61  socket_descriptor_t udp_sd,
62  struct openvpn_sockaddr *relay_addr,
63  volatile int *signal_received);
64 
65 void socks_process_incoming_udp(struct buffer *buf,
66  struct link_socket_actual *from);
67 
68 int socks_process_outgoing_udp(struct buffer *buf,
69  const struct link_socket_actual *to);
70 
71 #endif /* ifndef SOCKS_H */
void establish_socks_proxy_udpassoc(struct socks_proxy_info *p, socket_descriptor_t ctrl_sd, socket_descriptor_t udp_sd, struct openvpn_sockaddr *relay_addr, volatile int *signal_received)
Definition: socks.c:507
Packet geometry parameters.
Definition: mtu.h:93
void socks_process_incoming_udp(struct buffer *buf, struct link_socket_actual *from)
Definition: socks.c:556
void establish_socks_proxy_passthru(struct socks_proxy_info *p, socket_descriptor_t sd, const char *host, const char *servname, volatile int *signal_received)
Definition: socks.c:444
int socks_process_outgoing_udp(struct buffer *buf, const struct link_socket_actual *to)
Definition: socks.c:595
bool defined
Definition: socks.h:38
void socks_proxy_close(struct socks_proxy_info *sp)
Definition: socks.c:91
char authfile[256]
Definition: socks.h:42
SOCKET socket_descriptor_t
Definition: syshead.h:488
char server[128]
Definition: socks.h:40
Wrapper structure for dynamically allocated memory.
Definition: buffer.h:60
const char * port
Definition: socks.h:41
void socks_adjust_frame_parameters(struct frame *frame, int proto)
Definition: socks.c:53
struct socks_proxy_info * socks_proxy_new(const char *server, const char *port, const char *authfile)
Definition: socks.c:62