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-2026 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, see <https://www.gnu.org/licenses/>.
21 */
22
23/*
24 * 2004-01-30: Added Socks5 proxy support
25 * (Christof Meerwald, https://cmeerw.org)
26 */
27
28#ifndef SOCKS_H
29#define SOCKS_H
30
31#include "buffer.h"
32#include "interval.h"
33#include "sig.h"
34
35struct openvpn_sockaddr;
37
39{
40 bool defined;
41
42 char server[128];
43 const char *port;
44 char authfile[256];
45};
46
47struct socks_proxy_info *socks_proxy_new(const char *server, const char *port,
48 const char *authfile);
49
50void socks_proxy_close(struct socks_proxy_info *sp);
51
53 socket_descriptor_t sd, /* already open to proxy */
54 const char *host, /* openvpn server remote */
55 const char *servname, /* openvpn server port */
56 const struct event_timeout *server_poll_timeout,
57 struct signal_info *sig_info);
58
60 socket_descriptor_t ctrl_sd, /* already open to proxy */
61 struct openvpn_sockaddr *relay_addr,
62 const struct event_timeout *server_poll_timeout,
63 struct signal_info *sig_info);
64
65void socks_process_incoming_udp(struct buffer *buf, struct link_socket_actual *from);
66
67int socks_process_outgoing_udp(struct buffer *buf, const struct link_socket_actual *to);
68
69#endif /* ifndef SOCKS_H */
Buffer management functions and garbage collection.
void establish_socks_proxy_passthru(const struct socks_proxy_info *p, socket_descriptor_t sd, const char *host, const char *servname, const struct event_timeout *server_poll_timeout, struct signal_info *sig_info)
Definition socks.c:337
int socks_process_outgoing_udp(struct buffer *buf, const struct link_socket_actual *to)
Definition socks.c:484
void establish_socks_proxy_udpassoc(const struct socks_proxy_info *p, socket_descriptor_t ctrl_sd, struct openvpn_sockaddr *relay_addr, const struct event_timeout *server_poll_timeout, struct signal_info *sig_info)
Definition socks.c:395
void socks_process_incoming_udp(struct buffer *buf, struct link_socket_actual *from)
Definition socks.c:446
struct socks_proxy_info * socks_proxy_new(const char *server, const char *port, const char *authfile)
Definition socks.c:52
void socks_proxy_close(struct socks_proxy_info *sp)
Definition socks.c:79
Wrapper structure for dynamically allocated memory.
Definition buffer.h:71
char authfile[256]
Definition socks.h:44
char server[128]
Definition socks.h:42
const char * port
Definition socks.h:43
SOCKET socket_descriptor_t
Definition syshead.h:445