mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 16:49:11 +00:00
Revert "zebra: Fixup to use the new parser"
This reverts commit 5c94274ff7
.
This commit is contained in:
parent
5cee71fb64
commit
ed5c254baf
@ -131,11 +131,11 @@ DEFUN (debug_zebra_packet_direct,
|
||||
"Debug option set for send packet\n")
|
||||
{
|
||||
zebra_debug_packet = ZEBRA_DEBUG_PACKET;
|
||||
if (strncmp ("send", argv[0]->arg, strlen (argv[0]->arg)) == 0)
|
||||
if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
|
||||
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
|
||||
if (strncmp ("recv", argv[0]->arg, strlen (argv[0]->arg)) == 0)
|
||||
if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
|
||||
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
|
||||
if (strncmp ("detail", argv[0]->arg, strlen (argv[0]->arg)) == 0)
|
||||
if (strncmp ("detail", argv[0], strlen (argv[0])) == 0)
|
||||
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
@ -151,9 +151,9 @@ DEFUN (debug_zebra_packet_detail,
|
||||
"Debug option set detailed information\n")
|
||||
{
|
||||
zebra_debug_packet = ZEBRA_DEBUG_PACKET;
|
||||
if (strncmp ("send", argv[0]->arg, strlen (argv[0]->arg)) == 0)
|
||||
if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
|
||||
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
|
||||
if (strncmp ("recv", argv[0]->arg, strlen (argv[0]->arg)) == 0)
|
||||
if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
|
||||
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
|
||||
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
|
||||
return CMD_SUCCESS;
|
||||
@ -180,9 +180,9 @@ DEFUN (debug_zebra_kernel_msgdump,
|
||||
"Dump raw netlink messages received\n"
|
||||
"Dump raw netlink messages sent\n")
|
||||
{
|
||||
if (!argv[1]->arg || (argv[0]->arg && strncmp(argv[0]->arg, "recv", strlen(argv[0]->arg)) == 0))
|
||||
if (!argv[1] || (argv[0] && strncmp(argv[0], "recv", strlen(argv[0])) == 0))
|
||||
SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV);
|
||||
if (!argv[0]->arg || (argv[1]->arg && strncmp(argv[1]->arg, "send", strlen(argv[1]->arg)) == 0))
|
||||
if (!argv[0] || (argv[1] && strncmp(argv[1], "send", strlen(argv[1])) == 0))
|
||||
SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
@ -267,9 +267,9 @@ DEFUN (no_debug_zebra_packet_direct,
|
||||
"Debug option set for receive packet\n"
|
||||
"Debug 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)
|
||||
UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
|
||||
if (strncmp ("recv", argv[0]->arg, strlen (argv[0]->arg)) == 0)
|
||||
if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
|
||||
UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
@ -296,9 +296,9 @@ DEFUN (no_debug_zebra_kernel_msgdump,
|
||||
"Dump raw netlink messages received\n"
|
||||
"Dump raw netlink messages sent\n")
|
||||
{
|
||||
if (!argv[1]->arg || (argv[0]->arg && strncmp(argv[0]->arg, "recv", strlen(argv[0]->arg)) == 0))
|
||||
if (!argv[1] || (argv[0] && strncmp(argv[0], "recv", strlen(argv[0])) == 0))
|
||||
UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV);
|
||||
if (!argv[0]->arg || (argv[1]->arg && strncmp(argv[1]->arg, "send", strlen(argv[1]->arg)) == 0))
|
||||
if (!argv[0] || (argv[1] && strncmp(argv[1], "send", strlen(argv[1])) == 0))
|
||||
UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
@ -1317,7 +1317,7 @@ DEFUN (show_interface, show_interface_cmd,
|
||||
interface_update_stats ();
|
||||
|
||||
if (argc > 0)
|
||||
VRF_GET_ID (vrf_id, argv[0]->arg);
|
||||
VRF_GET_ID (vrf_id, argv[0]);
|
||||
|
||||
/* All interface print. */
|
||||
for (ALL_LIST_ELEMENTS_RO (vrf_iflist (vrf_id), node, ifp))
|
||||
@ -1370,13 +1370,13 @@ DEFUN (show_interface_name_vrf,
|
||||
interface_update_stats ();
|
||||
|
||||
if (argc > 1)
|
||||
VRF_GET_ID (vrf_id, argv[1]->arg);
|
||||
VRF_GET_ID (vrf_id, argv[1]);
|
||||
|
||||
/* Specified interface print. */
|
||||
ifp = if_lookup_by_name_vrf (argv[0]->arg, vrf_id);
|
||||
ifp = if_lookup_by_name_vrf (argv[0], vrf_id);
|
||||
if (ifp == NULL)
|
||||
{
|
||||
vty_out (vty, "%% Can't find interface %s%s", argv[0]->arg,
|
||||
vty_out (vty, "%% Can't find interface %s%s", argv[0],
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
@ -1403,7 +1403,7 @@ DEFUN (show_interface_name_vrf_all, show_interface_name_vrf_all_cmd,
|
||||
for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
|
||||
{
|
||||
/* Specified interface print. */
|
||||
ifp = if_lookup_by_name_vrf (argv[0]->arg, vrf_iter2id (iter));
|
||||
ifp = if_lookup_by_name_vrf (argv[0], vrf_iter2id (iter));
|
||||
if (ifp)
|
||||
{
|
||||
if_dump_vty (vty, ifp);
|
||||
@ -1413,7 +1413,7 @@ DEFUN (show_interface_name_vrf_all, show_interface_name_vrf_all_cmd,
|
||||
|
||||
if (!found)
|
||||
{
|
||||
vty_out (vty, "%% Can't find interface %s%s", argv[0]->arg, VTY_NEWLINE);
|
||||
vty_out (vty, "%% Can't find interface %s%s", argv[0], VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
@ -1476,7 +1476,7 @@ DEFUN (show_interface_desc,
|
||||
vrf_id_t vrf_id = VRF_DEFAULT;
|
||||
|
||||
if (argc > 0)
|
||||
VRF_GET_ID (vrf_id, argv[0]->arg);
|
||||
VRF_GET_ID (vrf_id, argv[0]);
|
||||
|
||||
if_show_description (vty, vrf_id);
|
||||
|
||||
@ -1679,7 +1679,7 @@ DEFUN (bandwidth_if,
|
||||
unsigned int bandwidth;
|
||||
|
||||
ifp = (struct interface *) vty->index;
|
||||
bandwidth = strtol(argv[0]->arg, NULL, 10);
|
||||
bandwidth = strtol(argv[0], NULL, 10);
|
||||
|
||||
/* bandwidth range is <1-100000> */
|
||||
if (bandwidth < 1 || bandwidth > 100000)
|
||||
@ -1843,7 +1843,7 @@ DEFUN (link_params_metric,
|
||||
struct if_link_params *iflp = if_link_params_get (ifp);
|
||||
u_int32_t metric;
|
||||
|
||||
VTY_GET_ULONG("metric", metric, argv[0]->arg);
|
||||
VTY_GET_ULONG("metric", metric, argv[0]);
|
||||
|
||||
/* Update TE metric if needed */
|
||||
link_param_cmd_set_uint32 (ifp, &iflp->te_metric, LP_TE, metric);
|
||||
@ -1876,7 +1876,7 @@ DEFUN (link_params_maxbw,
|
||||
|
||||
float bw;
|
||||
|
||||
if (sscanf (argv[0]->arg, "%g", &bw) != 1)
|
||||
if (sscanf (argv[0], "%g", &bw) != 1)
|
||||
{
|
||||
vty_out (vty, "link_params_maxbw: fscanf: %s%s", safe_strerror (errno),
|
||||
VTY_NEWLINE);
|
||||
@ -1919,7 +1919,7 @@ DEFUN (link_params_max_rsv_bw,
|
||||
struct if_link_params *iflp = if_link_params_get (ifp);
|
||||
float bw;
|
||||
|
||||
if (sscanf (argv[0]->arg, "%g", &bw) != 1)
|
||||
if (sscanf (argv[0], "%g", &bw) != 1)
|
||||
{
|
||||
vty_out (vty, "link_params_max_rsv_bw: fscanf: %s%s", safe_strerror (errno),
|
||||
VTY_NEWLINE);
|
||||
@ -1954,14 +1954,14 @@ DEFUN (link_params_unrsv_bw,
|
||||
float bw;
|
||||
|
||||
/* We don't have to consider about range check here. */
|
||||
if (sscanf (argv[0]->arg, "%d", &priority) != 1)
|
||||
if (sscanf (argv[0], "%d", &priority) != 1)
|
||||
{
|
||||
vty_out (vty, "link_params_unrsv_bw: fscanf: %s%s", safe_strerror (errno),
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
if (sscanf (argv[1]->arg, "%g", &bw) != 1)
|
||||
if (sscanf (argv[1], "%g", &bw) != 1)
|
||||
{
|
||||
vty_out (vty, "link_params_unrsv_bw: fscanf: %s%s", safe_strerror (errno),
|
||||
VTY_NEWLINE);
|
||||
@ -1993,7 +1993,7 @@ DEFUN (link_params_admin_grp,
|
||||
struct if_link_params *iflp = if_link_params_get (ifp);
|
||||
unsigned long value;
|
||||
|
||||
if (sscanf (argv[0]->arg, "0x%lx", &value) != 1)
|
||||
if (sscanf (argv[0], "0x%lx", &value) != 1)
|
||||
{
|
||||
vty_out (vty, "link_params_admin_grp: fscanf: %s%s",
|
||||
safe_strerror (errno), VTY_NEWLINE);
|
||||
@ -2035,13 +2035,13 @@ DEFUN (link_params_inter_as,
|
||||
struct in_addr addr;
|
||||
u_int32_t as;
|
||||
|
||||
if (!inet_aton (argv[0]->arg, &addr))
|
||||
if (!inet_aton (argv[0], &addr))
|
||||
{
|
||||
vty_out (vty, "Please specify Router-Addr by A.B.C.D%s", VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
VTY_GET_ULONG("AS number", as, argv[1]->arg);
|
||||
VTY_GET_ULONG("AS number", as, argv[1]);
|
||||
|
||||
/* Update Remote IP and Remote AS fields if needed */
|
||||
if (IS_PARAM_UNSET(iflp, LP_RMT_AS)
|
||||
@ -2096,7 +2096,7 @@ DEFUN (link_params_delay,
|
||||
u_int8_t update = 0;
|
||||
|
||||
/* Get and Check new delay values */
|
||||
VTY_GET_ULONG("delay", delay, argv[0]->arg);
|
||||
VTY_GET_ULONG("delay", delay, argv[0]);
|
||||
switch (argc)
|
||||
{
|
||||
case 1:
|
||||
@ -2130,8 +2130,8 @@ DEFUN (link_params_delay,
|
||||
return CMD_WARNING;
|
||||
break;
|
||||
case 3:
|
||||
VTY_GET_ULONG("minimum delay", low, argv[1]->arg);
|
||||
VTY_GET_ULONG("maximum delay", high, argv[2]->arg);
|
||||
VTY_GET_ULONG("minimum delay", low, argv[1]);
|
||||
VTY_GET_ULONG("maximum delay", high, argv[2]);
|
||||
/* Check new delays value coherency */
|
||||
if (delay <= low || delay >= high)
|
||||
{
|
||||
@ -2209,7 +2209,7 @@ DEFUN (link_params_delay_var,
|
||||
struct if_link_params *iflp = if_link_params_get (ifp);
|
||||
u_int32_t value;
|
||||
|
||||
VTY_GET_ULONG("delay variation", value, argv[0]->arg);
|
||||
VTY_GET_ULONG("delay variation", value, argv[0]);
|
||||
|
||||
/* Update Delay Variation if needed */
|
||||
link_param_cmd_set_uint32 (ifp, &iflp->delay_var, LP_DELAY_VAR, value);
|
||||
@ -2241,7 +2241,7 @@ DEFUN (link_params_pkt_loss,
|
||||
struct if_link_params *iflp = if_link_params_get (ifp);
|
||||
float fval;
|
||||
|
||||
if (sscanf (argv[0]->arg, "%g", &fval) != 1)
|
||||
if (sscanf (argv[0], "%g", &fval) != 1)
|
||||
{
|
||||
vty_out (vty, "link_params_pkt_loss: fscanf: %s%s", safe_strerror (errno),
|
||||
VTY_NEWLINE);
|
||||
@ -2281,7 +2281,7 @@ DEFUN (link_params_res_bw,
|
||||
struct if_link_params *iflp = if_link_params_get (ifp);
|
||||
float bw;
|
||||
|
||||
if (sscanf (argv[0]->arg, "%g", &bw) != 1)
|
||||
if (sscanf (argv[0], "%g", &bw) != 1)
|
||||
{
|
||||
vty_out (vty, "link_params_res_bw: fscanf: %s%s", safe_strerror (errno),
|
||||
VTY_NEWLINE);
|
||||
@ -2327,7 +2327,7 @@ DEFUN (link_params_ava_bw,
|
||||
struct if_link_params *iflp = if_link_params_get (ifp);
|
||||
float bw;
|
||||
|
||||
if (sscanf (argv[0]->arg, "%g", &bw) != 1)
|
||||
if (sscanf (argv[0], "%g", &bw) != 1)
|
||||
{
|
||||
vty_out (vty, "link_params_ava_bw: fscanf: %s%s", safe_strerror (errno),
|
||||
VTY_NEWLINE);
|
||||
@ -2373,7 +2373,7 @@ DEFUN (link_params_use_bw,
|
||||
struct if_link_params *iflp = if_link_params_get (ifp);
|
||||
float bw;
|
||||
|
||||
if (sscanf (argv[0]->arg, "%g", &bw) != 1)
|
||||
if (sscanf (argv[0], "%g", &bw) != 1)
|
||||
{
|
||||
vty_out (vty, "link_params_use_bw: fscanf: %s%s", safe_strerror (errno),
|
||||
VTY_NEWLINE);
|
||||
@ -2557,7 +2557,7 @@ DEFUN (ip_address,
|
||||
"Set the IP address of an interface\n"
|
||||
"IP address (e.g. 10.0.0.1/8)\n")
|
||||
{
|
||||
return ip_address_install (vty, vty->index, argv[0]->arg, NULL, NULL);
|
||||
return ip_address_install (vty, vty->index, argv[0], NULL, NULL);
|
||||
}
|
||||
|
||||
DEFUN (no_ip_address,
|
||||
@ -2568,7 +2568,7 @@ DEFUN (no_ip_address,
|
||||
"Set the IP address of an interface\n"
|
||||
"IP Address (e.g. 10.0.0.1/8)")
|
||||
{
|
||||
return ip_address_uninstall (vty, vty->index, argv[0]->arg, NULL, NULL);
|
||||
return ip_address_uninstall (vty, vty->index, argv[0], NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -2582,7 +2582,7 @@ DEFUN (ip_address_label,
|
||||
"Label of this address\n"
|
||||
"Label\n")
|
||||
{
|
||||
return ip_address_install (vty, vty->index, argv[0]->arg, NULL, argv[1]->arg);
|
||||
return ip_address_install (vty, vty->index, argv[0], NULL, argv[1]);
|
||||
}
|
||||
|
||||
DEFUN (no_ip_address_label,
|
||||
@ -2595,7 +2595,7 @@ DEFUN (no_ip_address_label,
|
||||
"Label of this address\n"
|
||||
"Label\n")
|
||||
{
|
||||
return ip_address_uninstall (vty, vty->index, argv[0]->arg, NULL, argv[1]->arg);
|
||||
return ip_address_uninstall (vty, vty->index, argv[0], NULL, argv[1]);
|
||||
}
|
||||
#endif /* HAVE_NETLINK */
|
||||
|
||||
@ -2758,7 +2758,7 @@ DEFUN (ipv6_address,
|
||||
"Set the IP address of an interface\n"
|
||||
"IPv6 address (e.g. 3ffe:506::1/48)\n")
|
||||
{
|
||||
return ipv6_address_install (vty, vty->index, argv[0]->arg, NULL, NULL, 0);
|
||||
return ipv6_address_install (vty, vty->index, argv[0], NULL, NULL, 0);
|
||||
}
|
||||
|
||||
DEFUN (no_ipv6_address,
|
||||
@ -2769,7 +2769,7 @@ DEFUN (no_ipv6_address,
|
||||
"Set the IP address of an interface\n"
|
||||
"IPv6 address (e.g. 3ffe:506::1/48)\n")
|
||||
{
|
||||
return ipv6_address_uninstall (vty, vty->index, argv[0]->arg, NULL, NULL, 0);
|
||||
return ipv6_address_uninstall (vty, vty->index, argv[0], NULL, NULL, 0);
|
||||
}
|
||||
#endif /* HAVE_IPV6 */
|
||||
|
||||
|
@ -480,7 +480,7 @@ DEFUN (ip_irdp_holdtime,
|
||||
zi=ifp->info;
|
||||
irdp=&zi->irdp;
|
||||
|
||||
irdp->Lifetime = atoi(argv[0]->arg);
|
||||
irdp->Lifetime = atoi(argv[0]);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
@ -503,8 +503,8 @@ DEFUN (ip_irdp_minadvertinterval,
|
||||
zi=ifp->info;
|
||||
irdp=&zi->irdp;
|
||||
|
||||
if( (unsigned) atoi(argv[0]->arg) <= irdp->MaxAdvertInterval) {
|
||||
irdp->MinAdvertInterval = atoi(argv[0]->arg);
|
||||
if( (unsigned) atoi(argv[0]) <= irdp->MaxAdvertInterval) {
|
||||
irdp->MinAdvertInterval = atoi(argv[0]);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
@ -537,8 +537,8 @@ DEFUN (ip_irdp_maxadvertinterval,
|
||||
irdp=&zi->irdp;
|
||||
|
||||
|
||||
if( irdp->MinAdvertInterval <= (unsigned) atoi(argv[0]->arg) ) {
|
||||
irdp->MaxAdvertInterval = atoi(argv[0]->arg);
|
||||
if( irdp->MinAdvertInterval <= (unsigned) atoi(argv[0]) ) {
|
||||
irdp->MaxAdvertInterval = atoi(argv[0]);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
@ -575,7 +575,7 @@ DEFUN (ip_irdp_preference,
|
||||
zi=ifp->info;
|
||||
irdp=&zi->irdp;
|
||||
|
||||
irdp->Preference = atoi(argv[0]->arg);
|
||||
irdp->Preference = atoi(argv[0]);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
@ -605,10 +605,10 @@ DEFUN (ip_irdp_address_preference,
|
||||
zi=ifp->info;
|
||||
irdp=&zi->irdp;
|
||||
|
||||
ret = inet_aton(argv[0]->arg, &ip);
|
||||
ret = inet_aton(argv[0], &ip);
|
||||
if(!ret) return CMD_WARNING;
|
||||
|
||||
pref = atoi(argv[1]->arg);
|
||||
pref = atoi(argv[1]);
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO (irdp->AdvPrefList, node, adv))
|
||||
if(adv->ip.s_addr == ip.s_addr)
|
||||
@ -649,7 +649,7 @@ DEFUN (no_ip_irdp_address_preference,
|
||||
zi=ifp->info;
|
||||
irdp=&zi->irdp;
|
||||
|
||||
ret = inet_aton(argv[0]->arg, &ip);
|
||||
ret = inet_aton(argv[0], &ip);
|
||||
if (!ret)
|
||||
return CMD_WARNING;
|
||||
|
||||
|
@ -223,7 +223,7 @@ DEFUN (router_id,
|
||||
struct prefix rid;
|
||||
vrf_id_t vrf_id = VRF_DEFAULT;
|
||||
|
||||
rid.u.prefix4.s_addr = inet_addr (argv[0]->arg);
|
||||
rid.u.prefix4.s_addr = inet_addr (argv[0]);
|
||||
if (!rid.u.prefix4.s_addr)
|
||||
return CMD_WARNING;
|
||||
|
||||
@ -231,7 +231,7 @@ DEFUN (router_id,
|
||||
rid.family = AF_INET;
|
||||
|
||||
if (argc > 1)
|
||||
VRF_GET_ID (vrf_id, argv[1]->arg);
|
||||
VRF_GET_ID (vrf_id, argv[1]);
|
||||
|
||||
router_id_set (&rid, vrf_id);
|
||||
|
||||
@ -259,7 +259,7 @@ DEFUN (no_router_id,
|
||||
rid.family = AF_INET;
|
||||
|
||||
if (argc > 1)
|
||||
VRF_GET_ID (vrf_id, argv[1]->arg);
|
||||
VRF_GET_ID (vrf_id, argv[1]);
|
||||
|
||||
router_id_set (&rid, vrf_id);
|
||||
|
||||
|
@ -930,7 +930,7 @@ DEFUN (ipv6_nd_ra_interval_msec,
|
||||
struct zebra_ns *zns;
|
||||
|
||||
zns = zvrf->zns;
|
||||
VTY_GET_INTEGER_RANGE ("router advertisement interval", interval, argv[0]->arg, 70, 1800000);
|
||||
VTY_GET_INTEGER_RANGE ("router advertisement interval", interval, argv[0], 70, 1800000);
|
||||
if ((zif->rtadv.AdvDefaultLifetime != -1 && interval > (unsigned)zif->rtadv.AdvDefaultLifetime * 1000))
|
||||
{
|
||||
vty_out (vty, "This ra-interval would conflict with configured ra-lifetime!%s", VTY_NEWLINE);
|
||||
@ -965,7 +965,7 @@ DEFUN (ipv6_nd_ra_interval,
|
||||
struct zebra_ns *zns;
|
||||
|
||||
zns = zvrf->zns;
|
||||
VTY_GET_INTEGER_RANGE ("router advertisement interval", interval, argv[0]->arg, 1, 1800);
|
||||
VTY_GET_INTEGER_RANGE ("router advertisement interval", interval, argv[0], 1, 1800);
|
||||
if ((zif->rtadv.AdvDefaultLifetime != -1 && interval > (unsigned)zif->rtadv.AdvDefaultLifetime))
|
||||
{
|
||||
vty_out (vty, "This ra-interval would conflict with configured ra-lifetime!%s", VTY_NEWLINE);
|
||||
@ -1045,7 +1045,7 @@ DEFUN (ipv6_nd_ra_lifetime,
|
||||
ifp = (struct interface *) vty->index;
|
||||
zif = ifp->info;
|
||||
|
||||
VTY_GET_INTEGER_RANGE ("router lifetime", lifetime, argv[0]->arg, 0, 9000);
|
||||
VTY_GET_INTEGER_RANGE ("router lifetime", lifetime, argv[0], 0, 9000);
|
||||
|
||||
/* The value to be placed in the Router Lifetime field
|
||||
* of Router Advertisements sent from the interface,
|
||||
@ -1100,7 +1100,7 @@ DEFUN (ipv6_nd_reachable_time,
|
||||
{
|
||||
struct interface *ifp = (struct interface *) vty->index;
|
||||
struct zebra_if *zif = ifp->info;
|
||||
VTY_GET_INTEGER_RANGE ("reachable time", zif->rtadv.AdvReachableTime, argv[0]->arg, 1, RTADV_MAX_REACHABLE_TIME);
|
||||
VTY_GET_INTEGER_RANGE ("reachable time", zif->rtadv.AdvReachableTime, argv[0], 1, RTADV_MAX_REACHABLE_TIME);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
@ -1142,7 +1142,7 @@ DEFUN (ipv6_nd_homeagent_preference,
|
||||
{
|
||||
struct interface *ifp = (struct interface *) vty->index;
|
||||
struct zebra_if *zif = ifp->info;
|
||||
VTY_GET_INTEGER_RANGE ("home agent preference", zif->rtadv.HomeAgentPreference, argv[0]->arg, 0, 65535);
|
||||
VTY_GET_INTEGER_RANGE ("home agent preference", zif->rtadv.HomeAgentPreference, argv[0], 0, 65535);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
@ -1184,7 +1184,7 @@ DEFUN (ipv6_nd_homeagent_lifetime,
|
||||
{
|
||||
struct interface *ifp = (struct interface *) vty->index;
|
||||
struct zebra_if *zif = ifp->info;
|
||||
VTY_GET_INTEGER_RANGE ("home agent lifetime", zif->rtadv.HomeAgentLifetime, argv[0]->arg, 0, RTADV_MAX_HALIFETIME);
|
||||
VTY_GET_INTEGER_RANGE ("home agent lifetime", zif->rtadv.HomeAgentLifetime, argv[0], 0, RTADV_MAX_HALIFETIME);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
@ -1390,7 +1390,7 @@ DEFUN (ipv6_nd_prefix,
|
||||
ifp = (struct interface *) vty->index;
|
||||
zebra_if = ifp->info;
|
||||
|
||||
ret = str2prefix_ipv6 (argv[0]->arg, &rp.prefix);
|
||||
ret = str2prefix_ipv6 (argv[0], &rp.prefix);
|
||||
if (!ret)
|
||||
{
|
||||
vty_out (vty, "Malformed IPv6 prefix%s", VTY_NEWLINE);
|
||||
@ -1405,19 +1405,19 @@ DEFUN (ipv6_nd_prefix,
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
if ((isdigit((unsigned char)argv[1]->arg[0]))
|
||||
|| strncmp (argv[1]->arg, "i", 1) == 0)
|
||||
if ((isdigit((unsigned char)argv[1][0]))
|
||||
|| strncmp (argv[1], "i", 1) == 0)
|
||||
{
|
||||
if ( strncmp (argv[1]->arg, "i", 1) == 0)
|
||||
if ( strncmp (argv[1], "i", 1) == 0)
|
||||
rp.AdvValidLifetime = UINT32_MAX;
|
||||
else
|
||||
rp.AdvValidLifetime = (u_int32_t) strtoll (argv[1]->arg,
|
||||
rp.AdvValidLifetime = (u_int32_t) strtoll (argv[1],
|
||||
(char **)NULL, 10);
|
||||
|
||||
if ( strncmp (argv[2]->arg, "i", 1) == 0)
|
||||
if ( strncmp (argv[2], "i", 1) == 0)
|
||||
rp.AdvPreferredLifetime = UINT32_MAX;
|
||||
else
|
||||
rp.AdvPreferredLifetime = (u_int32_t) strtoll (argv[2]->arg,
|
||||
rp.AdvPreferredLifetime = (u_int32_t) strtoll (argv[2],
|
||||
(char **)NULL, 10);
|
||||
|
||||
if (rp.AdvPreferredLifetime > rp.AdvValidLifetime)
|
||||
@ -1431,11 +1431,11 @@ DEFUN (ipv6_nd_prefix,
|
||||
{
|
||||
for (i = cursor; i < argc; i++)
|
||||
{
|
||||
if (strncmp (argv[i]->arg, "of", 2) == 0)
|
||||
if (strncmp (argv[i], "of", 2) == 0)
|
||||
rp.AdvOnLinkFlag = 0;
|
||||
if (strncmp (argv[i]->arg, "no", 2) == 0)
|
||||
if (strncmp (argv[i], "no", 2) == 0)
|
||||
rp.AdvAutonomousFlag = 0;
|
||||
if (strncmp (argv[i]->arg, "ro", 2) == 0)
|
||||
if (strncmp (argv[i], "ro", 2) == 0)
|
||||
rp.AdvRouterAddressFlag = 1;
|
||||
}
|
||||
}
|
||||
@ -1619,7 +1619,7 @@ DEFUN (no_ipv6_nd_prefix,
|
||||
ifp = (struct interface *) vty->index;
|
||||
zebra_if = ifp->info;
|
||||
|
||||
ret = str2prefix_ipv6 (argv[0]->arg, &rp.prefix);
|
||||
ret = str2prefix_ipv6 (argv[0], &rp.prefix);
|
||||
if (!ret)
|
||||
{
|
||||
vty_out (vty, "Malformed IPv6 prefix%s", VTY_NEWLINE);
|
||||
@ -1810,7 +1810,7 @@ DEFUN (ipv6_nd_router_preference,
|
||||
|
||||
while (0 != rtadv_pref_strs[i])
|
||||
{
|
||||
if (strncmp (argv[0]->arg, rtadv_pref_strs[i], 1) == 0)
|
||||
if (strncmp (argv[0], rtadv_pref_strs[i], 1) == 0)
|
||||
{
|
||||
zif->rtadv.DefaultPreference = i;
|
||||
return CMD_SUCCESS;
|
||||
@ -1861,7 +1861,7 @@ DEFUN (ipv6_nd_mtu,
|
||||
{
|
||||
struct interface *ifp = (struct interface *) vty->index;
|
||||
struct zebra_if *zif = ifp->info;
|
||||
VTY_GET_INTEGER_RANGE ("MTU", zif->rtadv.AdvLinkMTU, argv[0]->arg, 1, 65535);
|
||||
VTY_GET_INTEGER_RANGE ("MTU", zif->rtadv.AdvLinkMTU, argv[0], 1, 65535);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ DEFUN (test_interface_state,
|
||||
ifp->flags = IFF_BROADCAST|IFF_MULTICAST;
|
||||
}
|
||||
|
||||
switch (argv[0]->arg[0])
|
||||
switch (argv[0][0])
|
||||
{
|
||||
case 'u':
|
||||
SET_FLAG (ifp->flags, IFF_UP);
|
||||
|
@ -301,7 +301,7 @@ DEFUN (match_interface,
|
||||
"match first hop interface of route\n"
|
||||
"Interface name\n")
|
||||
{
|
||||
return zebra_route_match_add (vty, vty->index, "interface", argv[0]->arg,
|
||||
return zebra_route_match_add (vty, vty->index, "interface", argv[0],
|
||||
RMAP_EVENT_MATCH_ADDED);
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@ DEFUN (no_match_interface,
|
||||
if (argc == 0)
|
||||
return zebra_route_match_delete (vty, vty->index, "interface", NULL, RMAP_EVENT_MATCH_DELETED);
|
||||
|
||||
return zebra_route_match_delete (vty, vty->index, "interface", argv[0]->arg, RMAP_EVENT_MATCH_DELETED);
|
||||
return zebra_route_match_delete (vty, vty->index, "interface", argv[0], RMAP_EVENT_MATCH_DELETED);
|
||||
}
|
||||
|
||||
ALIAS (no_match_interface,
|
||||
@ -333,7 +333,7 @@ DEFUN (match_tag,
|
||||
"Match tag of route\n"
|
||||
"Tag value\n")
|
||||
{
|
||||
return zebra_route_match_add (vty, vty->index, "tag", argv[0]->arg,
|
||||
return zebra_route_match_add (vty, vty->index, "tag", argv[0],
|
||||
RMAP_EVENT_MATCH_ADDED);
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ DEFUN (no_match_tag,
|
||||
return zebra_route_match_delete (vty, vty->index, "tag", NULL,
|
||||
RMAP_EVENT_MATCH_DELETED);
|
||||
|
||||
return zebra_route_match_delete (vty, vty->index, "tag", argv[0]->arg,
|
||||
return zebra_route_match_delete (vty, vty->index, "tag", argv[0],
|
||||
RMAP_EVENT_MATCH_DELETED);
|
||||
}
|
||||
|
||||
@ -369,7 +369,7 @@ DEFUN (match_ip_next_hop,
|
||||
"IP access-list number (expanded range)\n"
|
||||
"IP Access-list name\n")
|
||||
{
|
||||
return zebra_route_match_add (vty, vty->index, "ip next-hop", argv[0]->arg, RMAP_EVENT_FILTER_ADDED);
|
||||
return zebra_route_match_add (vty, vty->index, "ip next-hop", argv[0], RMAP_EVENT_FILTER_ADDED);
|
||||
}
|
||||
|
||||
DEFUN (no_match_ip_next_hop,
|
||||
@ -384,7 +384,7 @@ DEFUN (no_match_ip_next_hop,
|
||||
return zebra_route_match_delete (vty, vty->index, "ip next-hop", NULL,
|
||||
RMAP_EVENT_FILTER_DELETED);
|
||||
|
||||
return zebra_route_match_delete (vty, vty->index, "ip next-hop", argv[0]->arg,
|
||||
return zebra_route_match_delete (vty, vty->index, "ip next-hop", argv[0],
|
||||
RMAP_EVENT_FILTER_DELETED);
|
||||
}
|
||||
|
||||
@ -409,7 +409,7 @@ DEFUN (match_ip_next_hop_prefix_list,
|
||||
"IP prefix-list name\n")
|
||||
{
|
||||
return zebra_route_match_add (vty, vty->index, "ip next-hop prefix-list",
|
||||
argv[0]->arg, RMAP_EVENT_PLIST_ADDED);
|
||||
argv[0], RMAP_EVENT_PLIST_ADDED);
|
||||
}
|
||||
|
||||
DEFUN (no_match_ip_next_hop_prefix_list,
|
||||
@ -427,7 +427,7 @@ DEFUN (no_match_ip_next_hop_prefix_list,
|
||||
RMAP_EVENT_PLIST_DELETED);
|
||||
|
||||
return zebra_route_match_delete (vty, vty->index,
|
||||
"ip next-hop prefix-list", argv[0]->arg,
|
||||
"ip next-hop prefix-list", argv[0],
|
||||
RMAP_EVENT_PLIST_DELETED);
|
||||
}
|
||||
|
||||
@ -452,7 +452,7 @@ DEFUN (match_ip_address,
|
||||
"IP Access-list name\n")
|
||||
|
||||
{
|
||||
return zebra_route_match_add (vty, vty->index, "ip address", argv[0]->arg,
|
||||
return zebra_route_match_add (vty, vty->index, "ip address", argv[0],
|
||||
RMAP_EVENT_FILTER_ADDED);
|
||||
}
|
||||
|
||||
@ -468,7 +468,7 @@ DEFUN (no_match_ip_address,
|
||||
return zebra_route_match_delete (vty, vty->index, "ip address", NULL,
|
||||
RMAP_EVENT_FILTER_DELETED);
|
||||
|
||||
return zebra_route_match_delete (vty, vty->index, "ip address", argv[0]->arg,
|
||||
return zebra_route_match_delete (vty, vty->index, "ip address", argv[0],
|
||||
RMAP_EVENT_FILTER_DELETED);
|
||||
}
|
||||
|
||||
@ -493,7 +493,7 @@ DEFUN (match_ip_address_prefix_list,
|
||||
"IP prefix-list name\n")
|
||||
{
|
||||
return zebra_route_match_add (vty, vty->index, "ip address prefix-list",
|
||||
argv[0]->arg, RMAP_EVENT_PLIST_ADDED);
|
||||
argv[0], RMAP_EVENT_PLIST_ADDED);
|
||||
}
|
||||
|
||||
DEFUN (no_match_ip_address_prefix_list,
|
||||
@ -511,7 +511,7 @@ DEFUN (no_match_ip_address_prefix_list,
|
||||
RMAP_EVENT_PLIST_DELETED);
|
||||
|
||||
return zebra_route_match_delete (vty, vty->index,
|
||||
"ip address prefix-list", argv[0]->arg,
|
||||
"ip address prefix-list", argv[0],
|
||||
RMAP_EVENT_PLIST_DELETED);
|
||||
}
|
||||
|
||||
@ -535,7 +535,7 @@ DEFUN (match_ip_address_prefix_len,
|
||||
"Prefix length\n")
|
||||
{
|
||||
return zebra_route_match_add (vty, vty->index, "ip address prefix-len",
|
||||
argv[0]->arg, RMAP_EVENT_MATCH_ADDED);
|
||||
argv[0], RMAP_EVENT_MATCH_ADDED);
|
||||
}
|
||||
|
||||
DEFUN (no_match_ip_address_prefix_len,
|
||||
@ -553,7 +553,7 @@ DEFUN (no_match_ip_address_prefix_len,
|
||||
RMAP_EVENT_MATCH_DELETED);
|
||||
|
||||
return zebra_route_match_delete (vty, vty->index,
|
||||
"ip address prefix-len", argv[0]->arg,
|
||||
"ip address prefix-len", argv[0],
|
||||
RMAP_EVENT_MATCH_DELETED);
|
||||
}
|
||||
|
||||
@ -576,7 +576,7 @@ DEFUN (match_ip_nexthop_prefix_len,
|
||||
"Prefix length\n")
|
||||
{
|
||||
return zebra_route_match_add (vty, vty->index, "ip next-hop prefix-len",
|
||||
argv[0]->arg, RMAP_EVENT_MATCH_ADDED);
|
||||
argv[0], RMAP_EVENT_MATCH_ADDED);
|
||||
}
|
||||
|
||||
DEFUN (no_match_ip_nexthop_prefix_len,
|
||||
@ -594,7 +594,7 @@ DEFUN (no_match_ip_nexthop_prefix_len,
|
||||
RMAP_EVENT_MATCH_DELETED);
|
||||
|
||||
return zebra_route_match_delete (vty, vty->index,
|
||||
"ip next-hop prefix-len", argv[0]->arg,
|
||||
"ip next-hop prefix-len", argv[0],
|
||||
RMAP_EVENT_MATCH_DELETED);
|
||||
}
|
||||
|
||||
@ -613,15 +613,15 @@ DEFUN (match_source_protocol,
|
||||
{
|
||||
int i;
|
||||
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
return zebra_route_match_add (vty, vty->index, "source-protocol",
|
||||
argv[0]->arg, RMAP_EVENT_MATCH_ADDED);
|
||||
argv[0], RMAP_EVENT_MATCH_ADDED);
|
||||
}
|
||||
|
||||
DEFUN (no_match_source_protocol,
|
||||
@ -635,16 +635,16 @@ DEFUN (no_match_source_protocol,
|
||||
|
||||
if (argc >= 1)
|
||||
{
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
}
|
||||
return zebra_route_match_delete (vty, vty->index,
|
||||
"source-protocol", argv[0]->arg ? argv[0]->arg : NULL,
|
||||
"source-protocol", argv[0] ? argv[0] : NULL,
|
||||
RMAP_EVENT_MATCH_DELETED);
|
||||
}
|
||||
|
||||
@ -663,9 +663,9 @@ DEFUN (set_src,
|
||||
struct prefix p;
|
||||
vrf_iter_t iter;
|
||||
|
||||
if (inet_pton(AF_INET, argv[0]->arg, &src.ipv4) != 1)
|
||||
if (inet_pton(AF_INET, argv[0], &src.ipv4) != 1)
|
||||
{
|
||||
if (inet_pton(AF_INET6, argv[0]->arg, &src.ipv6) != 1)
|
||||
if (inet_pton(AF_INET6, argv[0], &src.ipv6) != 1)
|
||||
{
|
||||
vty_out (vty, "%% not a valid IPv4/v6 address%s", VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
@ -706,7 +706,7 @@ DEFUN (set_src,
|
||||
vty_out (vty, "%% not a local address%s", VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
return zebra_route_set_add (vty, vty->index, "src", argv[0]->arg);
|
||||
return zebra_route_set_add (vty, vty->index, "src", argv[0]);
|
||||
}
|
||||
|
||||
DEFUN (no_set_src,
|
||||
@ -719,7 +719,7 @@ DEFUN (no_set_src,
|
||||
if (argc == 0)
|
||||
return zebra_route_set_delete (vty, vty->index, "src", NULL);
|
||||
|
||||
return zebra_route_set_delete (vty, vty->index, "src", argv[0]->arg);
|
||||
return zebra_route_set_delete (vty, vty->index, "src", argv[0]);
|
||||
}
|
||||
|
||||
DEFUN (zebra_route_map_timer,
|
||||
@ -730,7 +730,7 @@ DEFUN (zebra_route_map_timer,
|
||||
{
|
||||
u_int32_t rmap_delay_timer;
|
||||
|
||||
VTY_GET_INTEGER_RANGE ("delay-timer", rmap_delay_timer, argv[0]->arg, 0, 600);
|
||||
VTY_GET_INTEGER_RANGE ("delay-timer", rmap_delay_timer, argv[0], 0, 600);
|
||||
zebra_route_map_set_delay_timer(rmap_delay_timer);
|
||||
|
||||
return (CMD_SUCCESS);
|
||||
@ -766,28 +766,28 @@ DEFUN (ip_protocol,
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strcasecmp(argv[0]->arg, "any") == 0)
|
||||
if (strcasecmp(argv[0], "any") == 0)
|
||||
i = ZEBRA_ROUTE_MAX;
|
||||
else
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
if (proto_rm[AFI_IP][i])
|
||||
{
|
||||
if (strcmp(proto_rm[AFI_IP][i], argv[1]->arg) == 0)
|
||||
if (strcmp(proto_rm[AFI_IP][i], argv[1]) == 0)
|
||||
return CMD_SUCCESS;
|
||||
|
||||
XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP][i]);
|
||||
}
|
||||
proto_rm[AFI_IP][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]->arg);
|
||||
proto_rm[AFI_IP][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]);
|
||||
|
||||
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
|
||||
zlog_debug ("%u: IPv4 Routemap config for protocol %s, scheduling RIB processing",
|
||||
VRF_DEFAULT, argv[0]->arg);
|
||||
VRF_DEFAULT, argv[0]);
|
||||
|
||||
rib_update(VRF_DEFAULT, RIB_UPDATE_RMAP_CHANGE);
|
||||
return CMD_SUCCESS;
|
||||
@ -804,20 +804,20 @@ DEFUN (no_ip_protocol,
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strcasecmp(argv[0]->arg, "any") == 0)
|
||||
if (strcasecmp(argv[0], "any") == 0)
|
||||
i = ZEBRA_ROUTE_MAX;
|
||||
else
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
if (!proto_rm[AFI_IP][i])
|
||||
return CMD_SUCCESS;
|
||||
|
||||
if ((argc == 2 && strcmp(argv[1]->arg, proto_rm[AFI_IP][i]) == 0) ||
|
||||
if ((argc == 2 && strcmp(argv[1], proto_rm[AFI_IP][i]) == 0) ||
|
||||
(argc < 2))
|
||||
{
|
||||
XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP][i]);
|
||||
@ -825,7 +825,7 @@ DEFUN (no_ip_protocol,
|
||||
|
||||
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
|
||||
zlog_debug ("%u: IPv4 Routemap unconfig for protocol %s, scheduling RIB processing",
|
||||
VRF_DEFAULT, argv[0]->arg);
|
||||
VRF_DEFAULT, argv[0]);
|
||||
rib_update(VRF_DEFAULT, RIB_UPDATE_RMAP_CHANGE);
|
||||
}
|
||||
return CMD_SUCCESS;
|
||||
@ -879,28 +879,28 @@ DEFUN (ipv6_protocol,
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strcasecmp(argv[0]->arg, "any") == 0)
|
||||
if (strcasecmp(argv[0], "any") == 0)
|
||||
i = ZEBRA_ROUTE_MAX;
|
||||
else
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
if (proto_rm[AFI_IP6][i])
|
||||
{
|
||||
if (strcmp(proto_rm[AFI_IP6][i], argv[1]->arg) == 0)
|
||||
if (strcmp(proto_rm[AFI_IP6][i], argv[1]) == 0)
|
||||
return CMD_SUCCESS;
|
||||
|
||||
XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP6][i]);
|
||||
}
|
||||
proto_rm[AFI_IP6][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]->arg);
|
||||
proto_rm[AFI_IP6][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]);
|
||||
|
||||
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
|
||||
zlog_debug ("%u: IPv6 Routemap config for protocol %s, scheduling RIB processing",
|
||||
VRF_DEFAULT, argv[0]->arg);
|
||||
VRF_DEFAULT, argv[0]);
|
||||
|
||||
rib_update(VRF_DEFAULT, RIB_UPDATE_RMAP_CHANGE);
|
||||
return CMD_SUCCESS;
|
||||
@ -917,20 +917,20 @@ DEFUN (no_ipv6_protocol,
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strcasecmp(argv[0]->arg, "any") == 0)
|
||||
if (strcasecmp(argv[0], "any") == 0)
|
||||
i = ZEBRA_ROUTE_MAX;
|
||||
else
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
if (!proto_rm[AFI_IP6][i])
|
||||
return CMD_SUCCESS;
|
||||
|
||||
if ((argc == 2 && strcmp(argv[1]->arg, proto_rm[AFI_IP6][i]) == 0) ||
|
||||
if ((argc == 2 && strcmp(argv[1], proto_rm[AFI_IP6][i]) == 0) ||
|
||||
(argc < 2))
|
||||
{
|
||||
XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP6][i]);
|
||||
@ -938,7 +938,7 @@ DEFUN (no_ipv6_protocol,
|
||||
|
||||
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
|
||||
zlog_debug ("%u: IPv6 Routemap unconfig for protocol %s, scheduling RIB processing",
|
||||
VRF_DEFAULT, argv[0]->arg);
|
||||
VRF_DEFAULT, argv[0]);
|
||||
|
||||
rib_update(VRF_DEFAULT, RIB_UPDATE_RMAP_CHANGE);
|
||||
}
|
||||
@ -993,25 +993,25 @@ DEFUN (ip_protocol_nht_rmap,
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strcasecmp(argv[0]->arg, "any") == 0)
|
||||
if (strcasecmp(argv[0], "any") == 0)
|
||||
i = ZEBRA_ROUTE_MAX;
|
||||
else
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
if (nht_rm[AFI_IP][i])
|
||||
{
|
||||
if (strcmp(nht_rm[AFI_IP][i], argv[1]->arg) == 0)
|
||||
if (strcmp(nht_rm[AFI_IP][i], argv[1]) == 0)
|
||||
return CMD_SUCCESS;
|
||||
|
||||
XFREE (MTYPE_ROUTE_MAP_NAME, nht_rm[AFI_IP][i]);
|
||||
}
|
||||
|
||||
nht_rm[AFI_IP][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]->arg);
|
||||
nht_rm[AFI_IP][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]);
|
||||
zebra_evaluate_rnh(0, AF_INET, 1, RNH_NEXTHOP_TYPE, NULL);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
@ -1027,20 +1027,20 @@ DEFUN (no_ip_protocol_nht_rmap,
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strcasecmp(argv[0]->arg, "any") == 0)
|
||||
if (strcasecmp(argv[0], "any") == 0)
|
||||
i = ZEBRA_ROUTE_MAX;
|
||||
else
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
if (!nht_rm[AFI_IP][i])
|
||||
return CMD_SUCCESS;
|
||||
|
||||
if ((argc == 2 && strcmp(argv[1]->arg, nht_rm[AFI_IP][i]) == 0) ||
|
||||
if ((argc == 2 && strcmp(argv[1], nht_rm[AFI_IP][i]) == 0) ||
|
||||
(argc < 2))
|
||||
{
|
||||
XFREE (MTYPE_ROUTE_MAP_NAME, nht_rm[AFI_IP][i]);
|
||||
@ -1097,19 +1097,19 @@ DEFUN (ipv6_protocol_nht_rmap,
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strcasecmp(argv[0]->arg, "any") == 0)
|
||||
if (strcasecmp(argv[0], "any") == 0)
|
||||
i = ZEBRA_ROUTE_MAX;
|
||||
else
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
if (nht_rm[AFI_IP6][i])
|
||||
XFREE (MTYPE_ROUTE_MAP_NAME, nht_rm[AFI_IP6][i]);
|
||||
nht_rm[AFI_IP6][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]->arg);
|
||||
nht_rm[AFI_IP6][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]);
|
||||
zebra_evaluate_rnh(0, AF_INET6, 1, RNH_NEXTHOP_TYPE, NULL);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
@ -1125,20 +1125,20 @@ DEFUN (no_ipv6_protocol_nht_rmap,
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strcasecmp(argv[0]->arg, "any") == 0)
|
||||
if (strcasecmp(argv[0], "any") == 0)
|
||||
i = ZEBRA_ROUTE_MAX;
|
||||
else
|
||||
i = proto_name2num(argv[0]->arg);
|
||||
i = proto_name2num(argv[0]);
|
||||
if (i < 0)
|
||||
{
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0]->arg ? argv[0]->arg : "",
|
||||
vty_out (vty, "invalid protocol name \"%s\"%s", argv[0] ? argv[0] : "",
|
||||
VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
if (nht_rm[AFI_IP6][i] && argc == 2 && strcmp(argv[1]->arg, nht_rm[AFI_IP6][i]))
|
||||
if (nht_rm[AFI_IP6][i] && argc == 2 && strcmp(argv[1], nht_rm[AFI_IP6][i]))
|
||||
{
|
||||
vty_out (vty, "invalid route-map \"%s\"%s", argv[1]->arg, VTY_NEWLINE);
|
||||
vty_out (vty, "invalid route-map \"%s\"%s", argv[1], VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2263,7 +2263,7 @@ DEFUN (config_table,
|
||||
"Configure target kernel routing table\n"
|
||||
"TABLE integer\n")
|
||||
{
|
||||
zebrad.rtm_table_default = strtol (argv[0]->arg, (char**)0, 10);
|
||||
zebrad.rtm_table_default = strtol (argv[0], (char**)0, 10);
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user