summaryrefslogtreecommitdiffstats
path: root/src/openvpn/manage.c
diff options
context:
space:
mode:
authorHeiko Hund <heiko.hund@sophos.com>2012-07-11 14:16:50 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2012-07-19 21:37:54 +0200
commitaf1bf85aee836f2b729c38990028c035b6c69152 (patch)
tree88d0bce58fedade815ef121d2cc597e2df00f6e3 /src/openvpn/manage.c
parentaf417baa93f4ebcc545486cbd9635fbc602ba148 (diff)
downloadopenvpn-af1bf85aee836f2b729c38990028c035b6c69152.tar.gz
openvpn-af1bf85aee836f2b729c38990028c035b6c69152.tar.xz
openvpn-af1bf85aee836f2b729c38990028c035b6c69152.zip
add option --management-query-proxy
Make openvpn query for proxy information through the management interface. This allows GUIs to provide (automatically detected) proxy information on a per connection basis. This new option supersedes the undocumented --http-proxy-fallback option and puts the responsibilty for HTTP proxy fallback handling to the GUI caring for such. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Reviewed-by: James Yonan <james@openvpn.net> Message-Id: 1342009010-9735-1-git-send-email-heiko.hund@sophos.com URL: http://article.gmane.org/gmane.network.openvpn.devel/6841 Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'src/openvpn/manage.c')
-rw-r--r--src/openvpn/manage.c52
1 files changed, 10 insertions, 42 deletions
diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
index 8d91675..3ef14e5 100644
--- a/src/openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -93,6 +93,7 @@ man_help ()
msg (M_CLIENT, "net : (Windows only) Show network info and routing table.");
msg (M_CLIENT, "password type p : Enter password p for a queried OpenVPN password.");
msg (M_CLIENT, "remote type [host port] : Override remote directive, type=ACCEPT|MOD|SKIP.");
+ msg (M_CLIENT, "proxy type [host port flags] : Enter dynamic proxy server info.");
msg (M_CLIENT, "pid : Show process ID of the current OpenVPN process.");
#ifdef ENABLE_PKCS11
msg (M_CLIENT, "pkcs11-id-count : Get number of available PKCS#11 identities.");
@@ -121,10 +122,6 @@ man_help ()
msg (M_CLIENT, "username type u : Enter username u for a queried OpenVPN username.");
msg (M_CLIENT, "verb [n] : Set log verbosity level to n, or show if n is absent.");
msg (M_CLIENT, "version : Show current version number.");
-#if HTTP_PROXY_FALLBACK
- msg (M_CLIENT, "http-proxy-fallback <server> <port> [flags] : Enter dynamic HTTP proxy fallback info.");
- msg (M_CLIENT, "http-proxy-fallback-disable : Disable HTTP proxy fallback.");
-#endif
msg (M_CLIENT, "END");
}
@@ -1071,31 +1068,21 @@ man_need (struct management *man, const char **p, const int n, unsigned int flag
return true;
}
-#if HTTP_PROXY_FALLBACK
-
static void
-man_http_proxy_fallback (struct management *man, const char *server, const char *port, const char *flags)
+man_proxy (struct management *man, const char **p)
{
- if (man->persist.callback.http_proxy_fallback_cmd)
+ if (man->persist.callback.proxy_cmd)
{
- const bool status = (*man->persist.callback.http_proxy_fallback_cmd)(man->persist.callback.arg, server, port, flags);
+ const bool status = (*man->persist.callback.proxy_cmd)(man->persist.callback.arg, p);
if (status)
- {
- msg (M_CLIENT, "SUCCESS: proxy-fallback command succeeded");
- }
+ msg (M_CLIENT, "SUCCESS: proxy command succeeded");
else
- {
- msg (M_CLIENT, "ERROR: proxy-fallback command failed");
- }
+ msg (M_CLIENT, "ERROR: proxy command failed");
}
else
- {
- msg (M_CLIENT, "ERROR: The proxy-fallback command is not supported by the current daemon mode");
- }
+ msg (M_CLIENT, "ERROR: The proxy command is not supported by the current daemon mode");
}
-#endif
-
static void
man_remote (struct management *man, const char **p)
{
@@ -1335,17 +1322,11 @@ man_dispatch_command (struct management *man, struct status_output *so, const ch
man_pkcs11_id_get (man, atoi(p[1]));
}
#endif
-#if HTTP_PROXY_FALLBACK
- else if (streq (p[0], "http-proxy-fallback"))
+ else if (streq (p[0], "proxy"))
{
- if (man_need (man, p, 2, MN_AT_LEAST))
- man_http_proxy_fallback (man, p[1], p[2], p[3]);
- }
- else if (streq (p[0], "http-proxy-fallback-disable"))
- {
- man_http_proxy_fallback (man, NULL, NULL, NULL);
+ if (man_need (man, p, 1, MN_AT_LEAST))
+ man_proxy (man, p);
}
-#endif
else if (streq (p[0], "remote"))
{
if (man_need (man, p, 1, MN_AT_LEAST))
@@ -3345,19 +3326,6 @@ log_history_ref (const struct log_history *h, const int index)
return NULL;
}
-#if HTTP_PROXY_FALLBACK
-
-void
-management_http_proxy_fallback_notify (struct management *man, const char *type, const char *remote_ip_hint)
-{
- if (remote_ip_hint)
- msg (M_CLIENT, ">PROXY:%s,%s", type, remote_ip_hint);
- else
- msg (M_CLIENT, ">PROXY:%s", type);
-}
-
-#endif /* HTTP_PROXY_FALLBACK */
-
#else
static void dummy(void) {}
#endif /* ENABLE_MANAGEMENT */