[PATCH/RFC V2 11/26] cstp: Export make_cstp_connection()

Kevin Cernekee cernekee at gmail.com
Sun Aug 11 21:49:12 EDT 2013


Just rename it and add it to openconnect.h.

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 cstp.c                 |    4 ++--
 libopenconnect.map.in  |    1 +
 main.c                 |    2 +-
 openconnect-internal.h |    1 -
 openconnect.h          |    3 +++
 5 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/cstp.c b/cstp.c
index beab3f9..71fde30 100644
--- a/cstp.c
+++ b/cstp.c
@@ -501,7 +501,7 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)
 }
 
 
-int make_cstp_connection(struct openconnect_info *vpninfo)
+int openconnect_make_cstp_connection(struct openconnect_info *vpninfo)
 {
 	int ret;
 
@@ -560,7 +560,7 @@ int cstp_reconnect(struct openconnect_info *vpninfo)
 	timeout = vpninfo->reconnect_timeout;
 	interval = vpninfo->reconnect_interval;
 
-	while ((ret = make_cstp_connection(vpninfo))) {
+	while ((ret = openconnect_make_cstp_connection(vpninfo))) {
 		if (timeout <= 0)
 			return ret;
 		vpn_progress(vpninfo, PRG_INFO,
diff --git a/libopenconnect.map.in b/libopenconnect.map.in
index f941e8f..c6aba18 100644
--- a/libopenconnect.map.in
+++ b/libopenconnect.map.in
@@ -51,6 +51,7 @@ OPENCONNECT_2.3 {
 	openconnect_setup_tun_script;
 	openconnect_setup_tun_fd;
 	openconnect_setup_dtls;
+	openconnect_make_cstp_connection;
 } OPENCONNECT_2.2;
 
 OPENCONNECT_PRIVATE {
diff --git a/main.c b/main.c
index f3bd972..afcefb2 100644
--- a/main.c
+++ b/main.c
@@ -876,7 +876,7 @@ int main(int argc, char **argv)
 			exit(0);
 		}
 	}
-	if (make_cstp_connection(vpninfo)) {
+	if (openconnect_make_cstp_connection(vpninfo)) {
 		fprintf(stderr, _("Creating SSL connection failed\n"));
 		exit(1);
 	}
diff --git a/openconnect-internal.h b/openconnect-internal.h
index b731f0d..1d68f6e 100644
--- a/openconnect-internal.h
+++ b/openconnect-internal.h
@@ -407,7 +407,6 @@ int dtls_try_handshake(struct openconnect_info *vpninfo);
 int connect_dtls_socket(struct openconnect_info *vpninfo);
 
 /* cstp.c */
-int make_cstp_connection(struct openconnect_info *vpninfo);
 int cstp_mainloop(struct openconnect_info *vpninfo, int *timeout);
 int cstp_bye(struct openconnect_info *vpninfo, const char *reason);
 int cstp_reconnect(struct openconnect_info *vpninfo);
diff --git a/openconnect.h b/openconnect.h
index 1f9e0c5..3a64ba7 100644
--- a/openconnect.h
+++ b/openconnect.h
@@ -224,6 +224,9 @@ int openconnect_setup_cancel_pipe(struct openconnect_info *vpninfo);
 
 const char *openconnect_get_version(void);
 
+/* Open CSTP connection; on success, IP information will be available. */
+int openconnect_make_cstp_connection(struct openconnect_info *vpninfo);
+
 /* Create a tun device through the OS kernel (typical use case). Both
    strings are optional and can be NULL if desired. */
 int openconnect_setup_tun_device(struct openconnect_info *vpninfo, char *vpnc_script, char *ifname);
-- 
1.7.9.5




More information about the openconnect-devel mailing list