~ubuntu-branches/ubuntu/saucy/openvpn/saucy-proposed

« back to all changes in this revision

Viewing changes to proxy.h

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2013-05-24 17:42:45 UTC
  • mfrom: (1.1.19) (10.2.22 sid)
  • Revision ID: package-import@ubuntu.com-20130524174245-g9y6wlforycufqy5
Tags: 2.3.1-2ubuntu1
* Merge from Debian unstable. Remaining changes:
  - debian/openvpn.init.d:
    + Do not use start-stop-daemon and </dev/null to avoid blocking boot.
    + Show per-VPN result messages.
    + Add "--script-security 2" by default for backwards compatabliity.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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-2010 OpenVPN Technologies, 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
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
23
 
 */
24
 
 
25
 
#ifndef PROXY_H
26
 
#define PROXY_H
27
 
 
28
 
#include "buffer.h"
29
 
#include "misc.h"
30
 
 
31
 
#ifdef GENERAL_PROXY_SUPPORT
32
 
 
33
 
/*
34
 
 * Return value for get_proxy_settings to automatically
35
 
 * determine proxy information.
36
 
 */
37
 
struct auto_proxy_info_entry {
38
 
  char *server;
39
 
  int port;
40
 
};
41
 
 
42
 
struct auto_proxy_info {
43
 
  struct auto_proxy_info_entry http;
44
 
  struct auto_proxy_info_entry socks;
45
 
};
46
 
 
47
 
struct auto_proxy_info *get_proxy_settings (char **err, struct gc_arena *gc);
48
 
 
49
 
#ifdef WIN32
50
 
void show_win_proxy_settings (const int msglevel);
51
 
#endif /* WIN32 */
52
 
 
53
 
#endif /* GENERAL_PROXY_SUPPORT */
54
 
 
55
 
#ifdef ENABLE_HTTP_PROXY
56
 
 
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 */
64
 
 
65
 
struct http_proxy_options {
66
 
  const char *server;
67
 
  int port;
68
 
  bool retry;
69
 
  int timeout;
70
 
 
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 */
74
 
  int auth_retry;
75
 
 
76
 
  const char *auth_method_string;
77
 
  const char *auth_file;
78
 
  const char *http_version;
79
 
  const char *user_agent;
80
 
};
81
 
 
82
 
struct http_proxy_options_simple {
83
 
  const char *server;
84
 
  int port;
85
 
  int auth_retry;
86
 
};
87
 
 
88
 
struct http_proxy_info {
89
 
  bool defined;
90
 
  int auth_method;
91
 
  struct http_proxy_options options;
92
 
  struct user_pass up;
93
 
  char *proxy_authenticate;
94
 
  bool queried_creds;
95
 
};
96
 
 
97
 
struct http_proxy_info *http_proxy_new (const struct http_proxy_options *o,
98
 
                                        struct auto_proxy_info *auto_proxy_info);
99
 
 
100
 
void http_proxy_close (struct http_proxy_info *hp);
101
 
 
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);
108
 
 
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);
111
 
 
112
 
#endif /* ENABLE_HTTP_PROXY */
113
 
 
114
 
#endif /* PROXY_H */