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
8
* Copyright (C) 2002-2010 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
31
#ifdef GENERAL_PROXY_SUPPORT
34
* Return value for get_proxy_settings to automatically
35
* determine proxy information.
37
struct auto_proxy_info_entry {
42
struct auto_proxy_info {
43
struct auto_proxy_info_entry http;
44
struct auto_proxy_info_entry socks;
47
struct auto_proxy_info *get_proxy_settings (char **err, struct gc_arena *gc);
50
void show_win_proxy_settings (const int msglevel);
53
#endif /* GENERAL_PROXY_SUPPORT */
55
#ifdef ENABLE_HTTP_PROXY
57
/* HTTP CONNECT authentication methods */
58
#define HTTP_AUTH_NONE 0
59
#define HTTP_AUTH_BASIC 1
60
#define HTTP_AUTH_DIGEST 2
61
#define HTTP_AUTH_NTLM 3
62
#define HTTP_AUTH_NTLM2 4
63
#define HTTP_AUTH_N 5 /* number of HTTP_AUTH methods */
65
struct http_proxy_options {
71
# define PAR_NO 0 /* don't support any auth retries */
72
# define PAR_ALL 1 /* allow all proxy auth protocols */
73
# define PAR_NCT 2 /* disable cleartext proxy auth protocols */
76
const char *auth_method_string;
77
const char *auth_file;
78
const char *http_version;
79
const char *user_agent;
82
struct http_proxy_options_simple {
88
struct http_proxy_info {
91
struct http_proxy_options options;
93
char *proxy_authenticate;
97
struct http_proxy_info *http_proxy_new (const struct http_proxy_options *o,
98
struct auto_proxy_info *auto_proxy_info);
100
void http_proxy_close (struct http_proxy_info *hp);
102
bool establish_http_proxy_passthru (struct http_proxy_info *p,
103
socket_descriptor_t sd, /* already open to proxy */
104
const char *host, /* openvpn server remote */
105
const int port, /* openvpn server port */
106
struct buffer *lookahead,
107
volatile int *signal_received);
109
uint8_t *make_base64_string2 (const uint8_t *str, int str_len, struct gc_arena *gc);
110
uint8_t *make_base64_string (const uint8_t *str, struct gc_arena *gc);
112
#endif /* ENABLE_HTTP_PROXY */