]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
add OC_PROTO_HIDDEN and use this to hide nullppp from the displayed protocols list
authorDaniel Lenski <dlenski@gmail.com>
Wed, 20 May 2020 03:53:25 +0000 (20:53 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Wed, 20 May 2020 03:53:25 +0000 (20:53 -0700)
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
library.c
main.c
openconnect.h

index df4ff8b6aad8bc29b6ae6f45d079e10b538312e2..727d1b5536b024e30406e64ce3fec8e7832df300 100644 (file)
--- 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 37ee8d2d3f6937e2c9ba859f68d1451a36841bf0..1dde93328f8c816539fe8160f7c54cbe259b0cda 100644 (file)
--- 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);
        }
 }
index 2dbce891d2734b6c00b7e03053c4c1051b55a7e6..7b62c2ed358f5fdc300450e7c03776afa4db46af 100644 (file)
@@ -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;