Support proxy autoconfiguration
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 29 Apr 2009 13:04:26 +0000 (14:04 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 29 Apr 2009 13:04:26 +0000 (14:04 +0100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
cstp.c
openconnect.h
tun.c

diff --git a/cstp.c b/cstp.c
index 534bddb..5e8e41c 100644 (file)
--- a/cstp.c
+++ b/cstp.c
@@ -78,6 +78,8 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
        /* Clear old options which will be overwritten */
        vpninfo->vpn_addr = vpninfo->vpn_netmask = NULL;
        vpninfo->cstp_options = vpninfo->dtls_options = NULL;
+       vpninfo->vpn_domain = vpninfo->vpn_proxy_pac = NULL;
+
        for (i=0; i<3; i++)
                vpninfo->vpn_dns[i] = vpninfo->vpn_nbns[i] = NULL;
 
@@ -233,6 +235,8 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
                        }
                } else if (!strcmp(buf + 7, "Default-Domain")) {
                        vpninfo->vpn_domain = new_option->value;
+               } else if (!strcmp(buf + 7, "MSIE-Proxy-PAC-URL")) {
+                       vpninfo->vpn_proxy_pac = new_option->value;
                } else if (!strcmp(buf + 7, "Split-Include")) {
                        struct split_include *inc = malloc(sizeof(*inc));
                        if (!inc)
index cb8dd55..d1d7d95 100644 (file)
@@ -185,6 +185,7 @@ struct openconnect_info {
        const char *vpn_dns[3];
        const char *vpn_nbns[3];
        const char *vpn_domain;
+       const char *vpn_proxy_pac;
        struct split_include *split_includes;
        struct split_include *split_excludes;
 
diff --git a/tun.c b/tun.c
index afd8af9..2bf248b 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -185,6 +185,9 @@ static void set_script_env(struct openconnect_info *vpninfo)
                setenv("CISCO_DEF_DOMAIN", vpninfo->vpn_domain, 1);
        else unsetenv ("CISCO_DEF_DOMAIN");
 
+       if (vpninfo->vpn_proxy_pac)
+               setenv("CISCO_PROXY_PAC", vpninfo->vpn_proxy_pac, 1);
+
        if (vpninfo->split_includes) {
                struct split_include *this = vpninfo->split_includes;
                int nr_split_includes = 0;