Skip to content

Commit

Permalink
add OC_PROTO_HIDDEN and use this to hide jun2pulse from the displayed…
Browse files Browse the repository at this point in the history
… protocols list

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
  • Loading branch information
dlenski committed Nov 4, 2020
1 parent d08762d commit 91cdfd5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library.c
Expand Up @@ -189,7 +189,7 @@ static const struct vpn_proto openconnect_protos[] = {
.name = "jun2pulse",
.pretty_name = N_("Pulse Connect Secure with Juniper auth"),
.description = N_("Compatible with Pulse Connect Secure SSL VPN (with Juniper auth for backwards-compatibility)"),
.flags = OC_PROTO_PROXY,
.flags = OC_PROTO_PROXY | OC_PROTO_HIDDEN,
.vpn_close_session = pulse_bye,
.tcp_connect = pulse_connect_from_oncp_auth,
.tcp_mainloop = pulse_mainloop,
Expand Down
15 changes: 10 additions & 5 deletions main.c
Expand Up @@ -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);
Expand All @@ -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);
}
}
Expand Down
1 change: 1 addition & 0 deletions openconnect.h
Expand Up @@ -189,6 +189,7 @@ extern "C" {
#define OC_PROTO_AUTH_OTP (1<<3)
#define OC_PROTO_AUTH_STOKEN (1<<4)
#define OC_PROTO_PERIODIC_TROJAN (1<<5)
#define OC_PROTO_HIDDEN (1<<6)

struct oc_vpn_proto {
const char *name;
Expand Down

0 comments on commit 91cdfd5

Please sign in to comment.