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-2023 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 struct socks_proxy_info *socks_proxy_new(const char *server,
46  const char *port,
47  const char *authfile);
48 
49 void socks_proxy_close(struct socks_proxy_info *sp);
50 
52  socket_descriptor_t sd, /* already open to proxy */
53  const char *host, /* openvpn server remote */
54  const char *servname, /* openvpn server port */
55  struct signal_info *sig_info);
56 
58  socket_descriptor_t ctrl_sd, /* already open to proxy */
59  socket_descriptor_t udp_sd,
60  struct openvpn_sockaddr *relay_addr,
61  struct signal_info *sig_info);
62 
63 void socks_process_incoming_udp(struct buffer *buf,
64  struct link_socket_actual *from);
65 
66 int socks_process_outgoing_udp(struct buffer *buf,
67  const struct link_socket_actual *to);
68 
69 #endif /* ifndef SOCKS_H */
socks_proxy_info::port
const char * port
Definition: socks.h:41
openvpn_sockaddr
Definition: socket.h:65
establish_socks_proxy_udpassoc
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, struct signal_info *sig_info)
Definition: socks.c:511
socks_proxy_new
struct socks_proxy_info * socks_proxy_new(const char *server, const char *port, const char *authfile)
Definition: socks.c:51
socks_process_incoming_udp
void socks_process_incoming_udp(struct buffer *buf, struct link_socket_actual *from)
Definition: socks.c:558
buffer
Wrapper structure for dynamically allocated memory.
Definition: buffer.h:60
establish_socks_proxy_passthru
void establish_socks_proxy_passthru(struct socks_proxy_info *p, socket_descriptor_t sd, const char *host, const char *servname, struct signal_info *sig_info)
Definition: socks.c:450
buffer.h
socks_proxy_info::defined
bool defined
Definition: socks.h:38
socks_proxy_info
Definition: socks.h:37
socks_proxy_close
void socks_proxy_close(struct socks_proxy_info *sp)
Definition: socks.c:80
socket_descriptor_t
SOCKET socket_descriptor_t
Definition: syshead.h:429
signal_info
Definition: sig.h:41
socks_proxy_info::authfile
char authfile[256]
Definition: socks.h:42
socks_process_outgoing_udp
int socks_process_outgoing_udp(struct buffer *buf, const struct link_socket_actual *to)
Definition: socks.c:597
socks_proxy_info::server
char server[128]
Definition: socks.h:40