isisd: argv update

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This commit is contained in:
Daniel Walton 2016-09-23 01:07:05 +00:00
parent 6f1ccc12de
commit b823bd432c
6 changed files with 96 additions and 98 deletions

View File

@ -539,8 +539,7 @@ isis_redist_area_finish(struct isis_area *area)
DEFUN (isis_redistribute, DEFUN (isis_redistribute,
isis_redistribute_cmd, isis_redistribute_cmd,
"redistribute (ipv4|ipv6) " QUAGGA_REDIST_STR_ISISD "redistribute (ipv4|ipv6) " QUAGGA_REDIST_STR_ISISD " (level-1|level-2) {metric <0-16777215>|route-map WORD}",
" (level-1|level-2) {metric <0-16777215>|route-map WORD}",
REDIST_STR REDIST_STR
"Redistribute IPv4 routes\n" "Redistribute IPv4 routes\n"
"Redistribute IPv6 routes\n" "Redistribute IPv6 routes\n"
@ -563,7 +562,7 @@ DEFUN (isis_redistribute,
if (argc < 5) if (argc < 5)
return CMD_WARNING; return CMD_WARNING;
family = str2family(argv[0]); family = str2family(argv[1]->arg);
if (family < 0) if (family < 0)
return CMD_WARNING; return CMD_WARNING;
@ -571,13 +570,13 @@ DEFUN (isis_redistribute,
if (!afi) if (!afi)
return CMD_WARNING; return CMD_WARNING;
type = proto_redistnum(afi, argv[1]); type = proto_redistnum(afi, argv[2]->arg);
if (type < 0 || type == ZEBRA_ROUTE_ISIS) if (type < 0 || type == ZEBRA_ROUTE_ISIS)
return CMD_WARNING; return CMD_WARNING;
if (!strcmp("level-1", argv[2])) if (!strcmp("level-1", argv[3]->arg))
level = 1; level = 1;
else if (!strcmp("level-2", argv[2])) else if (!strcmp("level-2", argv[3]->arg))
level = 2; level = 2;
else else
return CMD_WARNING; return CMD_WARNING;
@ -588,11 +587,11 @@ DEFUN (isis_redistribute,
return CMD_WARNING; return CMD_WARNING;
} }
if (argv[3]) if (argv[4]->arg)
{ {
char *endp; char *endp;
metric = strtoul(argv[3], &endp, 10); metric = strtoul(argv[4]->arg, &endp, 10);
if (argv[3][0] == '\0' || *endp != '\0') if (argv[4]->arg[0] == '\0' || *endp != '\0')
return CMD_WARNING; return CMD_WARNING;
} }
else else
@ -608,8 +607,7 @@ DEFUN (isis_redistribute,
DEFUN (no_isis_redistribute, DEFUN (no_isis_redistribute,
no_isis_redistribute_cmd, no_isis_redistribute_cmd,
"no redistribute (ipv4|ipv6) " QUAGGA_REDIST_STR_ISISD "no redistribute (ipv4|ipv6) " QUAGGA_REDIST_STR_ISISD " (level-1|level-2)",
" (level-1|level-2)",
NO_STR NO_STR
REDIST_STR REDIST_STR
"Redistribute IPv4 routes\n" "Redistribute IPv4 routes\n"
@ -627,7 +625,7 @@ DEFUN (no_isis_redistribute,
if (argc < 3) if (argc < 3)
return CMD_WARNING; return CMD_WARNING;
family = str2family(argv[0]); family = str2family(argv[2]->arg);
if (family < 0) if (family < 0)
return CMD_WARNING; return CMD_WARNING;
@ -635,13 +633,13 @@ DEFUN (no_isis_redistribute,
if (!afi) if (!afi)
return CMD_WARNING; return CMD_WARNING;
type = proto_redistnum(afi, argv[1]); type = proto_redistnum(afi, argv[3]->arg);
if (type < 0 || type == ZEBRA_ROUTE_ISIS) if (type < 0 || type == ZEBRA_ROUTE_ISIS)
return CMD_WARNING; return CMD_WARNING;
if (!strcmp("level-1", argv[2])) if (!strcmp("level-1", argv[4]->arg))
level = 1; level = 1;
else if (!strcmp("level-2", argv[2])) else if (!strcmp("level-2", argv[4]->arg))
level = 2; level = 2;
else else
return CMD_WARNING; return CMD_WARNING;
@ -652,8 +650,7 @@ DEFUN (no_isis_redistribute,
DEFUN (isis_default_originate, DEFUN (isis_default_originate,
isis_default_originate_cmd, isis_default_originate_cmd,
"default-information originate (ipv4|ipv6) (level-1|level-2) " "default-information originate (ipv4|ipv6) (level-1|level-2) {always|metric <0-16777215>|route-map WORD}",
"{always|metric <0-16777215>|route-map WORD}",
"Control distribution of default information\n" "Control distribution of default information\n"
"Distribute a default route\n" "Distribute a default route\n"
"Distribute default route for IPv4\n" "Distribute default route for IPv4\n"
@ -676,13 +673,13 @@ DEFUN (isis_default_originate,
if (argc < 5) if (argc < 5)
return CMD_WARNING; return CMD_WARNING;
family = str2family(argv[0]); family = str2family(argv[2]->arg);
if (family < 0) if (family < 0)
return CMD_WARNING; return CMD_WARNING;
if (!strcmp("level-1", argv[1])) if (!strcmp("level-1", argv[3]->arg))
level = 1; level = 1;
else if (!strcmp("level-2", argv[1])) else if (!strcmp("level-2", argv[3]->arg))
level = 2; level = 2;
else else
return CMD_WARNING; return CMD_WARNING;
@ -693,7 +690,7 @@ DEFUN (isis_default_originate,
return CMD_WARNING; return CMD_WARNING;
} }
if (argv[2] && *argv[2] != '\0') if (argv[4]->arg && *argv[4]->arg != '\0')
originate_type = DEFAULT_ORIGINATE_ALWAYS; originate_type = DEFAULT_ORIGINATE_ALWAYS;
else else
originate_type = DEFAULT_ORIGINATE; originate_type = DEFAULT_ORIGINATE;
@ -741,13 +738,13 @@ DEFUN (no_isis_default_originate,
if (argc < 2) if (argc < 2)
return CMD_WARNING; return CMD_WARNING;
family = str2family(argv[0]); family = str2family(argv[3]->arg);
if (family < 0) if (family < 0)
return CMD_WARNING; return CMD_WARNING;
if (!strcmp("level-1", argv[1])) if (!strcmp("level-1", argv[4]->arg))
level = 1; level = 1;
else if (!strcmp("level-2", argv[1])) else if (!strcmp("level-2", argv[4]->arg))
level = 2; level = 2;
else else
return CMD_WARNING; return CMD_WARNING;

View File

@ -354,7 +354,7 @@ DEFUN (match_ip_address,
"IP access-list number (expanded range)\n" "IP access-list number (expanded range)\n"
"IP Access-list name\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, DEFUN (no_match_ip_address,
@ -370,7 +370,7 @@ DEFUN (no_match_ip_address,
{ {
if (argc == 0) if (argc == 0)
return isis_route_match_delete(vty, vty->index, "ip address", NULL); 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, ALIAS (no_match_ip_address,
@ -392,7 +392,7 @@ DEFUN (match_ip_address_prefix_list,
"Match entries of prefix-lists\n" "Match entries of prefix-lists\n"
"IP prefix-list name\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, DEFUN (no_match_ip_address_prefix_list,
@ -429,7 +429,7 @@ DEFUN (match_ipv6_address,
"Match IPv6 address of route\n" "Match IPv6 address of route\n"
"IPv6 access-list name\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, DEFUN (no_match_ipv6_address,
@ -443,7 +443,7 @@ DEFUN (no_match_ipv6_address,
{ {
if (argc == 0) if (argc == 0)
return isis_route_match_delete(vty, vty->index, "ipv6 address", NULL); 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, ALIAS (no_match_ipv6_address,
@ -465,7 +465,7 @@ DEFUN (match_ipv6_address_prefix_list,
"Match entries of prefix-lists\n" "Match entries of prefix-lists\n"
"IP prefix-list name\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, DEFUN (no_match_ipv6_address_prefix_list,
@ -504,7 +504,7 @@ DEFUN (set_metric,
"Metric vale for destination routing protocol\n" "Metric vale for destination routing protocol\n"
"Metric value\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, DEFUN (no_set_metric,
@ -517,7 +517,7 @@ DEFUN (no_set_metric,
{ {
if (argc == 0) if (argc == 0)
return isis_route_set_delete(vty, vty->index, "metric", NULL); 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, ALIAS (no_set_metric,

View File

@ -1167,7 +1167,7 @@ DEFUN (isis_mpls_te_router_addr,
struct listnode *node; struct listnode *node;
struct isis_area *area; 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); vty_out (vty, "Please specify Router-Addr by A.B.C.D%s", VTY_NEWLINE);
return CMD_WARNING; return CMD_WARNING;
@ -1329,7 +1329,7 @@ DEFUN (show_isis_mpls_te_interface,
/* Interface name is specified. */ /* Interface name is specified. */
else 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); vty_out (vty, "No such interface name%s", VTY_NEWLINE);
else else
show_mpls_te_sub (vty, ifp); show_mpls_te_sub (vty, ifp);

View File

@ -64,8 +64,8 @@ DEFUN (ip_router_isis,
struct interface *ifp; struct interface *ifp;
struct isis_circuit *circuit; struct isis_circuit *circuit;
struct isis_area *area; struct isis_area *area;
const char *af = argv[0]; const char *af = argv[0]->arg;
const char *area_tag = argv[1]; const char *area_tag = argv[3]->arg;
ifp = (struct interface *) vty->index; ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
@ -118,8 +118,8 @@ DEFUN (no_ip_router_isis,
struct interface *ifp; struct interface *ifp;
struct isis_area *area; struct isis_area *area;
struct isis_circuit *circuit; struct isis_circuit *circuit;
const char *af = argv[0]; const char *af = argv[1]->arg;
const char *area_tag = argv[1]; const char *area_tag = argv[4]->arg;
ifp = (struct interface *) vty->index; ifp = (struct interface *) vty->index;
if (!ifp) if (!ifp)
@ -132,7 +132,7 @@ DEFUN (no_ip_router_isis,
if (!area) if (!area)
{ {
vty_out (vty, "Can't find ISIS instance %s%s", vty_out (vty, "Can't find ISIS instance %s%s",
argv[0], VTY_NEWLINE); argv[1]->arg, VTY_NEWLINE);
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
} }
@ -204,7 +204,7 @@ DEFUN (isis_circuit_type,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
is_type = string2circuit_t (argv[0]); is_type = string2circuit_t (argv[2]->arg);
if (!is_type) if (!is_type)
{ {
vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE); vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
@ -310,10 +310,10 @@ DEFUN (isis_passwd,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
if (argv[0][0] == 'm') if (argv[2]->arg[0] == 'm')
rv = isis_circuit_passwd_hmac_md5_set(circuit, argv[1]); rv = isis_circuit_passwd_hmac_md5_set(circuit, argv[3]->arg);
else else
rv = isis_circuit_passwd_cleartext_set(circuit, argv[1]); rv = isis_circuit_passwd_cleartext_set(circuit, argv[3]->arg);
if (rv) if (rv)
{ {
vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE); vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
@ -361,7 +361,7 @@ DEFUN (isis_priority,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
prio = atoi (argv[0]); prio = atoi (argv[2]->arg);
if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
{ {
vty_out (vty, "Invalid priority %d - should be <0-127>%s", vty_out (vty, "Invalid priority %d - should be <0-127>%s",
@ -413,7 +413,7 @@ DEFUN (isis_priority_l1,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
prio = atoi (argv[0]); prio = atoi (argv[2]->arg);
if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
{ {
vty_out (vty, "Invalid priority %d - should be <0-127>%s", vty_out (vty, "Invalid priority %d - should be <0-127>%s",
@ -465,7 +465,7 @@ DEFUN (isis_priority_l2,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
prio = atoi (argv[0]); prio = atoi (argv[2]->arg);
if (prio < MIN_PRIORITY || prio > MAX_PRIORITY) if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
{ {
vty_out (vty, "Invalid priority %d - should be <0-127>%s", vty_out (vty, "Invalid priority %d - should be <0-127>%s",
@ -517,7 +517,7 @@ DEFUN (isis_metric,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
met = atoi (argv[0]); met = atoi (argv[2]->arg);
/* RFC3787 section 5.1 */ /* RFC3787 section 5.1 */
if (circuit->area && circuit->area->oldmetric == 1 && if (circuit->area && circuit->area->oldmetric == 1 &&
@ -581,7 +581,7 @@ DEFUN (isis_metric_l1,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
met = atoi (argv[0]); met = atoi (argv[2]->arg);
/* RFC3787 section 5.1 */ /* RFC3787 section 5.1 */
if (circuit->area && circuit->area->oldmetric == 1 && if (circuit->area && circuit->area->oldmetric == 1 &&
@ -645,7 +645,7 @@ DEFUN (isis_metric_l2,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
met = atoi (argv[0]); met = atoi (argv[2]->arg);
/* RFC3787 section 5.1 */ /* RFC3787 section 5.1 */
if (circuit->area && circuit->area->oldmetric == 1 && if (circuit->area && circuit->area->oldmetric == 1 &&
@ -710,7 +710,7 @@ DEFUN (isis_hello_interval,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
interval = atoi (argv[0]); interval = atoi (argv[2]->arg);
if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
{ {
vty_out (vty, "Invalid hello-interval %d - should be <1-600>%s", vty_out (vty, "Invalid hello-interval %d - should be <1-600>%s",
@ -764,7 +764,7 @@ DEFUN (isis_hello_interval_l1,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
interval = atoi (argv[0]); interval = atoi (argv[2]->arg);
if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
{ {
vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s", vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s",
@ -818,7 +818,7 @@ DEFUN (isis_hello_interval_l2,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
interval = atoi (argv[0]); interval = atoi (argv[2]->arg);
if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL) if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
{ {
vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s", vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s",
@ -870,7 +870,7 @@ DEFUN (isis_hello_multiplier,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
mult = atoi (argv[0]); mult = atoi (argv[2]->arg);
if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
{ {
vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s", vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
@ -922,7 +922,7 @@ DEFUN (isis_hello_multiplier_l1,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
mult = atoi (argv[0]); mult = atoi (argv[2]->arg);
if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
{ {
vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s", vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
@ -974,7 +974,7 @@ DEFUN (isis_hello_multiplier_l2,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
mult = atoi (argv[0]); mult = atoi (argv[2]->arg);
if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER) if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
{ {
vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s", vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
@ -1060,7 +1060,7 @@ DEFUN (csnp_interval,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
interval = atol (argv[0]); interval = atol (argv[2]->arg);
if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
{ {
vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s", vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
@ -1112,7 +1112,7 @@ DEFUN (csnp_interval_l1,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
interval = atol (argv[0]); interval = atol (argv[2]->arg);
if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
{ {
vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s", vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
@ -1164,7 +1164,7 @@ DEFUN (csnp_interval_l2,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
interval = atol (argv[0]); interval = atol (argv[2]->arg);
if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL) if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
{ {
vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s", vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
@ -1215,7 +1215,7 @@ DEFUN (psnp_interval,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
interval = atol (argv[0]); interval = atol (argv[2]->arg);
if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
{ {
vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s", vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
@ -1267,7 +1267,7 @@ DEFUN (psnp_interval_l1,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
interval = atol (argv[0]); interval = atol (argv[2]->arg);
if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
{ {
vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s", vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
@ -1319,7 +1319,7 @@ DEFUN (psnp_interval_l2,
if (!circuit) if (!circuit)
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
interval = atol (argv[0]); interval = atol (argv[2]->arg);
if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL) if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
{ {
vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s", vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
@ -1409,7 +1409,7 @@ DEFUN (metric_style,
assert(area); assert(area);
if (strncmp (argv[0], "w", 1) == 0) if (strncmp (argv[1]->arg, "w", 1) == 0)
{ {
isis_area_metricstyle_set(area, false, true); isis_area_metricstyle_set(area, false, true);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1419,9 +1419,9 @@ DEFUN (metric_style,
if (ret != CMD_SUCCESS) if (ret != CMD_SUCCESS)
return ret; return ret;
if (strncmp (argv[0], "t", 1) == 0) if (strncmp (argv[1]->arg, "t", 1) == 0)
isis_area_metricstyle_set(area, true, true); 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); isis_area_metricstyle_set(area, true, false);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1561,7 +1561,7 @@ DEFUN (area_lsp_mtu,
{ {
unsigned int 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); return area_lsp_mtu_set(vty, lsp_mtu);
} }
@ -1601,7 +1601,7 @@ DEFUN (is_type,
return CMD_ERR_NO_MATCH; return CMD_ERR_NO_MATCH;
} }
type = string2circuit_t (argv[0]); type = string2circuit_t (argv[1]->arg);
if (!type) if (!type)
{ {
vty_out (vty, "Unknown IS level %s", VTY_NEWLINE); vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
@ -1684,7 +1684,7 @@ DEFUN (lsp_gen_interval,
int level; int level;
area = vty->index; area = vty->index;
interval = atoi (argv[0]); interval = atoi (argv[1]->arg);
level = IS_LEVEL_1 | IS_LEVEL_2; level = IS_LEVEL_1 | IS_LEVEL_2;
return set_lsp_gen_interval (vty, area, interval, level); return set_lsp_gen_interval (vty, area, interval, level);
} }
@ -1724,7 +1724,7 @@ DEFUN (lsp_gen_interval_l1,
int level; int level;
area = vty->index; area = vty->index;
interval = atoi (argv[0]); interval = atoi (argv[2]->arg);
level = IS_LEVEL_1; level = IS_LEVEL_1;
return set_lsp_gen_interval (vty, area, interval, level); return set_lsp_gen_interval (vty, area, interval, level);
} }
@ -1766,7 +1766,7 @@ DEFUN (lsp_gen_interval_l2,
int level; int level;
area = vty->index; area = vty->index;
interval = atoi (argv[0]); interval = atoi (argv[2]->arg);
level = IS_LEVEL_2; level = IS_LEVEL_2;
return set_lsp_gen_interval (vty, area, interval, level); return set_lsp_gen_interval (vty, area, interval, level);
} }
@ -1806,7 +1806,7 @@ DEFUN (spf_interval,
u_int16_t interval; u_int16_t interval;
area = vty->index; area = vty->index;
interval = atoi (argv[0]); interval = atoi (argv[1]->arg);
area->min_spf_interval[0] = interval; area->min_spf_interval[0] = interval;
area->min_spf_interval[1] = interval; area->min_spf_interval[1] = interval;
@ -1847,7 +1847,7 @@ DEFUN (spf_interval_l1,
u_int16_t interval; u_int16_t interval;
area = vty->index; area = vty->index;
interval = atoi (argv[0]); interval = atoi (argv[2]->arg);
area->min_spf_interval[0] = interval; area->min_spf_interval[0] = interval;
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1888,7 +1888,7 @@ DEFUN (spf_interval_l2,
u_int16_t interval; u_int16_t interval;
area = vty->index; area = vty->index;
interval = atoi (argv[0]); interval = atoi (argv[2]->arg);
area->min_spf_interval[1] = interval; area->min_spf_interval[1] = interval;
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1976,7 +1976,7 @@ DEFUN (max_lsp_lifetime,
"Maximum LSP lifetime\n" "Maximum LSP lifetime\n"
"LSP lifetime in seconds\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, DEFUN (no_max_lsp_lifetime,
@ -2002,7 +2002,7 @@ DEFUN (max_lsp_lifetime_l1,
"Maximum LSP lifetime for Level 1 only\n" "Maximum LSP lifetime for Level 1 only\n"
"LSP lifetime for Level 1 only in seconds\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, DEFUN (no_max_lsp_lifetime_l1,
@ -2027,7 +2027,7 @@ DEFUN (max_lsp_lifetime_l2,
"Maximum LSP lifetime for Level 2 only\n" "Maximum LSP lifetime for Level 2 only\n"
"LSP lifetime for Level 2 only in seconds\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, DEFUN (no_max_lsp_lifetime_l2,
@ -2096,7 +2096,7 @@ DEFUN (lsp_refresh_interval,
"LSP refresh interval\n" "LSP refresh interval\n"
"LSP refresh interval in seconds\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, 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\n"
"LSP refresh interval for Level 1 only in seconds\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, 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\n"
"LSP refresh interval for Level 2 only in seconds\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, DEFUN (no_lsp_refresh_interval_l2,
@ -2201,7 +2201,7 @@ DEFUN (area_passwd_md5,
"Level-wide password\n") "Level-wide password\n")
{ {
u_char snp_auth = 0; 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) if (argc > 2)
{ {
@ -2211,7 +2211,7 @@ DEFUN (area_passwd_md5,
} }
return area_passwd_set(vty, level, isis_area_passwd_hmac_md5_set, 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, ALIAS (area_passwd_md5,
@ -2235,7 +2235,7 @@ DEFUN (area_passwd_clear,
"Area password\n") "Area password\n")
{ {
u_char snp_auth = 0; 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) if (argc > 2)
{ {
@ -2245,7 +2245,7 @@ DEFUN (area_passwd_clear,
} }
return area_passwd_set(vty, level, isis_area_passwd_cleartext_set, return area_passwd_set(vty, level, isis_area_passwd_cleartext_set,
argv[1], snp_auth); argv[2]->arg, snp_auth);
} }
ALIAS (area_passwd_clear, ALIAS (area_passwd_clear,
@ -2267,7 +2267,7 @@ DEFUN (no_area_passwd,
"Configure the authentication password for an area\n" "Configure the authentication password for an area\n"
"Set the authentication password for a routing domain\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; struct isis_area *area = vty->index;
if (!area) if (!area)

View File

@ -533,7 +533,7 @@ DEFUN (show_isis_interface_arg,
"ISIS interface\n" "ISIS interface\n"
"ISIS interface name\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" "ISIS neighbor adjacencies\n"
"System id\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, DEFUN (clear_isis_neighbor,
@ -728,7 +728,7 @@ DEFUN (clear_isis_neighbor_arg,
"ISIS neighbor adjacencies\n" "ISIS neighbor adjacencies\n"
"System id\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" "IS-IS link state database\n"
"LSP ID\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, DEFUN (show_database_lsp_detail,
@ -1542,7 +1542,7 @@ DEFUN (show_database_lsp_detail,
"LSP ID\n" "LSP ID\n"
"Detailed information\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, DEFUN (show_database_detail,
@ -1564,7 +1564,7 @@ DEFUN (show_database_detail_lsp,
"Detailed information\n" "Detailed information\n"
"LSP ID\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 IS-IS\n"
"ISO Routing area tag") "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 router isis WORD",
"no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag") "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" "A Network Entity Title for this process (OSI only)\n"
"XX.XXXX. ... .XXX.XX Network entity title (NET)\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" "A Network Entity Title for this process (OSI only)\n"
"XX.XXXX. ... .XXX.XX Network entity title (NET)\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) 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, DEFUN (topology_generate_grid,
topology_generate_grid_cmd, topology_generate_grid_cmd,
"topology generate grid <1-100> <1-100> <1-65000> [param] [param] " "topology generate grid <1-100> <1-100> <1-65000> [param] [param] [param]",
"[param]",
"Topology generation for IS-IS\n" "Topology generation for IS-IS\n"
"Topology generation\n" "Topology generation\n"
"Grid topology\n" "Grid topology\n"
@ -1973,8 +1972,8 @@ DEFUN (topology_baseis,
area = vty->index; area = vty->index;
assert (area); assert (area);
if (sysid2buff (buff, argv[0])) if (sysid2buff (buff, argv[2]->arg))
sysid2buff (area->topology_baseis, argv[0]); sysid2buff (area->topology_baseis, argv[2]->arg);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -2016,7 +2015,7 @@ DEFUN (topology_basedynh,
assert (area); assert (area);
/* I hope that it's enough. */ /* I hope that it's enough. */
area->topology_basedynh = strndup (argv[0], 16); area->topology_basedynh = strndup (argv[2]->arg, 16);
return CMD_SUCCESS; return CMD_SUCCESS;
} }

View File

@ -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_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_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_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 # endswith
line = line.replace('" CMD_AS_RANGE,', ' <1-4294967295>",') 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_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('" 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_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 # startswith
line = line.replace('LISTEN_RANGE_CMD "', '"bgp listen range (A.B.C.D/M|X:X::X:X/M) ') line = line.replace('LISTEN_RANGE_CMD "', '"bgp listen range (A.B.C.D/M|X:X::X:X/M) ')