From: Daniel Walton Date: Fri, 23 Sep 2016 01:07:05 +0000 (+0000) Subject: isisd: argv update X-Git-Tag: frr-3.0-branchpoint~129^2~186 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b823bd432cd92234c48bedfd62f4649c8937502c;p=matthieu%2Ffrr.git isisd: argv update Signed-off-by: Daniel Walton --- diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c index 5311b5c69c..cf598cd5d6 100644 --- a/isisd/isis_redist.c +++ b/isisd/isis_redist.c @@ -539,8 +539,7 @@ isis_redist_area_finish(struct isis_area *area) DEFUN (isis_redistribute, isis_redistribute_cmd, - "redistribute (ipv4|ipv6) " QUAGGA_REDIST_STR_ISISD - " (level-1|level-2) {metric <0-16777215>|route-map WORD}", + "redistribute (ipv4|ipv6) " QUAGGA_REDIST_STR_ISISD " (level-1|level-2) {metric <0-16777215>|route-map WORD}", REDIST_STR "Redistribute IPv4 routes\n" "Redistribute IPv6 routes\n" @@ -563,7 +562,7 @@ DEFUN (isis_redistribute, if (argc < 5) return CMD_WARNING; - family = str2family(argv[0]); + family = str2family(argv[1]->arg); if (family < 0) return CMD_WARNING; @@ -571,13 +570,13 @@ DEFUN (isis_redistribute, if (!afi) return CMD_WARNING; - type = proto_redistnum(afi, argv[1]); + type = proto_redistnum(afi, argv[2]->arg); if (type < 0 || type == ZEBRA_ROUTE_ISIS) return CMD_WARNING; - if (!strcmp("level-1", argv[2])) + if (!strcmp("level-1", argv[3]->arg)) level = 1; - else if (!strcmp("level-2", argv[2])) + else if (!strcmp("level-2", argv[3]->arg)) level = 2; else return CMD_WARNING; @@ -588,11 +587,11 @@ DEFUN (isis_redistribute, return CMD_WARNING; } - if (argv[3]) + if (argv[4]->arg) { char *endp; - metric = strtoul(argv[3], &endp, 10); - if (argv[3][0] == '\0' || *endp != '\0') + metric = strtoul(argv[4]->arg, &endp, 10); + if (argv[4]->arg[0] == '\0' || *endp != '\0') return CMD_WARNING; } else @@ -608,8 +607,7 @@ DEFUN (isis_redistribute, DEFUN (no_isis_redistribute, no_isis_redistribute_cmd, - "no redistribute (ipv4|ipv6) " QUAGGA_REDIST_STR_ISISD - " (level-1|level-2)", + "no redistribute (ipv4|ipv6) " QUAGGA_REDIST_STR_ISISD " (level-1|level-2)", NO_STR REDIST_STR "Redistribute IPv4 routes\n" @@ -627,7 +625,7 @@ DEFUN (no_isis_redistribute, if (argc < 3) return CMD_WARNING; - family = str2family(argv[0]); + family = str2family(argv[2]->arg); if (family < 0) return CMD_WARNING; @@ -635,13 +633,13 @@ DEFUN (no_isis_redistribute, if (!afi) return CMD_WARNING; - type = proto_redistnum(afi, argv[1]); + type = proto_redistnum(afi, argv[3]->arg); if (type < 0 || type == ZEBRA_ROUTE_ISIS) return CMD_WARNING; - if (!strcmp("level-1", argv[2])) + if (!strcmp("level-1", argv[4]->arg)) level = 1; - else if (!strcmp("level-2", argv[2])) + else if (!strcmp("level-2", argv[4]->arg)) level = 2; else return CMD_WARNING; @@ -652,8 +650,7 @@ DEFUN (no_isis_redistribute, DEFUN (isis_default_originate, isis_default_originate_cmd, - "default-information originate (ipv4|ipv6) (level-1|level-2) " - "{always|metric <0-16777215>|route-map WORD}", + "default-information originate (ipv4|ipv6) (level-1|level-2) {always|metric <0-16777215>|route-map WORD}", "Control distribution of default information\n" "Distribute a default route\n" "Distribute default route for IPv4\n" @@ -676,13 +673,13 @@ DEFUN (isis_default_originate, if (argc < 5) return CMD_WARNING; - family = str2family(argv[0]); + family = str2family(argv[2]->arg); if (family < 0) return CMD_WARNING; - if (!strcmp("level-1", argv[1])) + if (!strcmp("level-1", argv[3]->arg)) level = 1; - else if (!strcmp("level-2", argv[1])) + else if (!strcmp("level-2", argv[3]->arg)) level = 2; else return CMD_WARNING; @@ -693,7 +690,7 @@ DEFUN (isis_default_originate, return CMD_WARNING; } - if (argv[2] && *argv[2] != '\0') + if (argv[4]->arg && *argv[4]->arg != '\0') originate_type = DEFAULT_ORIGINATE_ALWAYS; else originate_type = DEFAULT_ORIGINATE; @@ -741,13 +738,13 @@ DEFUN (no_isis_default_originate, if (argc < 2) return CMD_WARNING; - family = str2family(argv[0]); + family = str2family(argv[3]->arg); if (family < 0) return CMD_WARNING; - if (!strcmp("level-1", argv[1])) + if (!strcmp("level-1", argv[4]->arg)) level = 1; - else if (!strcmp("level-2", argv[1])) + else if (!strcmp("level-2", argv[4]->arg)) level = 2; else return CMD_WARNING; diff --git a/isisd/isis_routemap.c b/isisd/isis_routemap.c index fdc0100e77..86d5efd779 100644 --- a/isisd/isis_routemap.c +++ b/isisd/isis_routemap.c @@ -354,7 +354,7 @@ DEFUN (match_ip_address, "IP access-list number (expanded range)\n" "IP Access-list name\n") { - return isis_route_match_add(vty, vty->index, "ip address", argv[0]); + return isis_route_match_add(vty, vty->index, "ip address", argv[3]->arg); } DEFUN (no_match_ip_address, @@ -370,7 +370,7 @@ DEFUN (no_match_ip_address, { if (argc == 0) return isis_route_match_delete(vty, vty->index, "ip address", NULL); - return isis_route_match_delete(vty, vty->index, "ip address", argv[0]); + return isis_route_match_delete(vty, vty->index, "ip address", argv[4]->arg); } ALIAS (no_match_ip_address, @@ -392,7 +392,7 @@ DEFUN (match_ip_address_prefix_list, "Match entries of prefix-lists\n" "IP prefix-list name\n") { - return isis_route_match_add(vty, vty->index, "ip address prefix-list", argv[0]); + return isis_route_match_add(vty, vty->index, "ip address prefix-list", argv[4]->arg); } DEFUN (no_match_ip_address_prefix_list, @@ -429,7 +429,7 @@ DEFUN (match_ipv6_address, "Match IPv6 address of route\n" "IPv6 access-list name\n") { - return isis_route_match_add(vty, vty->index, "ipv6 address", argv[0]); + return isis_route_match_add(vty, vty->index, "ipv6 address", argv[3]->arg); } DEFUN (no_match_ipv6_address, @@ -443,7 +443,7 @@ DEFUN (no_match_ipv6_address, { if (argc == 0) return isis_route_match_delete(vty, vty->index, "ipv6 address", NULL); - return isis_route_match_delete(vty, vty->index, "ipv6 address", argv[0]); + return isis_route_match_delete(vty, vty->index, "ipv6 address", argv[4]->arg); } ALIAS (no_match_ipv6_address, @@ -465,7 +465,7 @@ DEFUN (match_ipv6_address_prefix_list, "Match entries of prefix-lists\n" "IP prefix-list name\n") { - return isis_route_match_add(vty, vty->index, "ipv6 address prefix-list", argv[0]); + return isis_route_match_add(vty, vty->index, "ipv6 address prefix-list", argv[4]->arg); } DEFUN (no_match_ipv6_address_prefix_list, @@ -504,7 +504,7 @@ DEFUN (set_metric, "Metric vale for destination routing protocol\n" "Metric value\n") { - return isis_route_set_add(vty, vty->index, "metric", argv[0]); + return isis_route_set_add(vty, vty->index, "metric", argv[2]->arg); } DEFUN (no_set_metric, @@ -517,7 +517,7 @@ DEFUN (no_set_metric, { if (argc == 0) return isis_route_set_delete(vty, vty->index, "metric", NULL); - return isis_route_set_delete(vty, vty->index, "metric", argv[0]); + return isis_route_set_delete(vty, vty->index, "metric", argv[3]->arg); } ALIAS (no_set_metric, diff --git a/isisd/isis_te.c b/isisd/isis_te.c index 022722f760..0a327c754e 100644 --- a/isisd/isis_te.c +++ b/isisd/isis_te.c @@ -1167,7 +1167,7 @@ DEFUN (isis_mpls_te_router_addr, struct listnode *node; struct isis_area *area; - if (! inet_aton (argv[0], &value)) + if (! inet_aton (argv[2]->arg, &value)) { vty_out (vty, "Please specify Router-Addr by A.B.C.D%s", VTY_NEWLINE); return CMD_WARNING; @@ -1329,7 +1329,7 @@ DEFUN (show_isis_mpls_te_interface, /* Interface name is specified. */ else { - if ((ifp = if_lookup_by_name (argv[0])) == NULL) + if ((ifp = if_lookup_by_name (argv[4]->arg)) == NULL) vty_out (vty, "No such interface name%s", VTY_NEWLINE); else show_mpls_te_sub (vty, ifp); diff --git a/isisd/isis_vty.c b/isisd/isis_vty.c index 53c635ea61..79fbdc4d24 100644 --- a/isisd/isis_vty.c +++ b/isisd/isis_vty.c @@ -64,8 +64,8 @@ DEFUN (ip_router_isis, struct interface *ifp; struct isis_circuit *circuit; struct isis_area *area; - const char *af = argv[0]; - const char *area_tag = argv[1]; + const char *af = argv[0]->arg; + const char *area_tag = argv[3]->arg; ifp = (struct interface *) vty->index; assert (ifp); @@ -118,8 +118,8 @@ DEFUN (no_ip_router_isis, struct interface *ifp; struct isis_area *area; struct isis_circuit *circuit; - const char *af = argv[0]; - const char *area_tag = argv[1]; + const char *af = argv[1]->arg; + const char *area_tag = argv[4]->arg; ifp = (struct interface *) vty->index; if (!ifp) @@ -132,7 +132,7 @@ DEFUN (no_ip_router_isis, if (!area) { vty_out (vty, "Can't find ISIS instance %s%s", - argv[0], VTY_NEWLINE); + argv[1]->arg, VTY_NEWLINE); return CMD_ERR_NO_MATCH; } @@ -204,7 +204,7 @@ DEFUN (isis_circuit_type, if (!circuit) return CMD_ERR_NO_MATCH; - is_type = string2circuit_t (argv[0]); + is_type = string2circuit_t (argv[2]->arg); if (!is_type) { vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE); @@ -310,10 +310,10 @@ DEFUN (isis_passwd, if (!circuit) return CMD_ERR_NO_MATCH; - if (argv[0][0] == 'm') - rv = isis_circuit_passwd_hmac_md5_set(circuit, argv[1]); + if (argv[2]->arg[0] == 'm') + rv = isis_circuit_passwd_hmac_md5_set(circuit, argv[3]->arg); else - rv = isis_circuit_passwd_cleartext_set(circuit, argv[1]); + rv = isis_circuit_passwd_cleartext_set(circuit, argv[3]->arg); if (rv) { vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE); @@ -361,7 +361,7 @@ DEFUN (isis_priority, if (!circuit) return CMD_ERR_NO_MATCH; - prio = atoi (argv[0]); + prio = atoi (argv[2]->arg); if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) { vty_out (vty, "Invalid priority %d - should be <0-127>%s", @@ -413,7 +413,7 @@ DEFUN (isis_priority_l1, if (!circuit) return CMD_ERR_NO_MATCH; - prio = atoi (argv[0]); + prio = atoi (argv[2]->arg); if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) { vty_out (vty, "Invalid priority %d - should be <0-127>%s", @@ -465,7 +465,7 @@ DEFUN (isis_priority_l2, if (!circuit) return CMD_ERR_NO_MATCH; - prio = atoi (argv[0]); + prio = atoi (argv[2]->arg); if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) { vty_out (vty, "Invalid priority %d - should be <0-127>%s", @@ -517,7 +517,7 @@ DEFUN (isis_metric, if (!circuit) return CMD_ERR_NO_MATCH; - met = atoi (argv[0]); + met = atoi (argv[2]->arg); /* RFC3787 section 5.1 */ if (circuit->area && circuit->area->oldmetric == 1 && @@ -581,7 +581,7 @@ DEFUN (isis_metric_l1, if (!circuit) return CMD_ERR_NO_MATCH; - met = atoi (argv[0]); + met = atoi (argv[2]->arg); /* RFC3787 section 5.1 */ if (circuit->area && circuit->area->oldmetric == 1 && @@ -645,7 +645,7 @@ DEFUN (isis_metric_l2, if (!circuit) return CMD_ERR_NO_MATCH; - met = atoi (argv[0]); + met = atoi (argv[2]->arg); /* RFC3787 section 5.1 */ if (circuit->area && circuit->area->oldmetric == 1 && @@ -710,7 +710,7 @@ DEFUN (isis_hello_interval, if (!circuit) return CMD_ERR_NO_MATCH; - interval = atoi (argv[0]); + interval = atoi (argv[2]->arg); if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) { vty_out (vty, "Invalid hello-interval %d - should be <1-600>%s", @@ -764,7 +764,7 @@ DEFUN (isis_hello_interval_l1, if (!circuit) return CMD_ERR_NO_MATCH; - interval = atoi (argv[0]); + interval = atoi (argv[2]->arg); if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) { vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s", @@ -818,7 +818,7 @@ DEFUN (isis_hello_interval_l2, if (!circuit) return CMD_ERR_NO_MATCH; - interval = atoi (argv[0]); + interval = atoi (argv[2]->arg); if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) { vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s", @@ -870,7 +870,7 @@ DEFUN (isis_hello_multiplier, if (!circuit) return CMD_ERR_NO_MATCH; - mult = atoi (argv[0]); + mult = atoi (argv[2]->arg); if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) { vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s", @@ -922,7 +922,7 @@ DEFUN (isis_hello_multiplier_l1, if (!circuit) return CMD_ERR_NO_MATCH; - mult = atoi (argv[0]); + mult = atoi (argv[2]->arg); if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) { vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s", @@ -974,7 +974,7 @@ DEFUN (isis_hello_multiplier_l2, if (!circuit) return CMD_ERR_NO_MATCH; - mult = atoi (argv[0]); + mult = atoi (argv[2]->arg); if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) { vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s", @@ -1060,7 +1060,7 @@ DEFUN (csnp_interval, if (!circuit) return CMD_ERR_NO_MATCH; - interval = atol (argv[0]); + interval = atol (argv[2]->arg); if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) { vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s", @@ -1112,7 +1112,7 @@ DEFUN (csnp_interval_l1, if (!circuit) return CMD_ERR_NO_MATCH; - interval = atol (argv[0]); + interval = atol (argv[2]->arg); if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) { vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s", @@ -1164,7 +1164,7 @@ DEFUN (csnp_interval_l2, if (!circuit) return CMD_ERR_NO_MATCH; - interval = atol (argv[0]); + interval = atol (argv[2]->arg); if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) { vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s", @@ -1215,7 +1215,7 @@ DEFUN (psnp_interval, if (!circuit) return CMD_ERR_NO_MATCH; - interval = atol (argv[0]); + interval = atol (argv[2]->arg); if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) { vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s", @@ -1267,7 +1267,7 @@ DEFUN (psnp_interval_l1, if (!circuit) return CMD_ERR_NO_MATCH; - interval = atol (argv[0]); + interval = atol (argv[2]->arg); if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) { vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s", @@ -1319,7 +1319,7 @@ DEFUN (psnp_interval_l2, if (!circuit) return CMD_ERR_NO_MATCH; - interval = atol (argv[0]); + interval = atol (argv[2]->arg); if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) { vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s", @@ -1409,7 +1409,7 @@ DEFUN (metric_style, assert(area); - if (strncmp (argv[0], "w", 1) == 0) + if (strncmp (argv[1]->arg, "w", 1) == 0) { isis_area_metricstyle_set(area, false, true); return CMD_SUCCESS; @@ -1419,9 +1419,9 @@ DEFUN (metric_style, if (ret != CMD_SUCCESS) return ret; - if (strncmp (argv[0], "t", 1) == 0) + if (strncmp (argv[1]->arg, "t", 1) == 0) isis_area_metricstyle_set(area, true, true); - else if (strncmp (argv[0], "n", 1) == 0) + else if (strncmp (argv[1]->arg, "n", 1) == 0) isis_area_metricstyle_set(area, true, false); return CMD_SUCCESS; @@ -1561,7 +1561,7 @@ DEFUN (area_lsp_mtu, { unsigned int lsp_mtu; - VTY_GET_INTEGER_RANGE("lsp-mtu", lsp_mtu, argv[0], 128, 4352); + VTY_GET_INTEGER_RANGE("lsp-mtu", lsp_mtu, argv[1]->arg, 128, 4352); return area_lsp_mtu_set(vty, lsp_mtu); } @@ -1601,7 +1601,7 @@ DEFUN (is_type, return CMD_ERR_NO_MATCH; } - type = string2circuit_t (argv[0]); + type = string2circuit_t (argv[1]->arg); if (!type) { vty_out (vty, "Unknown IS level %s", VTY_NEWLINE); @@ -1684,7 +1684,7 @@ DEFUN (lsp_gen_interval, int level; area = vty->index; - interval = atoi (argv[0]); + interval = atoi (argv[1]->arg); level = IS_LEVEL_1 | IS_LEVEL_2; return set_lsp_gen_interval (vty, area, interval, level); } @@ -1724,7 +1724,7 @@ DEFUN (lsp_gen_interval_l1, int level; area = vty->index; - interval = atoi (argv[0]); + interval = atoi (argv[2]->arg); level = IS_LEVEL_1; return set_lsp_gen_interval (vty, area, interval, level); } @@ -1766,7 +1766,7 @@ DEFUN (lsp_gen_interval_l2, int level; area = vty->index; - interval = atoi (argv[0]); + interval = atoi (argv[2]->arg); level = IS_LEVEL_2; return set_lsp_gen_interval (vty, area, interval, level); } @@ -1806,7 +1806,7 @@ DEFUN (spf_interval, u_int16_t interval; area = vty->index; - interval = atoi (argv[0]); + interval = atoi (argv[1]->arg); area->min_spf_interval[0] = interval; area->min_spf_interval[1] = interval; @@ -1847,7 +1847,7 @@ DEFUN (spf_interval_l1, u_int16_t interval; area = vty->index; - interval = atoi (argv[0]); + interval = atoi (argv[2]->arg); area->min_spf_interval[0] = interval; return CMD_SUCCESS; @@ -1888,7 +1888,7 @@ DEFUN (spf_interval_l2, u_int16_t interval; area = vty->index; - interval = atoi (argv[0]); + interval = atoi (argv[2]->arg); area->min_spf_interval[1] = interval; return CMD_SUCCESS; @@ -1976,7 +1976,7 @@ DEFUN (max_lsp_lifetime, "Maximum LSP lifetime\n" "LSP lifetime in seconds\n") { - return area_max_lsp_lifetime_set(vty, IS_LEVEL_1_AND_2, atoi(argv[0])); + return area_max_lsp_lifetime_set(vty, IS_LEVEL_1_AND_2, atoi(argv[1]->arg)); } DEFUN (no_max_lsp_lifetime, @@ -2002,7 +2002,7 @@ DEFUN (max_lsp_lifetime_l1, "Maximum LSP lifetime for Level 1 only\n" "LSP lifetime for Level 1 only in seconds\n") { - return area_max_lsp_lifetime_set(vty, IS_LEVEL_1, atoi(argv[0])); + return area_max_lsp_lifetime_set(vty, IS_LEVEL_1, atoi(argv[2]->arg)); } DEFUN (no_max_lsp_lifetime_l1, @@ -2027,7 +2027,7 @@ DEFUN (max_lsp_lifetime_l2, "Maximum LSP lifetime for Level 2 only\n" "LSP lifetime for Level 2 only in seconds\n") { - return area_max_lsp_lifetime_set(vty, IS_LEVEL_2, atoi(argv[0])); + return area_max_lsp_lifetime_set(vty, IS_LEVEL_2, atoi(argv[2]->arg)); } DEFUN (no_max_lsp_lifetime_l2, @@ -2096,7 +2096,7 @@ DEFUN (lsp_refresh_interval, "LSP refresh interval\n" "LSP refresh interval in seconds\n") { - return area_lsp_refresh_interval_set(vty, IS_LEVEL_1_AND_2, atoi(argv[0])); + return area_lsp_refresh_interval_set(vty, IS_LEVEL_1_AND_2, atoi(argv[1]->arg)); } DEFUN (no_lsp_refresh_interval, @@ -2122,7 +2122,7 @@ DEFUN (lsp_refresh_interval_l1, "LSP refresh interval for Level 1 only\n" "LSP refresh interval for Level 1 only in seconds\n") { - return area_lsp_refresh_interval_set(vty, IS_LEVEL_1, atoi(argv[0])); + return area_lsp_refresh_interval_set(vty, IS_LEVEL_1, atoi(argv[2]->arg)); } DEFUN (no_lsp_refresh_interval_l1, @@ -2148,7 +2148,7 @@ DEFUN (lsp_refresh_interval_l2, "LSP refresh interval for Level 2 only\n" "LSP refresh interval for Level 2 only in seconds\n") { - return area_lsp_refresh_interval_set(vty, IS_LEVEL_2, atoi(argv[0])); + return area_lsp_refresh_interval_set(vty, IS_LEVEL_2, atoi(argv[2]->arg)); } DEFUN (no_lsp_refresh_interval_l2, @@ -2201,7 +2201,7 @@ DEFUN (area_passwd_md5, "Level-wide password\n") { u_char snp_auth = 0; - int level = (argv[0][0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1; + int level = (argv[0]->arg[0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1; if (argc > 2) { @@ -2211,7 +2211,7 @@ DEFUN (area_passwd_md5, } return area_passwd_set(vty, level, isis_area_passwd_hmac_md5_set, - argv[1], snp_auth); + argv[2]->arg, snp_auth); } ALIAS (area_passwd_md5, @@ -2235,7 +2235,7 @@ DEFUN (area_passwd_clear, "Area password\n") { u_char snp_auth = 0; - int level = (argv[0][0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1; + int level = (argv[0]->arg[0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1; if (argc > 2) { @@ -2245,7 +2245,7 @@ DEFUN (area_passwd_clear, } return area_passwd_set(vty, level, isis_area_passwd_cleartext_set, - argv[1], snp_auth); + argv[2]->arg, snp_auth); } ALIAS (area_passwd_clear, @@ -2267,7 +2267,7 @@ DEFUN (no_area_passwd, "Configure the authentication password for an area\n" "Set the authentication password for a routing domain\n") { - int level = (argv[0][0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1; + int level = (argv[1]->arg[0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1; struct isis_area *area = vty->index; if (!area) diff --git a/isisd/isisd.c b/isisd/isisd.c index 4d7f475616..c1401ac135 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -533,7 +533,7 @@ DEFUN (show_isis_interface_arg, "ISIS interface\n" "ISIS interface name\n") { - return show_isis_interface_common (vty, argv[0], ISIS_UI_LEVEL_DETAIL); + return show_isis_interface_common (vty, argv[3]->arg, ISIS_UI_LEVEL_DETAIL); } /* @@ -707,7 +707,7 @@ DEFUN (show_isis_neighbor_arg, "ISIS neighbor adjacencies\n" "System id\n") { - return show_isis_neighbor_common (vty, argv[0], ISIS_UI_LEVEL_DETAIL); + return show_isis_neighbor_common (vty, argv[3]->arg, ISIS_UI_LEVEL_DETAIL); } DEFUN (clear_isis_neighbor, @@ -728,7 +728,7 @@ DEFUN (clear_isis_neighbor_arg, "ISIS neighbor adjacencies\n" "System id\n") { - return clear_isis_neighbor_common (vty, argv[0]); + return clear_isis_neighbor_common (vty, argv[3]->arg); } /* @@ -1530,7 +1530,7 @@ DEFUN (show_database_lsp_brief, "IS-IS link state database\n" "LSP ID\n") { - return show_isis_database (vty, argv[0], ISIS_UI_LEVEL_BRIEF); + return show_isis_database (vty, argv[3]->arg, ISIS_UI_LEVEL_BRIEF); } DEFUN (show_database_lsp_detail, @@ -1542,7 +1542,7 @@ DEFUN (show_database_lsp_detail, "LSP ID\n" "Detailed information\n") { - return show_isis_database (vty, argv[0], ISIS_UI_LEVEL_DETAIL); + return show_isis_database (vty, argv[3]->arg, ISIS_UI_LEVEL_DETAIL); } DEFUN (show_database_detail, @@ -1564,7 +1564,7 @@ DEFUN (show_database_detail_lsp, "Detailed information\n" "LSP ID\n") { - return show_isis_database (vty, argv[0], ISIS_UI_LEVEL_DETAIL); + return show_isis_database (vty, argv[4]->arg, ISIS_UI_LEVEL_DETAIL); } /* @@ -1577,7 +1577,7 @@ DEFUN (router_isis, "ISO IS-IS\n" "ISO Routing area tag") { - return isis_area_get (vty, argv[0]); + return isis_area_get (vty, argv[2]->arg); } /* @@ -1588,7 +1588,7 @@ DEFUN (no_router_isis, "no router isis WORD", "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag") { - return isis_area_destroy (vty, argv[0]); + return isis_area_destroy (vty, argv[3]->arg); } /* @@ -1600,7 +1600,7 @@ DEFUN (net, "A Network Entity Title for this process (OSI only)\n" "XX.XXXX. ... .XXX.XX Network entity title (NET)\n") { - return area_net_title (vty, argv[0]); + return area_net_title (vty, argv[1]->arg); } /* @@ -1613,7 +1613,7 @@ DEFUN (no_net, "A Network Entity Title for this process (OSI only)\n" "XX.XXXX. ... .XXX.XX Network entity title (NET)\n") { - return area_clear_net_title (vty, argv[0]); + return area_clear_net_title (vty, argv[2]->arg); } void isis_area_lsp_mtu_set(struct isis_area *area, unsigned int lsp_mtu) @@ -1896,8 +1896,7 @@ DEFUN (no_log_adj_changes, DEFUN (topology_generate_grid, topology_generate_grid_cmd, - "topology generate grid <1-100> <1-100> <1-65000> [param] [param] " - "[param]", + "topology generate grid <1-100> <1-100> <1-65000> [param] [param] [param]", "Topology generation for IS-IS\n" "Topology generation\n" "Grid topology\n" @@ -1973,8 +1972,8 @@ DEFUN (topology_baseis, area = vty->index; assert (area); - if (sysid2buff (buff, argv[0])) - sysid2buff (area->topology_baseis, argv[0]); + if (sysid2buff (buff, argv[2]->arg)) + sysid2buff (area->topology_baseis, argv[2]->arg); return CMD_SUCCESS; } @@ -2016,7 +2015,7 @@ DEFUN (topology_basedynh, assert (area); /* I hope that it's enough. */ - area->topology_basedynh = strndup (argv[0], 16); + area->topology_basedynh = strndup (argv[2]->arg, 16); return CMD_SUCCESS; } diff --git a/tools/argv_translator.py b/tools/argv_translator.py index 051e284c58..3464a81d71 100755 --- a/tools/argv_translator.py +++ b/tools/argv_translator.py @@ -207,6 +207,7 @@ def update_argvs(filename): line = line.replace('" QUAGGA_REDIST_STR_RIPNGD "', '(kernel|connected|static|ospf6|isis|bgp|table)') line = line.replace('" QUAGGA_REDIST_STR_RIPD "', '(kernel|connected|static|ospf|isis|bgp|pim|table)') line = line.replace('" QUAGGA_REDIST_STR_OSPF6D "', '(kernel|connected|static|ripng|isis|bgp|table)') + line = line.replace('" QUAGGA_REDIST_STR_ISISD "', '(kernel|connected|static|rip|ripng|ospf|ospf6|bgp|pim|table)') # endswith line = line.replace('" CMD_AS_RANGE,', ' <1-4294967295>",') @@ -236,6 +237,7 @@ def update_argvs(filename): line = line.replace('" PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC,', ' ip igmp query-max-response-time-dsec",') line = line.replace('" PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME,', ' ip igmp query-max-response-time",') line = line.replace('" QUAGGA_REDIST_STR_OSPF6D,', ' (kernel|connected|static|ripng|isis|bgp|table)",') + line = line.replace('" QUAGGA_REDIST_STR_ISISD,', ' (kernel|connected|static|rip|ripng|ospf|ospf6|bgp|pim|table)",') # startswith line = line.replace('LISTEN_RANGE_CMD "', '"bgp listen range (A.B.C.D/M|X:X::X:X/M) ')