From d86782e062f660a745f95f5f4e10235a86f3ebf9 Mon Sep 17 00:00:00 2001 From: Kevin Cernekee Date: Sat, 21 Dec 2013 20:30:20 -0800 Subject: [PATCH] library: Make vpn_option a public struct Rename vpn_option to oc_vpn_option and move it into the public header file. Signed-off-by: Kevin Cernekee --- auth.c | 2 +- cstp.c | 14 +++++++------- dtls.c | 2 +- http.c | 8 ++++---- library.c | 4 ++-- openconnect-internal.h | 12 +++--------- openconnect.h | 6 ++++++ tun.c | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/auth.c b/auth.c index 04858e3a..efab89b2 100644 --- a/auth.c +++ b/auth.c @@ -717,7 +717,7 @@ int handle_auth_form(struct openconnect_info *vpninfo, struct oc_auth_form *form const char **request_body_type) { int ret; - struct vpn_option *opt, *next; + struct oc_vpn_option *opt, *next; if (!strcmp(form->auth_id, "success")) return OC_FORM_RESULT_LOGGEDIN; diff --git a/cstp.c b/cstp.c index 6a0854bc..b772484a 100644 --- a/cstp.c +++ b/cstp.c @@ -177,10 +177,10 @@ static int start_cstp_connection(struct openconnect_info *vpninfo) char buf[65536]; int i; int retried = 0, sessid_found = 0; - struct vpn_option **next_dtls_option = &vpninfo->dtls_options; - struct vpn_option **next_cstp_option = &vpninfo->cstp_options; - struct vpn_option *old_cstp_opts = vpninfo->cstp_options; - struct vpn_option *old_dtls_opts = vpninfo->dtls_options; + struct oc_vpn_option **next_dtls_option = &vpninfo->dtls_options; + struct oc_vpn_option **next_cstp_option = &vpninfo->cstp_options; + struct oc_vpn_option *old_cstp_opts = vpninfo->cstp_options; + struct oc_vpn_option *old_dtls_opts = vpninfo->dtls_options; const char *old_addr = vpninfo->ip_info.addr; const char *old_netmask = vpninfo->ip_info.netmask; const char *old_addr6 = vpninfo->ip_info.addr6; @@ -282,7 +282,7 @@ static int start_cstp_connection(struct openconnect_info *vpninfo) mtu = 0; while ((i = openconnect_SSL_gets(vpninfo, buf, sizeof(buf)))) { - struct vpn_option *new_option; + struct oc_vpn_option *new_option; char *colon; if (i < 0) @@ -477,14 +477,14 @@ static int start_cstp_connection(struct openconnect_info *vpninfo) } while (old_dtls_opts) { - struct vpn_option *tmp = old_dtls_opts; + struct oc_vpn_option *tmp = old_dtls_opts; old_dtls_opts = old_dtls_opts->next; free(tmp->value); free(tmp->option); free(tmp); } while (old_cstp_opts) { - struct vpn_option *tmp = old_cstp_opts; + struct oc_vpn_option *tmp = old_cstp_opts; old_cstp_opts = old_cstp_opts->next; free(tmp->value); free(tmp->option); diff --git a/dtls.c b/dtls.c index f760171c..a7bffcff 100644 --- a/dtls.c +++ b/dtls.c @@ -583,7 +583,7 @@ static int dtls_restart(struct openconnect_info *vpninfo) int openconnect_setup_dtls(struct openconnect_info *vpninfo, int dtls_attempt_period) { - struct vpn_option *dtls_opt = vpninfo->dtls_options; + struct oc_vpn_option *dtls_opt = vpninfo->dtls_options; int dtls_port = 0; vpninfo->dtls_attempt_period = dtls_attempt_period; diff --git a/http.c b/http.c index 5f80db34..9c1ef71a 100644 --- a/http.c +++ b/http.c @@ -135,7 +135,7 @@ static int buf_free(struct oc_text_buf *buf) static int http_add_cookie(struct openconnect_info *vpninfo, const char *option, const char *value) { - struct vpn_option *new, **this; + struct oc_vpn_option *new, **this; if (*value) { new = malloc(sizeof(*new)); @@ -433,7 +433,7 @@ static int process_http_response(struct openconnect_info *vpninfo, int *result, static void add_common_headers(struct openconnect_info *vpninfo, struct oc_text_buf *buf) { - struct vpn_option *opt; + struct oc_vpn_option *opt; buf_append(buf, "Host: %s\r\n", vpninfo->hostname); buf_append(buf, "User-Agent: %s\r\n", vpninfo->useragent); @@ -717,7 +717,7 @@ int internal_parse_url(char *url, char **res_proto, char **res_host, static void clear_cookies(struct openconnect_info *vpninfo) { - struct vpn_option *opt, *next; + struct oc_vpn_option *opt, *next; for (opt = vpninfo->cookies; opt; opt = next) { next = opt->next; @@ -989,7 +989,7 @@ static int check_response_type(struct openconnect_info *vpninfo, char *form_buf) */ int openconnect_obtain_cookie(struct openconnect_info *vpninfo) { - struct vpn_option *opt; + struct oc_vpn_option *opt; char *form_buf = NULL; struct oc_auth_form *form = NULL; int result, buflen, tries; diff --git a/library.c b/library.c index 611a9433..283fd67c 100644 --- a/library.c +++ b/library.c @@ -107,9 +107,9 @@ int openconnect_set_reported_os(struct openconnect_info *vpninfo, const char *os return 0; } -static void free_optlist(struct vpn_option *opt) +static void free_optlist(struct oc_vpn_option *opt) { - struct vpn_option *next; + struct oc_vpn_option *next; for (; opt; opt = next) { next = opt->next; diff --git a/openconnect-internal.h b/openconnect-internal.h index bdd1ecbd..6f270461 100644 --- a/openconnect-internal.h +++ b/openconnect-internal.h @@ -91,12 +91,6 @@ struct pkt { unsigned char data[]; }; -struct vpn_option { - char *option; - char *value; - struct vpn_option *next; -}; - #define KA_NONE 0 #define KA_DPD 1 #define KA_DPD_DEAD 2 @@ -194,9 +188,9 @@ struct openconnect_info { OPENCONNECT_X509 *peer_cert; char *cookie; /* Pointer to within cookies list */ - struct vpn_option *cookies; - struct vpn_option *cstp_options; - struct vpn_option *dtls_options; + struct oc_vpn_option *cookies; + struct oc_vpn_option *cstp_options; + struct oc_vpn_option *dtls_options; #if defined(OPENCONNECT_OPENSSL) X509 *cert_x509; diff --git a/openconnect.h b/openconnect.h index 92eb8668..920c59b4 100644 --- a/openconnect.h +++ b/openconnect.h @@ -181,6 +181,12 @@ struct oc_ip_info { struct oc_split_include *split_excludes; }; +struct oc_vpn_option { + char *option; + char *value; + struct oc_vpn_option *next; +}; + /****************************************************************************/ #define PRG_ERR 0 diff --git a/tun.c b/tun.c index 9ce117a5..e2937ba5 100644 --- a/tun.c +++ b/tun.c @@ -202,7 +202,7 @@ static void setenv_cstp_opts(struct openconnect_info *vpninfo) char *env_buf; int buflen = 0; int bufofs = 0; - struct vpn_option *opt; + struct oc_vpn_option *opt; for (opt = vpninfo->cstp_options; opt; opt = opt->next) buflen += 2 + strlen(opt->option) + strlen(opt->value);