if (argc < 5)
return CMD_WARNING;
- family = str2family(argv[0]->arg);
+ family = str2family(argv[0]);
if (family < 0)
return CMD_WARNING;
if (!afi)
return CMD_WARNING;
- type = proto_redistnum(afi, argv[1]->arg);
+ type = proto_redistnum(afi, argv[1]);
if (type < 0 || type == ZEBRA_ROUTE_ISIS)
return CMD_WARNING;
- if (!strcmp("level-1", argv[2]->arg))
+ if (!strcmp("level-1", argv[2]))
level = 1;
- else if (!strcmp("level-2", argv[2]->arg))
+ else if (!strcmp("level-2", argv[2]))
level = 2;
else
return CMD_WARNING;
return CMD_WARNING;
}
- if (argv[3]->arg)
+ if (argv[3])
{
char *endp;
- metric = strtoul(argv[3]->arg, &endp, 10);
- if (argv[3]->arg[0] == '\0' || *endp != '\0')
+ metric = strtoul(argv[3], &endp, 10);
+ if (argv[3][0] == '\0' || *endp != '\0')
return CMD_WARNING;
}
else
metric = 0xffffffff;
}
- routemap = argv[4]->arg;
+ routemap = argv[4];
isis_redist_set(area, level, family, type, metric, routemap, 0);
return 0;
if (argc < 3)
return CMD_WARNING;
- family = str2family(argv[0]->arg);
+ family = str2family(argv[0]);
if (family < 0)
return CMD_WARNING;
if (!afi)
return CMD_WARNING;
- type = proto_redistnum(afi, argv[1]->arg);
+ type = proto_redistnum(afi, argv[1]);
if (type < 0 || type == ZEBRA_ROUTE_ISIS)
return CMD_WARNING;
- if (!strcmp("level-1", argv[2]->arg))
+ if (!strcmp("level-1", argv[2]))
level = 1;
- else if (!strcmp("level-2", argv[2]->arg))
+ else if (!strcmp("level-2", argv[2]))
level = 2;
else
return CMD_WARNING;
if (argc < 5)
return CMD_WARNING;
- family = str2family(argv[0]->arg);
+ family = str2family(argv[0]);
if (family < 0)
return CMD_WARNING;
- if (!strcmp("level-1", argv[1]->arg))
+ if (!strcmp("level-1", argv[1]))
level = 1;
- else if (!strcmp("level-2", argv[1]->arg))
+ else if (!strcmp("level-2", argv[1]))
level = 2;
else
return CMD_WARNING;
return CMD_WARNING;
}
- if (argv[2]->arg && *argv[2]->arg != '\0')
+ if (argv[2] && *argv[2] != '\0')
originate_type = DEFAULT_ORIGINATE_ALWAYS;
else
originate_type = DEFAULT_ORIGINATE;
vty_out(vty, "so use with care or use default-originate always.%s", VTY_NEWLINE);
}
- if (argv[3]->arg)
+ if (argv[3])
{
char *endp;
- metric = strtoul(argv[3]->arg, &endp, 10);
- if (argv[3]->arg[0] == '\0' || *endp != '\0')
+ metric = strtoul(argv[3], &endp, 10);
+ if (argv[3][0] == '\0' || *endp != '\0')
return CMD_WARNING;
}
else
metric = 0xffffffff;
}
- routemap = argv[4]->arg;
+ routemap = argv[4];
isis_redist_set(area, level, family, DEFAULT_ROUTE, metric, routemap, originate_type);
return 0;
if (argc < 2)
return CMD_WARNING;
- family = str2family(argv[0]->arg);
+ family = str2family(argv[0]);
if (family < 0)
return CMD_WARNING;
- if (!strcmp("level-1", argv[1]->arg))
+ if (!strcmp("level-1", argv[1]))
level = 1;
- else if (!strcmp("level-2", argv[1]->arg))
+ else if (!strcmp("level-2", argv[1]))
level = 2;
else
return CMD_WARNING;
"IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
- return isis_route_match_add(vty, vty->index, "ip address", argv[0]->arg);
+ return isis_route_match_add(vty, vty->index, "ip address", argv[0]);
}
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]->arg);
+ return isis_route_match_delete(vty, vty->index, "ip address", argv[0]);
}
ALIAS (no_match_ip_address,
"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]->arg);
+ return isis_route_match_add(vty, vty->index, "ip address prefix-list", argv[0]);
}
DEFUN (no_match_ip_address_prefix_list,
{
if (argc == 0)
return isis_route_match_delete (vty, vty->index, "ip address prefix-list", NULL);
- return isis_route_match_delete (vty, vty->index, "ip address prefix-list", argv[0]->arg);
+ return isis_route_match_delete (vty, vty->index, "ip address prefix-list", argv[0]);
}
ALIAS (no_match_ip_address_prefix_list,
"Match IPv6 address of route\n"
"IPv6 access-list name\n")
{
- return isis_route_match_add(vty, vty->index, "ipv6 address", argv[0]->arg);
+ return isis_route_match_add(vty, vty->index, "ipv6 address", argv[0]);
}
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]->arg);
+ return isis_route_match_delete(vty, vty->index, "ipv6 address", argv[0]);
}
ALIAS (no_match_ipv6_address,
"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]->arg);
+ return isis_route_match_add(vty, vty->index, "ipv6 address prefix-list", argv[0]);
}
DEFUN (no_match_ipv6_address_prefix_list,
{
if (argc == 0)
return isis_route_match_delete (vty, vty->index, "ipv6 address prefix-list", NULL);
- return isis_route_match_delete (vty, vty->index, "ipv6 address prefix-list", argv[0]->arg);
+ return isis_route_match_delete (vty, vty->index, "ipv6 address prefix-list", argv[0]);
}
ALIAS (no_match_ipv6_address_prefix_list,
"Metric vale for destination routing protocol\n"
"Metric value\n")
{
- return isis_route_set_add(vty, vty->index, "metric", argv[0]->arg);
+ return isis_route_set_add(vty, vty->index, "metric", argv[0]);
}
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]->arg);
+ return isis_route_set_delete(vty, vty->index, "metric", argv[0]);
}
ALIAS (no_set_metric,
struct interface *ifp;
struct isis_circuit *circuit;
struct isis_area *area;
- const char *af = argv[0]->arg;
- const char *area_tag = argv[1]->arg;
+ const char *af = argv[0];
+ const char *area_tag = argv[1];
ifp = (struct interface *) vty->index;
assert (ifp);
struct interface *ifp;
struct isis_area *area;
struct isis_circuit *circuit;
- const char *af = argv[0]->arg;
- const char *area_tag = argv[1]->arg;
+ const char *af = argv[0];
+ const char *area_tag = argv[1];
ifp = (struct interface *) vty->index;
if (!ifp)
if (!area)
{
vty_out (vty, "Can't find ISIS instance %s%s",
- argv[0]->arg, VTY_NEWLINE);
+ argv[0], VTY_NEWLINE);
return CMD_ERR_NO_MATCH;
}
if (!circuit)
return CMD_ERR_NO_MATCH;
- is_type = string2circuit_t (argv[0]->arg);
+ is_type = string2circuit_t (argv[0]);
if (!is_type)
{
vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
if (!circuit)
return CMD_ERR_NO_MATCH;
- if (argv[0]->arg[0] == 'm')
- rv = isis_circuit_passwd_hmac_md5_set(circuit, argv[1]->arg);
+ if (argv[0][0] == 'm')
+ rv = isis_circuit_passwd_hmac_md5_set(circuit, argv[1]);
else
- rv = isis_circuit_passwd_cleartext_set(circuit, argv[1]->arg);
+ rv = isis_circuit_passwd_cleartext_set(circuit, argv[1]);
if (rv)
{
vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
if (!circuit)
return CMD_ERR_NO_MATCH;
- prio = atoi (argv[0]->arg);
+ prio = atoi (argv[0]);
if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
{
vty_out (vty, "Invalid priority %d - should be <0-127>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- prio = atoi (argv[0]->arg);
+ prio = atoi (argv[0]);
if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
{
vty_out (vty, "Invalid priority %d - should be <0-127>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- prio = atoi (argv[0]->arg);
+ prio = atoi (argv[0]);
if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
{
vty_out (vty, "Invalid priority %d - should be <0-127>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- met = atoi (argv[0]->arg);
+ met = atoi (argv[0]);
/* RFC3787 section 5.1 */
if (circuit->area && circuit->area->oldmetric == 1 &&
if (!circuit)
return CMD_ERR_NO_MATCH;
- met = atoi (argv[0]->arg);
+ met = atoi (argv[0]);
/* RFC3787 section 5.1 */
if (circuit->area && circuit->area->oldmetric == 1 &&
if (!circuit)
return CMD_ERR_NO_MATCH;
- met = atoi (argv[0]->arg);
+ met = atoi (argv[0]);
/* RFC3787 section 5.1 */
if (circuit->area && circuit->area->oldmetric == 1 &&
if (!circuit)
return CMD_ERR_NO_MATCH;
- interval = atoi (argv[0]->arg);
+ interval = atoi (argv[0]);
if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
{
vty_out (vty, "Invalid hello-interval %d - should be <1-600>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- interval = atoi (argv[0]->arg);
+ interval = atoi (argv[0]);
if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
{
vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- interval = atoi (argv[0]->arg);
+ interval = atoi (argv[0]);
if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
{
vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- mult = atoi (argv[0]->arg);
+ mult = atoi (argv[0]);
if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
{
vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- mult = atoi (argv[0]->arg);
+ mult = atoi (argv[0]);
if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
{
vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- mult = atoi (argv[0]->arg);
+ mult = atoi (argv[0]);
if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
{
vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- interval = atol (argv[0]->arg);
+ interval = atol (argv[0]);
if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
{
vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- interval = atol (argv[0]->arg);
+ interval = atol (argv[0]);
if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
{
vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- interval = atol (argv[0]->arg);
+ interval = atol (argv[0]);
if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
{
vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- interval = atol (argv[0]->arg);
+ interval = atol (argv[0]);
if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
{
vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- interval = atol (argv[0]->arg);
+ interval = atol (argv[0]);
if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
{
vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
if (!circuit)
return CMD_ERR_NO_MATCH;
- interval = atol (argv[0]->arg);
+ interval = atol (argv[0]);
if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
{
vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
assert(area);
- if (strncmp (argv[0]->arg, "w", 1) == 0)
+ if (strncmp (argv[0], "w", 1) == 0)
{
isis_area_metricstyle_set(area, false, true);
return CMD_SUCCESS;
if (ret != CMD_SUCCESS)
return ret;
- if (strncmp (argv[0]->arg, "t", 1) == 0)
+ if (strncmp (argv[0], "t", 1) == 0)
isis_area_metricstyle_set(area, true, true);
- else if (strncmp (argv[0]->arg, "n", 1) == 0)
+ else if (strncmp (argv[0], "n", 1) == 0)
isis_area_metricstyle_set(area, true, false);
return CMD_SUCCESS;
{
unsigned int lsp_mtu;
- VTY_GET_INTEGER_RANGE("lsp-mtu", lsp_mtu, argv[0]->arg, 128, 4352);
+ VTY_GET_INTEGER_RANGE("lsp-mtu", lsp_mtu, argv[0], 128, 4352);
return area_lsp_mtu_set(vty, lsp_mtu);
}
return CMD_ERR_NO_MATCH;
}
- type = string2circuit_t (argv[0]->arg);
+ type = string2circuit_t (argv[0]);
if (!type)
{
vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
int level;
area = vty->index;
- interval = atoi (argv[0]->arg);
+ interval = atoi (argv[0]);
level = IS_LEVEL_1 | IS_LEVEL_2;
return set_lsp_gen_interval (vty, area, interval, level);
}
int level;
area = vty->index;
- interval = atoi (argv[0]->arg);
+ interval = atoi (argv[0]);
level = IS_LEVEL_1;
return set_lsp_gen_interval (vty, area, interval, level);
}
int level;
area = vty->index;
- interval = atoi (argv[0]->arg);
+ interval = atoi (argv[0]);
level = IS_LEVEL_2;
return set_lsp_gen_interval (vty, area, interval, level);
}
u_int16_t interval;
area = vty->index;
- interval = atoi (argv[0]->arg);
+ interval = atoi (argv[0]);
area->min_spf_interval[0] = interval;
area->min_spf_interval[1] = interval;
u_int16_t interval;
area = vty->index;
- interval = atoi (argv[0]->arg);
+ interval = atoi (argv[0]);
area->min_spf_interval[0] = interval;
return CMD_SUCCESS;
u_int16_t interval;
area = vty->index;
- interval = atoi (argv[0]->arg);
+ interval = atoi (argv[0]);
area->min_spf_interval[1] = interval;
return CMD_SUCCESS;
"Maximum LSP lifetime\n"
"LSP lifetime in seconds\n")
{
- return area_max_lsp_lifetime_set(vty, IS_LEVEL_1_AND_2, atoi(argv[0]->arg));
+ return area_max_lsp_lifetime_set(vty, IS_LEVEL_1_AND_2, atoi(argv[0]));
}
DEFUN (no_max_lsp_lifetime,
"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]->arg));
+ return area_max_lsp_lifetime_set(vty, IS_LEVEL_1, atoi(argv[0]));
}
DEFUN (no_max_lsp_lifetime_l1,
"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]->arg));
+ return area_max_lsp_lifetime_set(vty, IS_LEVEL_2, atoi(argv[0]));
}
DEFUN (no_max_lsp_lifetime_l2,
"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]->arg));
+ return area_lsp_refresh_interval_set(vty, IS_LEVEL_1_AND_2, atoi(argv[0]));
}
DEFUN (no_lsp_refresh_interval,
"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]->arg));
+ return area_lsp_refresh_interval_set(vty, IS_LEVEL_1, atoi(argv[0]));
}
DEFUN (no_lsp_refresh_interval_l1,
"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]->arg));
+ return area_lsp_refresh_interval_set(vty, IS_LEVEL_2, atoi(argv[0]));
}
DEFUN (no_lsp_refresh_interval_l2,
"Level-wide password\n")
{
u_char snp_auth = 0;
- int level = (argv[0]->arg[0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1;
+ int level = (argv[0][0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1;
if (argc > 2)
{
snp_auth = SNP_AUTH_SEND;
- if (strncmp(argv[2]->arg, "v", 1) == 0)
+ if (strncmp(argv[2], "v", 1) == 0)
snp_auth |= SNP_AUTH_RECV;
}
return area_passwd_set(vty, level, isis_area_passwd_hmac_md5_set,
- argv[1]->arg, snp_auth);
+ argv[1], snp_auth);
}
ALIAS (area_passwd_md5,
"Area password\n")
{
u_char snp_auth = 0;
- int level = (argv[0]->arg[0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1;
+ int level = (argv[0][0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1;
if (argc > 2)
{
snp_auth = SNP_AUTH_SEND;
- if (strncmp(argv[2]->arg, "v", 1) == 0)
+ if (strncmp(argv[2], "v", 1) == 0)
snp_auth |= SNP_AUTH_RECV;
}
return area_passwd_set(vty, level, isis_area_passwd_cleartext_set,
- argv[1]->arg, snp_auth);
+ argv[1], snp_auth);
}
ALIAS (area_passwd_clear,
"Configure the authentication password for an area\n"
"Set the authentication password for a routing domain\n")
{
- int level = (argv[0]->arg[0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1;
+ int level = (argv[0][0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1;
struct isis_area *area = vty->index;
if (!area)
"ISIS interface\n"
"ISIS interface name\n")
{
- return show_isis_interface_common (vty, argv[0]->arg, ISIS_UI_LEVEL_DETAIL);
+ return show_isis_interface_common (vty, argv[0], ISIS_UI_LEVEL_DETAIL);
}
/*
"ISIS neighbor adjacencies\n"
"System id\n")
{
- return show_isis_neighbor_common (vty, argv[0]->arg, ISIS_UI_LEVEL_DETAIL);
+ return show_isis_neighbor_common (vty, argv[0], ISIS_UI_LEVEL_DETAIL);
}
DEFUN (clear_isis_neighbor,
"ISIS neighbor adjacencies\n"
"System id\n")
{
- return clear_isis_neighbor_common (vty, argv[0]->arg);
+ return clear_isis_neighbor_common (vty, argv[0]);
}
/*
"IS-IS link state database\n"
"LSP ID\n")
{
- return show_isis_database (vty, argv[0]->arg, ISIS_UI_LEVEL_BRIEF);
+ return show_isis_database (vty, argv[0], ISIS_UI_LEVEL_BRIEF);
}
DEFUN (show_database_lsp_detail,
"LSP ID\n"
"Detailed information\n")
{
- return show_isis_database (vty, argv[0]->arg, ISIS_UI_LEVEL_DETAIL);
+ return show_isis_database (vty, argv[0], ISIS_UI_LEVEL_DETAIL);
}
DEFUN (show_database_detail,
"Detailed information\n"
"LSP ID\n")
{
- return show_isis_database (vty, argv[0]->arg, ISIS_UI_LEVEL_DETAIL);
+ return show_isis_database (vty, argv[0], ISIS_UI_LEVEL_DETAIL);
}
/*
"ISO IS-IS\n"
"ISO Routing area tag")
{
- return isis_area_get (vty, argv[0]->arg);
+ return isis_area_get (vty, argv[0]);
}
/*
"no router isis WORD",
"no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag")
{
- return isis_area_destroy (vty, argv[0]->arg);
+ return isis_area_destroy (vty, argv[0]);
}
/*
"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]->arg);
+ return area_net_title (vty, argv[0]);
}
/*
"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]->arg);
+ return area_clear_net_title (vty, argv[0]);
}
void isis_area_lsp_mtu_set(struct isis_area *area, unsigned int lsp_mtu)
area = vty->index;
assert (area);
- if (sysid2buff (buff, argv[0]->arg))
- sysid2buff (area->topology_baseis, argv[0]->arg);
+ if (sysid2buff (buff, argv[0]))
+ sysid2buff (area->topology_baseis, argv[0]);
return CMD_SUCCESS;
}
assert (area);
/* I hope that it's enough. */
- area->topology_basedynh = strndup (argv[0]->arg, 16);
+ area->topology_basedynh = strndup (argv[0], 16);
return CMD_SUCCESS;
}