summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2016-09-23 02:01:25 +0200
committerDaniel Walton <dwalton@cumulusnetworks.com>2016-09-23 02:01:25 +0200
commit558e4c284b30ac90b7c8a9e2f8cefd368fe98c9f (patch)
treed8685ad59e537b28090c61c7a84fd3174da0553c /ripd
parentripngd: argv update (diff)
downloadfrr-558e4c284b30ac90b7c8a9e2f8cefd368fe98c9f.tar.xz
frr-558e4c284b30ac90b7c8a9e2f8cefd368fe98c9f.zip
ripd: argv update
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'ripd')
-rw-r--r--ripd/rip_debug.c8
-rw-r--r--ripd/rip_interface.c42
-rw-r--r--ripd/rip_offset.c8
-rw-r--r--ripd/rip_routemap.c72
-rw-r--r--ripd/rip_zebra.c53
-rw-r--r--ripd/ripd.c26
6 files changed, 89 insertions, 120 deletions
diff --git a/ripd/rip_debug.c b/ripd/rip_debug.c
index 81d74bf85..0567f4f20 100644
--- a/ripd/rip_debug.c
+++ b/ripd/rip_debug.c
@@ -98,9 +98,9 @@ DEFUN (debug_rip_packet_direct,
"RIP send packet\n")
{
rip_debug_packet |= RIP_DEBUG_PACKET;
- if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
+ if (strncmp ("send", argv[3]->arg, strlen (argv[3]->arg)) == 0)
rip_debug_packet |= RIP_DEBUG_SEND;
- if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
+ if (strncmp ("recv", argv[3]->arg, strlen (argv[3]->arg)) == 0)
rip_debug_packet |= RIP_DEBUG_RECV;
return CMD_SUCCESS;
}
@@ -150,14 +150,14 @@ DEFUN (no_debug_rip_packet_direct,
"RIP option set for receive packet\n"
"RIP option set for send packet\n")
{
- if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
+ if (strncmp ("send", argv[4]->arg, strlen (argv[4]->arg)) == 0)
{
if (IS_RIP_DEBUG_RECV)
rip_debug_packet &= ~RIP_DEBUG_SEND;
else
rip_debug_packet = 0;
}
- else if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
+ else if (strncmp ("recv", argv[4]->arg, strlen (argv[4]->arg)) == 0)
{
if (IS_RIP_DEBUG_SEND)
rip_debug_packet &= ~RIP_DEBUG_RECV;
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 09b35d00b..749939da2 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -1228,16 +1228,16 @@ DEFUN (rip_network,
int ret;
struct prefix_ipv4 p;
- ret = str2prefix_ipv4 (argv[0], &p);
+ ret = str2prefix_ipv4 (argv[1]->arg, &p);
if (ret)
ret = rip_enable_network_add ((struct prefix *) &p);
else
- ret = rip_enable_if_add (argv[0]);
+ ret = rip_enable_if_add (argv[1]->arg);
if (ret < 0)
{
- vty_out (vty, "There is a same network configuration %s%s", argv[0],
+ vty_out (vty, "There is a same network configuration %s%s", argv[1]->arg,
VTY_NEWLINE);
return CMD_WARNING;
}
@@ -1257,16 +1257,16 @@ DEFUN (no_rip_network,
int ret;
struct prefix_ipv4 p;
- ret = str2prefix_ipv4 (argv[0], &p);
+ ret = str2prefix_ipv4 (argv[2]->arg, &p);
if (ret)
ret = rip_enable_network_delete ((struct prefix *) &p);
else
- ret = rip_enable_if_delete (argv[0]);
+ ret = rip_enable_if_delete (argv[2]->arg);
if (ret < 0)
{
- vty_out (vty, "Can't find network configuration %s%s", argv[0],
+ vty_out (vty, "Can't find network configuration %s%s", argv[2]->arg,
VTY_NEWLINE);
return CMD_WARNING;
}
@@ -1284,7 +1284,7 @@ DEFUN (rip_neighbor,
int ret;
struct prefix_ipv4 p;
- ret = str2prefix_ipv4 (argv[0], &p);
+ ret = str2prefix_ipv4 (argv[1]->arg, &p);
if (ret <= 0)
{
@@ -1308,7 +1308,7 @@ DEFUN (no_rip_neighbor,
int ret;
struct prefix_ipv4 p;
- ret = str2prefix_ipv4 (argv[0], &p);
+ ret = str2prefix_ipv4 (argv[2]->arg, &p);
if (ret <= 0)
{
@@ -1338,12 +1338,12 @@ DEFUN (ip_rip_receive_version,
ri = ifp->info;
/* Version 1. */
- if (atoi (argv[0]) == 1)
+ if (atoi (argv[4]->arg) == 1)
{
ri->ri_receive = RI_RIP_VERSION_1;
return CMD_SUCCESS;
}
- if (atoi (argv[0]) == 2)
+ if (atoi (argv[4]->arg) == 2)
{
ri->ri_receive = RI_RIP_VERSION_2;
return CMD_SUCCESS;
@@ -1440,12 +1440,12 @@ DEFUN (ip_rip_send_version,
ri = ifp->info;
/* Version 1. */
- if (atoi (argv[0]) == 1)
+ if (atoi (argv[4]->arg) == 1)
{
ri->ri_send = RI_RIP_VERSION_1;
return CMD_SUCCESS;
}
- if (atoi (argv[0]) == 2)
+ if (atoi (argv[4]->arg) == 2)
{
ri->ri_send = RI_RIP_VERSION_2;
return CMD_SUCCESS;
@@ -1548,9 +1548,9 @@ DEFUN (ip_rip_authentication_mode,
return CMD_WARNING;
}
- if (strncmp ("md5", argv[0], strlen (argv[0])) == 0)
+ if (strncmp ("md5", argv[4]->arg, strlen (argv[4]->arg)) == 0)
auth_type = RIP_AUTH_MD5;
- else if (strncmp ("text", argv[0], strlen (argv[0])) == 0)
+ else if (strncmp ("text", argv[4]->arg, strlen (argv[4]->arg)) == 0)
auth_type = RIP_AUTH_SIMPLE_PASSWORD;
else
{
@@ -1570,9 +1570,9 @@ DEFUN (ip_rip_authentication_mode,
return CMD_WARNING;
}
- if (strncmp ("r", argv[1], 1) == 0)
+ if (strncmp ("r", argv[6]->arg, 1) == 0)
ri->md5_auth_len = RIP_AUTH_MD5_SIZE;
- else if (strncmp ("o", argv[1], 1) == 0)
+ else if (strncmp ("o", argv[6]->arg, 1) == 0)
ri->md5_auth_len = RIP_AUTH_MD5_COMPAT_SIZE;
else
return CMD_WARNING;
@@ -1656,7 +1656,7 @@ DEFUN (ip_rip_authentication_string,
ifp = (struct interface *)vty->index;
ri = ifp->info;
- if (strlen (argv[0]) > 16)
+ if (strlen (argv[4]->arg) > 16)
{
vty_out (vty, "%% RIPv2 authentication string must be shorter than 16%s",
VTY_NEWLINE);
@@ -1672,7 +1672,7 @@ DEFUN (ip_rip_authentication_string,
if (ri->auth_str)
free (ri->auth_str);
- ri->auth_str = strdup (argv[0]);
+ ri->auth_str = strdup (argv[4]->arg);
return CMD_SUCCESS;
}
@@ -1735,7 +1735,7 @@ DEFUN (ip_rip_authentication_key_chain,
if (ri->key_chain)
free (ri->key_chain);
- ri->key_chain = strdup (argv[0]);
+ ri->key_chain = strdup (argv[4]->arg);
return CMD_SUCCESS;
}
@@ -1867,7 +1867,7 @@ DEFUN (rip_passive_interface,
"Interface name\n"
"default for all interfaces\n")
{
- const char *ifname = argv[0];
+ const char *ifname = argv[1]->arg;
if (!strcmp(ifname,"default")) {
passive_default = 1;
@@ -1888,7 +1888,7 @@ DEFUN (no_rip_passive_interface,
"Interface name\n"
"default for all interfaces\n")
{
- const char *ifname = argv[0];
+ const char *ifname = argv[2]->arg;
if (!strcmp(ifname,"default")) {
passive_default = 0;
diff --git a/ripd/rip_offset.c b/ripd/rip_offset.c
index 0155f90ef..be734c66d 100644
--- a/ripd/rip_offset.c
+++ b/ripd/rip_offset.c
@@ -289,7 +289,7 @@ DEFUN (rip_offset_list,
"For outgoing updates\n"
"Metric value\n")
{
- return rip_offset_list_set (vty, argv[0], argv[1], argv[2], NULL);
+ return rip_offset_list_set (vty, argv[1]->arg, argv[2]->arg, argv[3]->arg, NULL);
}
DEFUN (rip_offset_list_ifname,
@@ -302,7 +302,7 @@ DEFUN (rip_offset_list_ifname,
"Metric value\n"
"Interface to match\n")
{
- return rip_offset_list_set (vty, argv[0], argv[1], argv[2], argv[3]);
+ return rip_offset_list_set (vty, argv[1]->arg, argv[2]->arg, argv[3]->arg, argv[4]->arg);
}
DEFUN (no_rip_offset_list,
@@ -315,7 +315,7 @@ DEFUN (no_rip_offset_list,
"For outgoing updates\n"
"Metric value\n")
{
- return rip_offset_list_unset (vty, argv[0], argv[1], argv[2], NULL);
+ return rip_offset_list_unset (vty, argv[2]->arg, argv[3]->arg, argv[4]->arg, NULL);
}
DEFUN (no_rip_offset_list_ifname,
@@ -329,7 +329,7 @@ DEFUN (no_rip_offset_list_ifname,
"Metric value\n"
"Interface to match\n")
{
- return rip_offset_list_unset (vty, argv[0], argv[1], argv[2], argv[3]);
+ return rip_offset_list_unset (vty, argv[2]->arg, argv[3]->arg, argv[4]->arg, argv[5]->arg);
}
static int
diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c
index e7263ad7b..76186cdf6 100644
--- a/ripd/rip_routemap.c
+++ b/ripd/rip_routemap.c
@@ -742,7 +742,7 @@ DEFUN (match_metric,
"Match metric of route\n"
"Metric value\n")
{
- return rip_route_match_add (vty, vty->index, "metric", argv[0]);
+ return rip_route_match_add (vty, vty->index, "metric", argv[2]->arg);
}
DEFUN (no_match_metric,
@@ -752,10 +752,7 @@ DEFUN (no_match_metric,
MATCH_STR
"Match metric of route\n")
{
- if (argc == 0)
- return rip_route_match_delete (vty, vty->index, "metric", NULL);
-
- return rip_route_match_delete (vty, vty->index, "metric", argv[0]);
+ return rip_route_match_delete (vty, vty->index, "metric", argv[3]->arg);
}
ALIAS (no_match_metric,
@@ -773,7 +770,7 @@ DEFUN (match_interface,
"Match first hop interface of route\n"
"Interface name\n")
{
- return rip_route_match_add (vty, vty->index, "interface", argv[0]);
+ return rip_route_match_add (vty, vty->index, "interface", argv[2]->arg);
}
DEFUN (no_match_interface,
@@ -783,10 +780,7 @@ DEFUN (no_match_interface,
MATCH_STR
"Match first hop interface of route\n")
{
- if (argc == 0)
- return rip_route_match_delete (vty, vty->index, "interface", NULL);
-
- return rip_route_match_delete (vty, vty->index, "interface", argv[0]);
+ return rip_route_match_delete (vty, vty->index, "interface", argv[3]->arg);
}
ALIAS (no_match_interface,
@@ -807,7 +801,7 @@ DEFUN (match_ip_next_hop,
"IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
- return rip_route_match_add (vty, vty->index, "ip next-hop", argv[0]);
+ return rip_route_match_add (vty, vty->index, "ip next-hop", argv[3]->arg);
}
DEFUN (no_match_ip_next_hop,
@@ -818,10 +812,7 @@ DEFUN (no_match_ip_next_hop,
IP_STR
"Match next-hop address of route\n")
{
- if (argc == 0)
- return rip_route_match_delete (vty, vty->index, "ip next-hop", NULL);
-
- return rip_route_match_delete (vty, vty->index, "ip next-hop", argv[0]);
+ return rip_route_match_delete (vty, vty->index, "ip next-hop", argv[4]->arg);
}
ALIAS (no_match_ip_next_hop,
@@ -844,7 +835,7 @@ DEFUN (match_ip_next_hop_prefix_list,
"Match entries of prefix-lists\n"
"IP prefix-list name\n")
{
- return rip_route_match_add (vty, vty->index, "ip next-hop prefix-list", argv[0]);
+ return rip_route_match_add (vty, vty->index, "ip next-hop prefix-list", argv[4]->arg);
}
DEFUN (no_match_ip_next_hop_prefix_list,
@@ -856,10 +847,7 @@ DEFUN (no_match_ip_next_hop_prefix_list,
"Match next-hop address of route\n"
"Match entries of prefix-lists\n")
{
- if (argc == 0)
- return rip_route_match_delete (vty, vty->index, "ip next-hop prefix-list", NULL);
-
- return rip_route_match_delete (vty, vty->index, "ip next-hop prefix-list", argv[0]);
+ return rip_route_match_delete (vty, vty->index, "ip next-hop prefix-list", argv[5]->arg);
}
ALIAS (no_match_ip_next_hop_prefix_list,
@@ -883,7 +871,7 @@ DEFUN (match_ip_address,
"IP Access-list name\n")
{
- return rip_route_match_add (vty, vty->index, "ip address", argv[0]);
+ return rip_route_match_add (vty, vty->index, "ip address", argv[3]->arg);
}
DEFUN (no_match_ip_address,
@@ -894,10 +882,7 @@ DEFUN (no_match_ip_address,
IP_STR
"Match address of route\n")
{
- if (argc == 0)
- return rip_route_match_delete (vty, vty->index, "ip address", NULL);
-
- return rip_route_match_delete (vty, vty->index, "ip address", argv[0]);
+ return rip_route_match_delete (vty, vty->index, "ip address", argv[4]->arg);
}
ALIAS (no_match_ip_address,
@@ -920,7 +905,7 @@ DEFUN (match_ip_address_prefix_list,
"Match entries of prefix-lists\n"
"IP prefix-list name\n")
{
- return rip_route_match_add (vty, vty->index, "ip address prefix-list", argv[0]);
+ return rip_route_match_add (vty, vty->index, "ip address prefix-list", argv[4]->arg);
}
DEFUN (no_match_ip_address_prefix_list,
@@ -932,10 +917,7 @@ DEFUN (no_match_ip_address_prefix_list,
"Match address of route\n"
"Match entries of prefix-lists\n")
{
- if (argc == 0)
- return rip_route_match_delete (vty, vty->index, "ip address prefix-list", NULL);
-
- return rip_route_match_delete (vty, vty->index, "ip address prefix-list", argv[0]);
+ return rip_route_match_delete (vty, vty->index, "ip address prefix-list", argv[5]->arg);
}
ALIAS (no_match_ip_address_prefix_list,
@@ -955,7 +937,7 @@ DEFUN (match_tag,
"Match tag of route\n"
"Metric value\n")
{
- return rip_route_match_add (vty, vty->index, "tag", argv[0]);
+ return rip_route_match_add (vty, vty->index, "tag", argv[2]->arg);
}
DEFUN (no_match_tag,
@@ -965,10 +947,7 @@ DEFUN (no_match_tag,
MATCH_STR
"Match tag of route\n")
{
- if (argc == 0)
- return rip_route_match_delete (vty, vty->index, "tag", NULL);
-
- return rip_route_match_delete (vty, vty->index, "tag", argv[0]);
+ return rip_route_match_delete (vty, vty->index, "tag", argv[3]->arg);
}
ALIAS (no_match_tag,
@@ -988,7 +967,7 @@ DEFUN (set_metric,
"Metric value for destination routing protocol\n"
"Metric value\n")
{
- return rip_route_set_add (vty, vty->index, "metric", argv[0]);
+ return rip_route_set_add (vty, vty->index, "metric", argv[2]->arg);
}
ALIAS (set_metric,
@@ -1005,10 +984,7 @@ DEFUN (no_set_metric,
SET_STR
"Metric value for destination routing protocol\n")
{
- if (argc == 0)
- return rip_route_set_delete (vty, vty->index, "metric", NULL);
-
- return rip_route_set_delete (vty, vty->index, "metric", argv[0]);
+ return rip_route_set_delete (vty, vty->index, "metric", argv[3]->arg);
}
ALIAS (no_set_metric,
@@ -1038,7 +1014,7 @@ DEFUN (set_ip_nexthop,
union sockunion su;
int ret;
- ret = str2sockunion (argv[0], &su);
+ ret = str2sockunion (argv[3]->arg, &su);
if (ret < 0)
{
vty_out (vty, "%% Malformed next-hop address%s", VTY_NEWLINE);
@@ -1052,7 +1028,7 @@ DEFUN (set_ip_nexthop,
return CMD_WARNING;
}
- return rip_route_set_add (vty, vty->index, "ip next-hop", argv[0]);
+ return rip_route_set_add (vty, vty->index, "ip next-hop", argv[3]->arg);
}
DEFUN (no_set_ip_nexthop,
@@ -1063,10 +1039,7 @@ DEFUN (no_set_ip_nexthop,
IP_STR
"Next hop address\n")
{
- if (argc == 0)
- return rip_route_set_delete (vty, vty->index, "ip next-hop", NULL);
-
- return rip_route_set_delete (vty, vty->index, "ip next-hop", argv[0]);
+ return rip_route_set_delete (vty, vty->index, "ip next-hop", argv[4]->arg);
}
ALIAS (no_set_ip_nexthop,
@@ -1085,7 +1058,7 @@ DEFUN (set_tag,
"Tag value for routing protocol\n"
"Tag value\n")
{
- return rip_route_set_add (vty, vty->index, "tag", argv[0]);
+ return rip_route_set_add (vty, vty->index, "tag", argv[2]->arg);
}
DEFUN (no_set_tag,
@@ -1095,10 +1068,7 @@ DEFUN (no_set_tag,
SET_STR
"Tag value for routing protocol\n")
{
- if (argc == 0)
- return rip_route_set_delete (vty, vty->index, "tag", NULL);
-
- return rip_route_set_delete (vty, vty->index, "tag", argv[0]);
+ return rip_route_set_delete (vty, vty->index, "tag", argv[3]->arg);
}
ALIAS (no_set_tag,
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index 6ca27d01d..4ede048f9 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -367,7 +367,7 @@ DEFUN (rip_redistribute_type,
for(i = 0; redist_type[i].str; i++)
{
- if (strncmp (redist_type[i].str, argv[0],
+ if (strncmp (redist_type[i].str, argv[2]->arg,
redist_type[i].str_min_len) == 0)
{
zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient,
@@ -376,7 +376,7 @@ DEFUN (rip_redistribute_type,
}
}
- vty_out(vty, "Invalid type %s%s", argv[0],
+ vty_out(vty, "Invalid type %s%s", argv[2]->arg,
VTY_NEWLINE);
return CMD_WARNING;
@@ -393,7 +393,7 @@ DEFUN (no_rip_redistribute_type,
for (i = 0; redist_type[i].str; i++)
{
- if (strncmp(redist_type[i].str, argv[0],
+ if (strncmp(redist_type[i].str, argv[3]->arg,
redist_type[i].str_min_len) == 0)
{
rip_metric_unset (redist_type[i].type, DONT_CARE_METRIC_RIP);
@@ -403,7 +403,7 @@ DEFUN (no_rip_redistribute_type,
}
}
- vty_out(vty, "Invalid type %s%s", argv[0],
+ vty_out(vty, "Invalid type %s%s", argv[3]->arg,
VTY_NEWLINE);
return CMD_WARNING;
@@ -420,17 +420,17 @@ DEFUN (rip_redistribute_type_routemap,
int i;
for (i = 0; redist_type[i].str; i++) {
- if (strncmp(redist_type[i].str, argv[0],
+ if (strncmp(redist_type[i].str, argv[1]->arg,
redist_type[i].str_min_len) == 0)
{
- rip_routemap_set (redist_type[i].type, argv[1]);
+ rip_routemap_set (redist_type[i].type, argv[3]->arg);
zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, AFI_IP,
redist_type[i].type, 0, VRF_DEFAULT);
return CMD_SUCCESS;
}
}
- vty_out(vty, "Invalid type %s%s", argv[0],
+ vty_out(vty, "Invalid type %s%s", argv[1]->arg,
VTY_NEWLINE);
return CMD_WARNING;
@@ -449,17 +449,17 @@ DEFUN (no_rip_redistribute_type_routemap,
for (i = 0; redist_type[i].str; i++)
{
- if (strncmp(redist_type[i].str, argv[0],
+ if (strncmp(redist_type[i].str, argv[2]->arg,
redist_type[i].str_min_len) == 0)
{
- if (rip_routemap_unset (redist_type[i].type,argv[1]))
+ if (rip_routemap_unset (redist_type[i].type,argv[4]->arg))
return CMD_WARNING;
rip_redistribute_unset (redist_type[i].type);
return CMD_SUCCESS;
}
}
- vty_out(vty, "Invalid type %s%s", argv[0],
+ vty_out(vty, "Invalid type %s%s", argv[2]->arg,
VTY_NEWLINE);
return CMD_WARNING;
@@ -476,10 +476,10 @@ DEFUN (rip_redistribute_type_metric,
int i;
int metric;
- metric = atoi (argv[1]);
+ metric = atoi (argv[3]->arg);
for (i = 0; redist_type[i].str; i++) {
- if (strncmp(redist_type[i].str, argv[0],
+ if (strncmp(redist_type[i].str, argv[1]->arg,
redist_type[i].str_min_len) == 0)
{
rip_redistribute_metric_set (redist_type[i].type, metric);
@@ -489,7 +489,7 @@ DEFUN (rip_redistribute_type_metric,
}
}
- vty_out(vty, "Invalid type %s%s", argv[0],
+ vty_out(vty, "Invalid type %s%s", argv[1]->arg,
VTY_NEWLINE);
return CMD_WARNING;
@@ -508,17 +508,17 @@ DEFUN (no_rip_redistribute_type_metric,
for (i = 0; redist_type[i].str; i++)
{
- if (strncmp(redist_type[i].str, argv[0],
+ if (strncmp(redist_type[i].str, argv[2]->arg,
redist_type[i].str_min_len) == 0)
{
- if (rip_metric_unset (redist_type[i].type, atoi(argv[1])))
+ if (rip_metric_unset (redist_type[i].type, atoi(argv[4]->arg)))
return CMD_WARNING;
rip_redistribute_unset (redist_type[i].type);
return CMD_SUCCESS;
}
}
- vty_out(vty, "Invalid type %s%s", argv[0],
+ vty_out(vty, "Invalid type %s%s", argv[2]->arg,
VTY_NEWLINE);
return CMD_WARNING;
@@ -537,21 +537,21 @@ DEFUN (rip_redistribute_type_metric_routemap,
int i;
int metric;
- metric = atoi (argv[1]);
+ metric = atoi (argv[3]->arg);
for (i = 0; redist_type[i].str; i++) {
- if (strncmp(redist_type[i].str, argv[0],
+ if (strncmp(redist_type[i].str, argv[1]->arg,
redist_type[i].str_min_len) == 0)
{
rip_redistribute_metric_set (redist_type[i].type, metric);
- rip_routemap_set (redist_type[i].type, argv[2]);
+ rip_routemap_set (redist_type[i].type, argv[5]->arg);
zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, AFI_IP,
redist_type[i].type, 0, VRF_DEFAULT);
return CMD_SUCCESS;
}
}
- vty_out(vty, "Invalid type %s%s", argv[0],
+ vty_out(vty, "Invalid type %s%s", argv[1]->arg,
VTY_NEWLINE);
return CMD_WARNING;
@@ -560,8 +560,7 @@ DEFUN (rip_redistribute_type_metric_routemap,
DEFUN (no_rip_redistribute_type_metric_routemap,
no_rip_redistribute_type_metric_routemap_cmd,
- "no redistribute " QUAGGA_REDIST_STR_RIPD
- " metric <0-16> route-map WORD",
+ "no redistribute " QUAGGA_REDIST_STR_RIPD " metric <0-16> route-map WORD",
NO_STR
REDIST_STR
QUAGGA_REDIST_HELP_STR_RIPD
@@ -574,14 +573,14 @@ DEFUN (no_rip_redistribute_type_metric_routemap,
for (i = 0; redist_type[i].str; i++)
{
- if (strncmp(redist_type[i].str, argv[0],
+ if (strncmp(redist_type[i].str, argv[2]->arg,
redist_type[i].str_min_len) == 0)
{
- if (rip_metric_unset (redist_type[i].type, atoi(argv[1])))
+ if (rip_metric_unset (redist_type[i].type, atoi(argv[4]->arg)))
return CMD_WARNING;
- if (rip_routemap_unset (redist_type[i].type, argv[2]))
+ if (rip_routemap_unset (redist_type[i].type, argv[6]->arg))
{
- rip_redistribute_metric_set(redist_type[i].type, atoi(argv[1]));
+ rip_redistribute_metric_set(redist_type[i].type, atoi(argv[4]->arg));
return CMD_WARNING;
}
rip_redistribute_unset (redist_type[i].type);
@@ -589,7 +588,7 @@ DEFUN (no_rip_redistribute_type_metric_routemap,
}
}
- vty_out(vty, "Invalid type %s%s", argv[0],
+ vty_out(vty, "Invalid type %s%s", argv[2]->arg,
VTY_NEWLINE);
return CMD_WARNING;
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 3a8cd80e7..3446bb579 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -2949,7 +2949,7 @@ DEFUN (rip_version,
{
int version;
- version = atoi (argv[0]);
+ version = atoi (argv[1]->arg);
if (version != RIPv1 && version != RIPv2)
{
vty_out (vty, "invalid rip version %d%s", version,
@@ -2992,7 +2992,7 @@ DEFUN (rip_route,
struct prefix_ipv4 p;
struct route_node *node;
- ret = str2prefix_ipv4 (argv[0], &p);
+ ret = str2prefix_ipv4 (argv[1]->arg, &p);
if (ret < 0)
{
vty_out (vty, "Malformed address%s", VTY_NEWLINE);
@@ -3028,7 +3028,7 @@ DEFUN (no_rip_route,
struct prefix_ipv4 p;
struct route_node *node;
- ret = str2prefix_ipv4 (argv[0], &p);
+ ret = str2prefix_ipv4 (argv[2]->arg, &p);
if (ret < 0)
{
vty_out (vty, "Malformed address%s", VTY_NEWLINE);
@@ -3040,7 +3040,7 @@ DEFUN (no_rip_route,
node = route_node_lookup (rip->route, (struct prefix *) &p);
if (! node)
{
- vty_out (vty, "Can't find route %s.%s", argv[0],
+ vty_out (vty, "Can't find route %s.%s", argv[2]->arg,
VTY_NEWLINE);
return CMD_WARNING;
}
@@ -3079,7 +3079,7 @@ DEFUN (rip_default_metric,
{
if (rip)
{
- rip->default_metric = atoi (argv[0]);
+ rip->default_metric = atoi (argv[1]->arg);
/* rip_update_default_metric (); */
}
return CMD_SUCCESS;
@@ -3123,21 +3123,21 @@ DEFUN (rip_timers,
unsigned long RIP_TIMER_MAX = 2147483647;
unsigned long RIP_TIMER_MIN = 5;
- update = strtoul (argv[0], &endptr, 10);
+ update = strtoul (argv[2]->arg, &endptr, 10);
if (update > RIP_TIMER_MAX || update < RIP_TIMER_MIN || *endptr != '\0')
{
vty_out (vty, "update timer value error%s", VTY_NEWLINE);
return CMD_WARNING;
}
- timeout = strtoul (argv[1], &endptr, 10);
+ timeout = strtoul (argv[3]->arg, &endptr, 10);
if (timeout > RIP_TIMER_MAX || timeout < RIP_TIMER_MIN || *endptr != '\0')
{
vty_out (vty, "timeout timer value error%s", VTY_NEWLINE);
return CMD_WARNING;
}
- garbage = strtoul (argv[2], &endptr, 10);
+ garbage = strtoul (argv[4]->arg, &endptr, 10);
if (garbage > RIP_TIMER_MAX || garbage < RIP_TIMER_MIN || *endptr != '\0')
{
vty_out (vty, "garbage timer value error%s", VTY_NEWLINE);
@@ -3386,7 +3386,7 @@ DEFUN (rip_distance,
"Administrative distance\n"
"Distance value\n")
{
- rip->distance = atoi (argv[0]);
+ rip->distance = atoi (argv[1]->arg);
return CMD_SUCCESS;
}
@@ -3408,7 +3408,7 @@ DEFUN (rip_distance_source,
"Distance value\n"
"IP source prefix\n")
{
- rip_distance_set (vty, argv[0], argv[1], NULL);
+ rip_distance_set (vty, argv[1]->arg, argv[2]->arg, NULL);
return CMD_SUCCESS;
}
@@ -3420,7 +3420,7 @@ DEFUN (no_rip_distance_source,
"Distance value\n"
"IP source prefix\n")
{
- rip_distance_unset (vty, argv[0], argv[1], NULL);
+ rip_distance_unset (vty, argv[2]->arg, argv[3]->arg, NULL);
return CMD_SUCCESS;
}
@@ -3432,7 +3432,7 @@ DEFUN (rip_distance_source_access_list,
"IP source prefix\n"
"Access list name\n")
{
- rip_distance_set (vty, argv[0], argv[1], argv[2]);
+ rip_distance_set (vty, argv[1]->arg, argv[2]->arg, argv[3]->arg);
return CMD_SUCCESS;
}
@@ -3445,7 +3445,7 @@ DEFUN (no_rip_distance_source_access_list,
"IP source prefix\n"
"Access list name\n")
{
- rip_distance_unset (vty, argv[0], argv[1], argv[2]);
+ rip_distance_unset (vty, argv[2]->arg, argv[3]->arg, argv[4]->arg);
return CMD_SUCCESS;
}