Commit d86782e0 authored by Kevin Cernekee's avatar Kevin Cernekee

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: default avatarKevin Cernekee <cernekee@gmail.com>
parent a492af01
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment