DEFUN (isis_redistribute,
isis_redistribute_cmd,
"redistribute <ipv4|ipv6> " PROTO_REDIST_STR
- " [<metric (0-16777215)|route-map WORD>]",
+ " [{metric (0-16777215)|route-map WORD}]",
REDIST_STR
"Redistribute IPv4 routes\n"
"Redistribute IPv6 routes\n"
{
int idx_afi = 1;
int idx_protocol = 2;
- int idx_metric_rmap = fabricd ? 3 : 4;
+ int idx_metric_rmap = 1;
VTY_DECLVAR_CONTEXT(isis_area, area);
int family;
int afi;
return CMD_WARNING_CONFIG_FAILED;
}
- if (argc > idx_metric_rmap + 1) {
- if (argv[idx_metric_rmap + 1]->arg[0] == '\0')
- return CMD_WARNING_CONFIG_FAILED;
-
- if (strmatch(argv[idx_metric_rmap]->text, "metric")) {
- char *endp;
- metric = strtoul(argv[idx_metric_rmap + 1]->arg, &endp,
- 10);
+ if (argv_find(argv, argc, "metric", &idx_metric_rmap)) {
+ metric = strtoul(argv[idx_metric_rmap + 1]->arg, NULL, 10);
+ }
- if (*endp != '\0')
- return CMD_WARNING_CONFIG_FAILED;
- } else {
- routemap = argv[idx_metric_rmap + 1]->arg;
- }
+ idx_metric_rmap = 1;
+ if (argv_find(argv, argc, "route-map", &idx_metric_rmap)) {
+ routemap = argv[idx_metric_rmap + 1]->arg;
}
isis_redist_set(area, level, family, type, metric, routemap, 0);
DEFUN (isis_default_originate,
isis_default_originate_cmd,
"default-information originate <ipv4|ipv6>"
- " [always] [<metric (0-16777215)|route-map WORD>]",
+ " [always] [{metric (0-16777215)|route-map WORD}]",
"Control distribution of default information\n"
"Distribute a default route\n"
"Distribute default route for IPv4\n"
{
int idx_afi = 2;
int idx_always = fabricd ? 3 : 4;
- int idx_metric_rmap = fabricd ? 3 : 4;
+ int idx_metric_rmap = 1;
VTY_DECLVAR_CONTEXT(isis_area, area);
int family;
int originate_type = DEFAULT_ORIGINATE;
idx_metric_rmap++;
}
- if (argc > idx_metric_rmap) {
- if (strmatch(argv[idx_metric_rmap]->text, "metric"))
- metric = strtoul(argv[idx_metric_rmap + 1]->arg, NULL,
- 10);
- else
- routemap = argv[idx_metric_rmap + 1]->arg;
+ if (argv_find(argv, argc, "metric", &idx_metric_rmap)) {
+ metric = strtoul(argv[idx_metric_rmap + 1]->arg, NULL, 10);
+ }
+
+ idx_metric_rmap = 1;
+ if (argv_find(argv, argc, "route-map", &idx_metric_rmap)) {
+ routemap = argv[idx_metric_rmap + 1]->arg;
}
if (family == AF_INET6 && originate_type != DEFAULT_ORIGINATE_ALWAYS) {