Skip to content

Commit

Permalink
Revert "ripd: Fixup code to work under new way"
Browse files Browse the repository at this point in the history
This reverts commit 224a3ed.
  • Loading branch information
Daniel Walton committed Sep 22, 2016
1 parent 66c1ec0 commit 3081447
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 90 deletions.
12 changes: 6 additions & 6 deletions ripd/rip_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ DEFUN (debug_rip_packet_direct,
"RIP send packet\n")
{
rip_debug_packet |= RIP_DEBUG_PACKET;
if (strncmp ("send", argv[0]->arg, strlen (argv[0]->arg)) == 0)
if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
rip_debug_packet |= RIP_DEBUG_SEND;
if (strncmp ("recv", argv[0]->arg, strlen (argv[0]->arg)) == 0)
if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
rip_debug_packet |= RIP_DEBUG_RECV;
return CMD_SUCCESS;
}
Expand All @@ -118,9 +118,9 @@ DEFUN_DEPRECATED (debug_rip_packet_detail,
"Detailed information display\n")
{
rip_debug_packet |= RIP_DEBUG_PACKET;
if (strncmp ("send", argv[0]->arg, strlen (argv[0]->arg)) == 0)
if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
rip_debug_packet |= RIP_DEBUG_SEND;
if (strncmp ("recv", argv[0]->arg, strlen (argv[0]->arg)) == 0)
if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
rip_debug_packet |= RIP_DEBUG_RECV;
return CMD_SUCCESS;
}
Expand Down Expand Up @@ -170,14 +170,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]->arg, strlen (argv[0]->arg)) == 0)
if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
{
if (IS_RIP_DEBUG_RECV)
rip_debug_packet &= ~RIP_DEBUG_SEND;
else
rip_debug_packet = 0;
}
else if (strncmp ("recv", argv[0]->arg, strlen (argv[0]->arg)) == 0)
else if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
{
if (IS_RIP_DEBUG_SEND)
rip_debug_packet &= ~RIP_DEBUG_RECV;
Expand Down
42 changes: 21 additions & 21 deletions ripd/rip_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,16 +1228,16 @@ DEFUN (rip_network,
int ret;
struct prefix_ipv4 p;

ret = str2prefix_ipv4 (argv[0]->arg, &p);
ret = str2prefix_ipv4 (argv[0], &p);

if (ret)
ret = rip_enable_network_add ((struct prefix *) &p);
else
ret = rip_enable_if_add (argv[0]->arg);
ret = rip_enable_if_add (argv[0]);

if (ret < 0)
{
vty_out (vty, "There is a same network configuration %s%s", argv[0]->arg,
vty_out (vty, "There is a same network configuration %s%s", argv[0],
VTY_NEWLINE);
return CMD_WARNING;
}
Expand All @@ -1257,16 +1257,16 @@ DEFUN (no_rip_network,
int ret;
struct prefix_ipv4 p;

ret = str2prefix_ipv4 (argv[0]->arg, &p);
ret = str2prefix_ipv4 (argv[0], &p);

if (ret)
ret = rip_enable_network_delete ((struct prefix *) &p);
else
ret = rip_enable_if_delete (argv[0]->arg);
ret = rip_enable_if_delete (argv[0]);

if (ret < 0)
{
vty_out (vty, "Can't find network configuration %s%s", argv[0]->arg,
vty_out (vty, "Can't find network configuration %s%s", argv[0],
VTY_NEWLINE);
return CMD_WARNING;
}
Expand All @@ -1284,7 +1284,7 @@ DEFUN (rip_neighbor,
int ret;
struct prefix_ipv4 p;

ret = str2prefix_ipv4 (argv[0]->arg, &p);
ret = str2prefix_ipv4 (argv[0], &p);

if (ret <= 0)
{
Expand All @@ -1308,7 +1308,7 @@ DEFUN (no_rip_neighbor,
int ret;
struct prefix_ipv4 p;

ret = str2prefix_ipv4 (argv[0]->arg, &p);
ret = str2prefix_ipv4 (argv[0], &p);

if (ret <= 0)
{
Expand Down Expand Up @@ -1338,12 +1338,12 @@ DEFUN (ip_rip_receive_version,
ri = ifp->info;

/* Version 1. */
if (atoi (argv[0]->arg) == 1)
if (atoi (argv[0]) == 1)
{
ri->ri_receive = RI_RIP_VERSION_1;
return CMD_SUCCESS;
}
if (atoi (argv[0]->arg) == 2)
if (atoi (argv[0]) == 2)
{
ri->ri_receive = RI_RIP_VERSION_2;
return CMD_SUCCESS;
Expand Down Expand Up @@ -1440,12 +1440,12 @@ DEFUN (ip_rip_send_version,
ri = ifp->info;

/* Version 1. */
if (atoi (argv[0]->arg) == 1)
if (atoi (argv[0]) == 1)
{
ri->ri_send = RI_RIP_VERSION_1;
return CMD_SUCCESS;
}
if (atoi (argv[0]->arg) == 2)
if (atoi (argv[0]) == 2)
{
ri->ri_send = RI_RIP_VERSION_2;
return CMD_SUCCESS;
Expand Down Expand Up @@ -1548,9 +1548,9 @@ DEFUN (ip_rip_authentication_mode,
return CMD_WARNING;
}

if (strncmp ("md5", argv[0]->arg, strlen (argv[0]->arg)) == 0)
if (strncmp ("md5", argv[0], strlen (argv[0])) == 0)
auth_type = RIP_AUTH_MD5;
else if (strncmp ("text", argv[0]->arg, strlen (argv[0]->arg)) == 0)
else if (strncmp ("text", argv[0], strlen (argv[0])) == 0)
auth_type = RIP_AUTH_SIMPLE_PASSWORD;
else
{
Expand All @@ -1570,9 +1570,9 @@ DEFUN (ip_rip_authentication_mode,
return CMD_WARNING;
}

if (strncmp ("r", argv[1]->arg, 1) == 0)
if (strncmp ("r", argv[1], 1) == 0)
ri->md5_auth_len = RIP_AUTH_MD5_SIZE;
else if (strncmp ("o", argv[1]->arg, 1) == 0)
else if (strncmp ("o", argv[1], 1) == 0)
ri->md5_auth_len = RIP_AUTH_MD5_COMPAT_SIZE;
else
return CMD_WARNING;
Expand Down Expand Up @@ -1656,7 +1656,7 @@ DEFUN (ip_rip_authentication_string,
ifp = (struct interface *)vty->index;
ri = ifp->info;

if (strlen (argv[0]->arg) > 16)
if (strlen (argv[0]) > 16)
{
vty_out (vty, "%% RIPv2 authentication string must be shorter than 16%s",
VTY_NEWLINE);
Expand All @@ -1672,7 +1672,7 @@ DEFUN (ip_rip_authentication_string,
if (ri->auth_str)
free (ri->auth_str);

ri->auth_str = strdup (argv[0]->arg);
ri->auth_str = strdup (argv[0]);

return CMD_SUCCESS;
}
Expand Down Expand Up @@ -1735,7 +1735,7 @@ DEFUN (ip_rip_authentication_key_chain,
if (ri->key_chain)
free (ri->key_chain);

ri->key_chain = strdup (argv[0]->arg);
ri->key_chain = strdup (argv[0]);

return CMD_SUCCESS;
}
Expand Down Expand Up @@ -1867,7 +1867,7 @@ DEFUN (rip_passive_interface,
"Interface name\n"
"default for all interfaces\n")
{
const char *ifname = argv[0]->arg;
const char *ifname = argv[0];

if (!strcmp(ifname,"default")) {
passive_default = 1;
Expand All @@ -1888,7 +1888,7 @@ DEFUN (no_rip_passive_interface,
"Interface name\n"
"default for all interfaces\n")
{
const char *ifname = argv[0]->arg;
const char *ifname = argv[0];

if (!strcmp(ifname,"default")) {
passive_default = 0;
Expand Down
8 changes: 4 additions & 4 deletions ripd/rip_offset.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ DEFUN (rip_offset_list,
"For outgoing updates\n"
"Metric value\n")
{
return rip_offset_list_set (vty, argv[0]->arg, argv[1]->arg, argv[2]->arg, NULL);
return rip_offset_list_set (vty, argv[0], argv[1], argv[2], NULL);
}

DEFUN (rip_offset_list_ifname,
Expand All @@ -302,7 +302,7 @@ DEFUN (rip_offset_list_ifname,
"Metric value\n"
"Interface to match\n")
{
return rip_offset_list_set (vty, argv[0]->arg, argv[1]->arg, argv[2]->arg, argv[3]->arg);
return rip_offset_list_set (vty, argv[0], argv[1], argv[2], argv[3]);
}

DEFUN (no_rip_offset_list,
Expand All @@ -315,7 +315,7 @@ DEFUN (no_rip_offset_list,
"For outgoing updates\n"
"Metric value\n")
{
return rip_offset_list_unset (vty, argv[0]->arg, argv[1]->arg, argv[2]->arg, NULL);
return rip_offset_list_unset (vty, argv[0], argv[1], argv[2], NULL);
}

DEFUN (no_rip_offset_list_ifname,
Expand All @@ -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]->arg, argv[1]->arg, argv[2]->arg, argv[3]->arg);
return rip_offset_list_unset (vty, argv[0], argv[1], argv[2], argv[3]);
}

static int
Expand Down
Loading

0 comments on commit 3081447

Please sign in to comment.