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-2025 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, http://cmeerw.org)
26 */
27
28#ifndef SOCKS_H
29#define SOCKS_H
30
31#include "buffer.h"
32
33struct openvpn_sockaddr;
35
37{
38 bool defined;
39
40 char server[128];
41 const char *port;
42 char authfile[256];
43};
44
45struct socks_proxy_info *socks_proxy_new(const char *server, const char *port,
46 const char *authfile);
47
48void socks_proxy_close(struct socks_proxy_info *sp);
49
51 socket_descriptor_t sd, /* already open to proxy */
52 const char *host, /* openvpn server remote */
53 const char *servname, /* openvpn server port */
54 struct event_timeout *server_poll_timeout,
55 struct signal_info *sig_info);
56
58 socket_descriptor_t ctrl_sd, /* already open to proxy */
59 struct openvpn_sockaddr *relay_addr,
60 struct event_timeout *server_poll_timeout,
61 struct signal_info *sig_info);
62
63void socks_process_incoming_udp(struct buffer *buf, struct link_socket_actual *from);
64
65int socks_process_outgoing_udp(struct buffer *buf, const struct link_socket_actual *to);
66
67#endif /* ifndef SOCKS_H */
void establish_socks_proxy_passthru(struct socks_proxy_info *p, socket_descriptor_t sd, const char *host, const char *servname, struct event_timeout *server_poll_timeout, struct signal_info *sig_info)
Definition socks.c:448
int socks_process_outgoing_udp(struct buffer *buf, const struct link_socket_actual *to)
Definition socks.c:597
void socks_process_incoming_udp(struct buffer *buf, struct link_socket_actual *from)
Definition socks.c:559
struct socks_proxy_info * socks_proxy_new(const char *server, const char *port, const char *authfile)
Definition socks.c:51
void establish_socks_proxy_udpassoc(struct socks_proxy_info *p, socket_descriptor_t ctrl_sd, struct openvpn_sockaddr *relay_addr, struct event_timeout *server_poll_timeout, struct signal_info *sig_info)
Definition socks.c:512
void socks_proxy_close(struct socks_proxy_info *sp)
Definition socks.c:78
Wrapper structure for dynamically allocated memory.
Definition buffer.h:60
char authfile[256]
Definition socks.h:42
char server[128]
Definition socks.h:40
const char * port
Definition socks.h:41
SOCKET socket_descriptor_t
Definition syshead.h:440