From: Daniel Lenski Date: Wed, 20 May 2020 03:53:25 +0000 (-0700) Subject: add OC_PROTO_HIDDEN and use this to hide nullppp from the displayed protocols list X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d63909fe25485adb91e929847ff523abb2579dc8;p=users%2Fdwmw2%2Fopenconnect.git add OC_PROTO_HIDDEN and use this to hide nullppp from the displayed protocols list Signed-off-by: Daniel Lenski --- diff --git a/library.c b/library.c index df4ff8b6..727d1b55 100644 --- a/library.c +++ b/library.c @@ -239,9 +239,9 @@ static const struct vpn_proto openconnect_protos[] = { #endif }, { .name = "nullppp", - .pretty_name = N_("nullppp"), - .description = N_("nullppp"), - .flags = OC_PROTO_PROXY, + .pretty_name = N_("PPP over TLS"), + .description = N_("Unauthenticated RFC1661/RFC1662 PPP over TLS"), + .flags = OC_PROTO_PROXY | OC_PROTO_HIDDEN, .tcp_connect = nullppp_connect, .tcp_mainloop = ppp_mainloop, .add_http_headers = http_common_headers, diff --git a/main.c b/main.c index 37ee8d2d..1dde9332 100644 --- a/main.c +++ b/main.c @@ -665,8 +665,10 @@ static void print_supported_protocols(void) if (n>=0) { printf(_("Supported protocols:")); for (p=protos; n; p++, n--) { - printf("%s%s%s", sep, p->name, p==protos ? _(" (default)") : ""); - sep = comma; + if (!(p->flags & OC_PROTO_HIDDEN)) { + printf("%s%s%s", sep, p->name, p==protos ? _(" (default)") : ""); + sep = comma; + } } printf("\n"); free(protos); @@ -681,9 +683,12 @@ static void print_supported_protocols_usage(void) n = openconnect_get_supported_protocols(&protos); if (n>=0) { printf("\n%s:\n", _("Set VPN protocol")); - for (p=protos; n; p++, n--) - printf(" --protocol=%-16s %s%s\n", - p->name, p->description, p==protos ? _(" (default)") : ""); + for (p=protos; n; p++, n--) { + if (!(p->flags & OC_PROTO_HIDDEN)) { + printf(" --protocol=%-16s %s%s\n", + p->name, p->description, p==protos ? _(" (default)") : ""); + } + } openconnect_free_supported_protocols(protos); } } diff --git a/openconnect.h b/openconnect.h index 2dbce891..7b62c2ed 100644 --- a/openconnect.h +++ b/openconnect.h @@ -188,7 +188,8 @@ extern "C" { #define OC_PROTO_AUTH_CERT (1<<2) #define OC_PROTO_AUTH_OTP (1<<3) #define OC_PROTO_AUTH_STOKEN (1<<4) -#define OC_PROTO_PERIODIC_TROJAN (1<<4) +#define OC_PROTO_PERIODIC_TROJAN (1<<5) +#define OC_PROTO_HIDDEN (1<<6) struct oc_vpn_proto { const char *name;