From fbb9eae2c791845756e0dd9136d7becf8da03608 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 9 Dec 2023 12:35:50 +0100 Subject: tools: Fix missing eth-dix in "irm ipcp create" The irm ipcp create tool had the ipcpd-eth-dix missing in the help. Updated the help text where PARAM = {options list} to where PARAM in {options list} and some other small fixes. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/tools/irm/irm.c | 2 +- src/tools/irm/irm_bind.c | 2 +- src/tools/irm/irm_ipcp.c | 9 +++++---- src/tools/irm/irm_ipcp_bootstrap.c | 16 ++++++++-------- src/tools/irm/irm_ipcp_connect.c | 4 ++-- src/tools/irm/irm_ipcp_create.c | 15 ++++++++------- src/tools/irm/irm_ipcp_disconnect.c | 12 ++++++------ src/tools/irm/irm_ipcp_enroll.c | 2 +- src/tools/irm/irm_name.c | 7 ++++--- src/tools/irm/irm_name_create.c | 2 +- src/tools/irm/irm_unbind.c | 2 +- 11 files changed, 38 insertions(+), 35 deletions(-) (limited to 'src/tools/irm') diff --git a/src/tools/irm/irm.c b/src/tools/irm/irm.c index 5d24ad03..1e648b85 100644 --- a/src/tools/irm/irm.c +++ b/src/tools/irm/irm.c @@ -49,7 +49,7 @@ static void usage(void) { printf("Usage: irm [OPERATION]\n\n" - "where OPERATION = {ipcp bind unbind name}\n"); + "where OPERATION in { ipcp bind unbind name }\n"); } static int do_help(int argc, diff --git a/src/tools/irm/irm_bind.c b/src/tools/irm/irm_bind.c index 6a8fd7c2..c3e5a002 100644 --- a/src/tools/irm/irm_bind.c +++ b/src/tools/irm/irm_bind.c @@ -47,7 +47,7 @@ static void usage(void) { printf("Usage: irm bind [OPERATION]\n" "\n" - "where OPERATION = {program process ipcp help}\n"); + "where OPERATION in {program process ipcp help}\n"); } static int do_help(int argc, diff --git a/src/tools/irm/irm_ipcp.c b/src/tools/irm/irm_ipcp.c index 56448742..68d119b9 100644 --- a/src/tools/irm/irm_ipcp.c +++ b/src/tools/irm/irm_ipcp.c @@ -44,10 +44,11 @@ static void usage(void) { printf("Usage: irm ipcp [OPERATION]\n\n" - "where OPERATION = {create destroy\n" - " bootstrap enroll\n" - " connect disconnect\n" - " list help}\n"); + "where OPERATION in {create destroy\n" + " bootstrap enroll\n" + " connect disconnect\n" + " list\n" + " help}\n"); } static int do_help(int argc, char **argv) diff --git a/src/tools/irm/irm_ipcp_bootstrap.c b/src/tools/irm/irm_ipcp_bootstrap.c index f1255113..9895577c 100644 --- a/src/tools/irm/irm_ipcp_bootstrap.c +++ b/src/tools/irm/irm_ipcp_bootstrap.c @@ -88,7 +88,7 @@ static void usage(void) " name \n" " layer \n" " [type [TYPE]]\n" - "where TYPE = {" UNICAST " " BROADCAST " " LOCAL " " + "where TYPE in {" UNICAST " " BROADCAST " " LOCAL " " UDP " " ETH_LLC " " ETH_DIX "},\n\n" "if TYPE == " UNICAST "\n" " [addr
(default: %d)]\n" @@ -99,11 +99,11 @@ static void usage(void) " [congestion (default: %s)]\n" " [hash [ALGORITHM] (default: %s)]\n" " [autobind]\n" - "where ADDRESS_POLICY = {" FLAT_RANDOM_ADDR_AUTH "}\n" - " ROUTING_POLICY = {" LINK_STATE_ROUTING " " + "where ADDRESS_POLICY in {" FLAT_RANDOM_ADDR_AUTH "}\n" + " ROUTING_POLICY in {" LINK_STATE_ROUTING " " LINK_STATE_LFA_ROUTING " " LINK_STATE_ECM_ROUTING "}\n" - " CONG_POLICY = {" NONE_CA " " MB_ECN_CA "}\n" - " ALGORITHM = {" SHA3_224 " " SHA3_256 " " + " CONG_POLICY in {" NONE_CA " " MB_ECN_CA "}\n" + " ALGORITHM in {" SHA3_224 " " SHA3_256 " " SHA3_384 " " SHA3_512 "}\n\n" "if TYPE == " UDP "\n" " ip \n" @@ -113,17 +113,17 @@ static void usage(void) "if TYPE == " ETH_LLC "\n" " dev \n" " [hash [ALGORITHM] (default: %s)]\n" - "where ALGORITHM = {" SHA3_224 " " SHA3_256 " " + "where ALGORITHM in {" SHA3_224 " " SHA3_256 " " SHA3_384 " " SHA3_512 "}\n\n" "if TYPE == " ETH_DIX "\n" " dev \n" " [ethertype (default: 0x%4X)]\n" " [hash [ALGORITHM] (default: %s)]\n" - "where ALGORITHM = {" SHA3_224 " " SHA3_256 " " + "where ALGORITHM in {" SHA3_224 " " SHA3_256 " " SHA3_384 " " SHA3_512 "}\n\n" "if TYPE == " LOCAL "\n" " [hash [ALGORITHM] (default: %s)]\n" - "where ALGORITHM = {" SHA3_224 " " SHA3_256 " " + "where ALGORITHM in {" SHA3_224 " " SHA3_256 " " SHA3_384 " " SHA3_512 "}\n\n" "if TYPE == " BROADCAST "\n" " [autobind]\n\n", diff --git a/src/tools/irm/irm_ipcp_connect.c b/src/tools/irm/irm_ipcp_connect.c index c1b2a1d1..222ac620 100644 --- a/src/tools/irm/irm_ipcp_connect.c +++ b/src/tools/irm/irm_ipcp_connect.c @@ -55,10 +55,10 @@ static void usage(void) " name \n" " dst \n" " [component [COMPONENT]]\n" - "where COMPONENT = {" DT " " MGMT "}\n\n" + "where COMPONENT in {" DT " " MGMT "}\n\n" "if COMPONENT == " DT "\n" " [qos [QOS]\n" - "where QOS = {raw, best, voice, video, data}\n\n"); + "where QOS in {raw, best, voice, video, data}\n"); } int do_connect_ipcp(int argc, diff --git a/src/tools/irm/irm_ipcp_create.c b/src/tools/irm/irm_ipcp_create.c index 059156a9..ebfcb02f 100644 --- a/src/tools/irm/irm_ipcp_create.c +++ b/src/tools/irm/irm_ipcp_create.c @@ -44,7 +44,7 @@ #include "irm_ops.h" #include "irm_utils.h" -#define UNICAST "unicast" +#define UNICAST "unicast" #define BROADCAST "broadcast" #define UDP "udp" #define ETH_LLC "eth-llc" @@ -56,17 +56,17 @@ static void usage(void) printf("Usage: irm ipcp create\n" " name \n" " type [TYPE]\n\n" - "where TYPE = {" UNICAST " " BROADCAST " " LOCAL " " - UDP " " ETH_LLC "}\n"); + "where TYPE in {" UNICAST " " BROADCAST " " LOCAL " " + UDP " " ETH_LLC " " ETH_DIX "}\n"); } int do_create_ipcp(int argc, char ** argv) { - char * ipcp_type = NULL; - char * ipcp_name = NULL; - enum ipcp_type type = 0; - pid_t pid; + char * ipcp_type = NULL; + char * ipcp_name = NULL; + enum ipcp_type type = 0; + pid_t pid; while (argc > 0) { if (matches(*argv, "type") == 0) { @@ -101,6 +101,7 @@ int do_create_ipcp(int argc, else if (strcmp(ipcp_type, ETH_DIX) == 0) type = IPCP_ETH_DIX; else { + printf("IPCP type \"%s\" is unknown.\n", ipcp_type); usage(); return -1; } diff --git a/src/tools/irm/irm_ipcp_disconnect.c b/src/tools/irm/irm_ipcp_disconnect.c index c591a9fe..2b54a998 100644 --- a/src/tools/irm/irm_ipcp_disconnect.c +++ b/src/tools/irm/irm_ipcp_disconnect.c @@ -54,19 +54,19 @@ static void usage(void) " name \n" " dst \n" " [component [COMPONENT]]\n\n" - "where COMPONENT = {" DT " " MGMT "}\n"); + "where COMPONENT in {" DT " " MGMT "}\n"); } int do_disconnect_ipcp(int argc, char ** argv) { - char * ipcp = NULL; - char * dst = NULL; - char * comp = "*"; + char * ipcp = NULL; + char * dst = NULL; + char * comp = "*"; char * component = NULL; struct ipcp_list_info * ipcps; - ssize_t len = 0; - pid_t pid = -1; + ssize_t len = 0; + pid_t pid = -1; ssize_t i; while (argc > 0) { diff --git a/src/tools/irm/irm_ipcp_enroll.c b/src/tools/irm/irm_ipcp_enroll.c index 63f740fe..70bf5a34 100644 --- a/src/tools/irm/irm_ipcp_enroll.c +++ b/src/tools/irm/irm_ipcp_enroll.c @@ -57,7 +57,7 @@ static void usage(void) " [dst ]\n" " [type [TYPE], default = " UNICAST "]\n" " [autobind]\n" - "where TYPE = {" UNICAST " " BROADCAST "}\n"); + "where TYPE in {" UNICAST " " BROADCAST "}\n"); } static int get_layer_name(const char * ipcp, diff --git a/src/tools/irm/irm_name.c b/src/tools/irm/irm_name.c index 14a792a7..2edf48e5 100644 --- a/src/tools/irm/irm_name.c +++ b/src/tools/irm/irm_name.c @@ -44,9 +44,10 @@ static void usage(void) { printf("Usage: irm name [OPERATION]\n\n" - "where OPERATION = {create destroy\n" - " register unregister\n" - " list help}\n"); + "where OPERATION in {create destroy\n" + " register unregister\n" + " list\n" + " help}\n"); } static int do_help(int argc, char **argv) diff --git a/src/tools/irm/irm_name_create.c b/src/tools/irm/irm_name_create.c index 9f7e04f7..e92b1f63 100644 --- a/src/tools/irm/irm_name_create.c +++ b/src/tools/irm/irm_name_create.c @@ -52,7 +52,7 @@ static void usage(void) printf("Usage: irm name create\n" " \n" " lb [LB_POLICY], default: %s\n\n" - "where LB_POLICY = {" RR " " SPILL "}\n", RR); + "where LB_POLICY in {" RR " " SPILL "}\n", RR); } int do_create_name(int argc, diff --git a/src/tools/irm/irm_unbind.c b/src/tools/irm/irm_unbind.c index 25b9ffbe..debebce5 100644 --- a/src/tools/irm/irm_unbind.c +++ b/src/tools/irm/irm_unbind.c @@ -47,7 +47,7 @@ static void usage(void) { printf("Usage: irm unbind [OPERATION]\n" "\n" - "where OPERATION = {program process ipcp help}\n"); + "where OPERATION in {program process ipcp help}\n"); } static int do_help(int argc, -- cgit v1.2.3