Signed-off-by: Daniel Lenski <dlenski at gmail.com> --- libopenconnect.map.in | 1 + library.c | 5 +++++ openconnect.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/libopenconnect.map.in b/libopenconnect.map.in index 04b8ed5..0f4ccd0 100644 --- a/libopenconnect.map.in +++ b/libopenconnect.map.in @@ -94,6 +94,7 @@ OPENCONNECT_5_4 { OPENCONNECT_5_5 { global: + openconnect_get_protocol; openconnect_get_supported_protocols; openconnect_free_supported_protocols; } OPENCONNECT_5_4; diff --git a/library.c b/library.c index 415c3b9..c147460 100644 --- a/library.c +++ b/library.c @@ -189,6 +189,11 @@ void openconnect_free_supported_protocols(struct oc_vpn_proto *protos) free((void *)protos); } +const char *openconnect_get_protocol(struct openconnect_info *vpninfo) +{ + return vpninfo->proto->name; +} + int openconnect_set_protocol(struct openconnect_info *vpninfo, const char *protocol) { const struct vpn_proto *p; diff --git a/openconnect.h b/openconnect.h index e97dacb..f8ea692 100644 --- a/openconnect.h +++ b/openconnect.h @@ -39,6 +39,7 @@ extern "C" { * API version 5.5: * - Add openconnect_get_supported_protocols() * - Add openconnect_free_supported_protocols() + * - Add openconnect_get_protocol() * * API version 5.4 (v7.08; 2016-12-13): * - Add openconnect_set_pass_tos() @@ -664,6 +665,7 @@ int openconnect_has_system_key_support(void); /* Query and select from among supported protocols */ int openconnect_get_supported_protocols(struct oc_vpn_proto **protos); void openconnect_free_supported_protocols(struct oc_vpn_proto *protos); +const char *openconnect_get_protocol(struct openconnect_info *vpninfo); int openconnect_set_protocol(struct openconnect_info *vpninfo, const char *protocol); struct addrinfo; -- 2.7.4