summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2016-09-30 03:27:05 +0200
committerDaniel Walton <dwalton@cumulusnetworks.com>2016-09-30 03:27:05 +0200
commit1d68dbfe66479d81a570d8d4aa2d0f0d7ba57184 (patch)
tree86e24c95b6a508cdf97bdabac318d4e5e017418e
parentall: scrubbed some argc CHECK MEs (diff)
downloadfrr-1d68dbfe66479d81a570d8d4aa2d0f0d7ba57184.tar.xz
frr-1d68dbfe66479d81a570d8d4aa2d0f0d7ba57184.zip
ospf6d: scrubbed some argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
-rw-r--r--ospf6d/ospf6_area.c42
-rw-r--r--ospf6d/ospf6_asbr.c60
-rw-r--r--ospf6d/ospf6_interface.c35
-rw-r--r--ospf6d/ospf6_lsa.c53
-rw-r--r--ospf6d/ospf6_message.c70
-rw-r--r--ospf6d/ospf6_neighbor.c76
-rw-r--r--ospf6d/ospf6_route.c4
-rw-r--r--ospf6d/ospf6_route.h2
-rw-r--r--ospf6d/ospf6_spf.c26
-rw-r--r--ospf6d/ospf6_top.c91
-rw-r--r--ospf6d/ospf6_zebra.c39
-rw-r--r--ospfd/ospf_dump.c343
-rw-r--r--ospfd/ospf_opaque.c2
-rw-r--r--ospfd/ospf_te.c3
14 files changed, 223 insertions, 623 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index 75c1bd2f6..bd9c0bcb2 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -532,47 +532,15 @@ DEFUN (area_range,
return CMD_SUCCESS;
}
-
-
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no area (A.B.C.D|<0-4294967295>) range X:X::X:X/M advertise cost <0-16777215>",
- * NO_STR
- * "OSPF area parameters\n"
- * OSPF6_AREA_ID_STR
- * "Summarize routes matching address/mask (border routers only)\n"
- * "Area range prefix\n"
- * "User specified metric for this range\n"
- * "Advertised metric for this range\n"
- *
- * "no area A.B.C.D range X:X::X:X/M (advertise|not-advertise)",
- * NO_STR
- * "OSPF area parameters\n"
- * OSPF6_AREA_ID_STR
- * "Configured address range\n"
- * "Specify IPv6 prefix\n"
- *
- * "no area (A.B.C.D|<0-4294967295>) range X:X::X:X/M cost <0-16777215>",
- * NO_STR
- * "OSPF area parameters\n"
- * OSPF6_AREA_ID_STR
- * "Summarize routes matching address/mask (border routers only)\n"
- * "Area range prefix\n"
- * "User specified metric for this range\n"
- * "Advertised metric for this range\n"
- *
- */
DEFUN (no_area_range,
no_area_range_cmd,
- "no area A.B.C.D range X:X::X:X/M",
+ "no area A.B.C.D range X:X::X:X/M [<advertise|not-advertise>] [cost (0-16777215)]",
NO_STR
"OSPF area parameters\n"
OSPF6_AREA_ID_STR
"Configured address range\n"
"Specify IPv6 prefix\n")
{
- /* CHECK ME argc referenced below */
int idx_ipv4 = 2;
int ret;
struct ospf6_area *oa;
@@ -580,8 +548,6 @@ DEFUN (no_area_range,
struct ospf6_route *range, *route;
OSPF6_CMD_AREA_GET (argv[idx_ipv4]->arg, oa);
- argc--;
- argv++;
ret = str2prefix (argv[idx_ipv4]->arg, &prefix);
if (ret != 1 || prefix.family != AF_INET6)
@@ -682,15 +648,12 @@ DEFUN (area_filter_list,
"Filter networks sent to this area\n"
"Filter networks sent from this area\n")
{
- /* CHECK ME argc referenced below */
int idx_ipv4 = 1;
int idx_word = 4;
struct ospf6_area *area;
struct prefix_list *plist;
OSPF6_CMD_AREA_GET (argv[idx_ipv4]->arg, area);
- argc--;
- argv++;
plist = prefix_list_lookup (AFI_IP6, argv[idx_ipv4]->arg);
if (strncmp (argv[idx_word]->arg, "in", 2) == 0)
@@ -727,14 +690,11 @@ DEFUN (no_area_filter_list,
"Filter networks sent to this area\n"
"Filter networks sent from this area\n")
{
- /* CHECK ME argc referenced below */
int idx_ipv4 = 2;
int idx_word = 5;
struct ospf6_area *area;
OSPF6_CMD_AREA_GET (argv[idx_ipv4]->arg, area);
- argc--;
- argv++;
if (strncmp (argv[idx_word]->arg, "in", 2) == 0)
{
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 3798f85df..8489d3366 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -681,27 +681,19 @@ DEFUN (ospf6_redistribute_routemap,
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no redistribute <kernel|connected|static|ripng|isis|bgp|table> route-map WORD",
- * NO_STR
- * "Redistribute\n"
- * QUAGGA_REDIST_HELP_STR_OSPF6D
- * "Route map reference\n"
- * "Route map name\n"
- *
- */
DEFUN (no_ospf6_redistribute,
no_ospf6_redistribute_cmd,
- "no redistribute <kernel|connected|static|ripng|isis|bgp|table>",
+ "no redistribute <kernel|connected|static|ripng|isis|bgp|table> [route-map WORD]",
NO_STR
"Redistribute\n"
QUAGGA_REDIST_HELP_STR_OSPF6D
- )
+ "Route map reference\n"
+ "Route map name\n")
{
+ int idx_protocol = 2;
int type;
- type = proto_redistnum(AFI_IP6, argv[3]->arg);
+ type = proto_redistnum(AFI_IP6, argv[idx_protocol]->text);
if (type < 0 || type == ZEBRA_ROUTE_OSPF6)
return CMD_WARNING;
@@ -1058,24 +1050,23 @@ DEFUN (ospf6_routemap_match_interface,
}
/* "no match interface WORD" */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no match interface WORD",
- * MATCH_STR
- * NO_STR
- * "Match first hop interface of route\n"
- * "Interface name\n"
- *
- */
DEFUN (ospf6_routemap_no_match_interface,
ospf6_routemap_no_match_interface_cmd,
- "no match interface",
+ "no match interface [WORD]",
MATCH_STR
NO_STR
- "Match first hop interface of route\n")
+ "Match first hop interface of route\n"
+ "Interface name\n")
{
- int ret = route_map_delete_match ((struct route_map_index *) vty->index,
- "interface", argv[3]->arg);
+ int idx_word = 3;
+ int ret;
+
+ if (argc == 4)
+ ret = route_map_delete_match ((struct route_map_index *) vty->index,
+ "interface", argv[idx_word]->arg);
+ else
+ ret = route_map_delete_match ((struct route_map_index *) vty->index,
+ "interface", NULL);
return route_map_command_status (vty, ret);
}
@@ -1126,31 +1117,22 @@ DEFUN (set_metric,
}
/* delete "set metric" */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no set metric <0-4294967295>",
- * NO_STR
- * SET_STR
- * "Metric value for destination routing protocol\n"
- * "Metric value\n"
- *
- */
DEFUN (no_set_metric,
no_set_metric_cmd,
- "no set metric",
+ "no set metric [(0-4294967295)]",
NO_STR
SET_STR
"Metric value for destination routing protocol\n")
{
- /* CHECK ME argc referenced below */
+ int idx_number = 3;
int ret = 0;
- if (argc == 0)
+ if (argc == 3)
ret = route_map_delete_set ((struct route_map_index *) vty->index,
"metric", NULL);
else
ret = route_map_delete_set ((struct route_map_index *) vty->index,
- "metric", argv[3]->arg);
+ "metric", argv[idx_number]->arg);
return route_map_command_status (vty, ret);
}
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index e15fb9971..c08d4ee84 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -986,32 +986,20 @@ ospf6_interface_show (struct vty *vty, struct interface *ifp)
}
/* show interface */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 ospf6 interface",
- * SHOW_STR
- * IP6_STR
- * OSPF6_STR
- * INTERFACE_STR
- *
- *
- */
DEFUN (show_ipv6_ospf6_interface,
show_ipv6_ospf6_interface_ifname_cmd,
- "show ipv6 ospf6 interface IFNAME",
+ "show ipv6 ospf6 interface [IFNAME]",
SHOW_STR
IP6_STR
OSPF6_STR
INTERFACE_STR
- IFNAME_STR
- )
+ IFNAME_STR)
{
- /* CHECK ME argc referenced below */
int idx_ifname = 4;
struct interface *ifp;
struct listnode *i;
- if (argc)
+ if (argc == 5)
{
ifp = if_lookup_by_name (argv[idx_ifname]->arg);
if (ifp == NULL)
@@ -1364,21 +1352,13 @@ DEFUN (auto_cost_reference_bandwidth,
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no auto-cost reference-bandwidth <1-4294967>",
- * NO_STR
- * "Calculate OSPF interface cost according to bandwidth\n"
- * "Use reference bandwidth method to assign OSPF cost\n"
- * "The reference bandwidth in terms of Mbits per second\n"
- *
- */
DEFUN (no_auto_cost_reference_bandwidth,
no_auto_cost_reference_bandwidth_cmd,
- "no auto-cost reference-bandwidth",
+ "no auto-cost reference-bandwidth [1-4294967]",
NO_STR
"Calculate OSPF interface cost according to bandwidth\n"
- "Use reference bandwidth method to assign OSPF cost\n")
+ "Use reference bandwidth method to assign OSPF cost\n"
+ "The reference bandwidth in terms of Mbits per second\n")
{
struct ospf6 *o = vty->index;
struct ospf6_area *oa;
@@ -1993,12 +1973,11 @@ DEFUN (clear_ipv6_ospf6_interface,
IFNAME_STR
)
{
- /* CHECK ME argc referenced below */
int idx_ifname = 4;
struct interface *ifp;
struct listnode *node;
- if (argc == 0) /* Clear all the ospfv3 interfaces. */
+ if (argc == 4) /* Clear all the ospfv3 interfaces. */
{
for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
ospf6_interface_clear (vty, ifp);
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 7aa78048d..c65cae392 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -816,32 +816,19 @@ ospf6_lsa_handler_name (struct ospf6_lsa_handler *h)
return buf;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf6 lsa (router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown) (originate|examine|flooding)",
- * DEBUG_STR
- * OSPF6_STR
- * "Debug Link State Advertisements (LSAs)\n"
- * "Specify LS type as Hexadecimal\n"
- *
- *
- */
DEFUN (debug_ospf6_lsa_type,
debug_ospf6_lsa_hex_cmd,
- "debug ospf6 lsa <router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown>",
+ "debug ospf6 lsa <router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown> [originate|examine|flooding]",
DEBUG_STR
OSPF6_STR
"Debug Link State Advertisements (LSAs)\n"
- "Specify LS type as Hexadecimal\n"
- )
+ "Specify LS type as Hexadecimal\n")
{
- /* CHECK ME argc referenced below */
int idx_lsa = 3;
+ int idx_type = 4;
unsigned int i;
struct ospf6_lsa_handler *handler = NULL;
- assert (argc);
-
for (i = 0; i < vector_active (ospf6_lsa_handler_vector); i++)
{
handler = vector_slot (ospf6_lsa_handler_vector, i);
@@ -857,13 +844,13 @@ DEFUN (debug_ospf6_lsa_type,
if (handler == NULL)
handler = &unknown_handler;
- if (argc >= 2)
+ if (argc == 5)
{
- if (! strcmp (argv[4]->arg, "originate"))
+ if (! strcmp (argv[idx_type]->text, "originate"))
SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
- if (! strcmp (argv[4]->arg, "examine"))
+ else if (! strcmp (argv[idx_type]->text, "examine"))
SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
- if (! strcmp (argv[4]->arg, "flooding"))
+ else if (! strcmp (argv[idx_type]->text, "flooding"))
SET_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD);
}
else
@@ -872,21 +859,9 @@ DEFUN (debug_ospf6_lsa_type,
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf6 lsa (router|network|inter-prefix|inter-router|as-external|link|intra-prefix) (originate|examine|flooding)",
- * NO_STR
- * DEBUG_STR
- * OSPF6_STR
- * "Debug Link State Advertisements (LSAs)\n"
- * "Specify LS type as Hexadecimal\n"
- *
- *
- */
DEFUN (no_debug_ospf6_lsa_type,
no_debug_ospf6_lsa_hex_cmd,
- "no debug ospf6 lsa <router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown>",
+ "no debug ospf6 lsa <router|network|inter-prefix|inter-router|as-external|link|intra-prefix|unknown> [originate|examine|flooding]",
NO_STR
DEBUG_STR
OSPF6_STR
@@ -894,13 +869,11 @@ DEFUN (no_debug_ospf6_lsa_type,
"Specify LS type as Hexadecimal\n"
)
{
- /* CHECK ME argc referenced below */
int idx_lsa = 4;
+ int idx_type = 5;
u_int i;
struct ospf6_lsa_handler *handler = NULL;
- assert (argc);
-
for (i = 0; i < vector_active (ospf6_lsa_handler_vector); i++)
{
handler = vector_slot (ospf6_lsa_handler_vector, i);
@@ -915,13 +888,13 @@ DEFUN (no_debug_ospf6_lsa_type,
if (handler == NULL)
return CMD_SUCCESS;
- if (argc >= 2)
+ if (argc == 6)
{
- if (! strcmp (argv[5]->arg, "originate"))
+ if (! strcmp (argv[idx_type]->text, "originate"))
UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_ORIGINATE);
- if (! strcmp (argv[5]->arg, "examine"))
+ if (! strcmp (argv[idx_type]->text, "examine"))
UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_EXAMIN);
- if (! strcmp (argv[5]->arg, "flooding"))
+ if (! strcmp (argv[idx_type]->text, "flooding"))
UNSET_FLAG (handler->debug, OSPF6_LSA_DEBUG_FLOOD);
}
else
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index 8c4684081..e9a25d37e 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -2338,27 +2338,9 @@ ospf6_lsack_send_interface (struct thread *thread)
/* Commands */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf6 message (unknown|hello|dbdesc|lsreq|lsupdate|lsack|all) (send|recv)",
- * DEBUG_STR
- * OSPF6_STR
- * "Debug OSPFv3 message\n"
- * "Debug Unknown message\n"
- * "Debug Hello message\n"
- * "Debug Database Description message\n"
- * "Debug Link State Request message\n"
- * "Debug Link State Update message\n"
- * "Debug Link State Acknowledgement message\n"
- * "Debug All message\n"
- * "Debug only sending message\n"
- * "Debug only receiving message\n"
- *
- *
- */
DEFUN (debug_ospf6_message,
debug_ospf6_message_cmd,
- "debug ospf6 message <unknown|hello|dbdesc|lsreq|lsupdate|lsack|all>",
+ "debug ospf6 message <unknown|hello|dbdesc|lsreq|lsupdate|lsack|all> [<send|recv>]",
DEBUG_STR
OSPF6_STR
"Debug OSPFv3 message\n"
@@ -2369,16 +2351,15 @@ DEFUN (debug_ospf6_message,
"Debug Link State Update message\n"
"Debug Link State Acknowledgement message\n"
"Debug All message\n"
- )
+ "Debug only sending message\n"
+ "Debug only receiving message\n")
{
- /* CHECK ME argc referenced below */
int idx_packet = 3;
+ int idx_send_recv = 4;
unsigned char level = 0;
int type = 0;
int i;
- assert (argc > 0);
-
/* check type */
if (! strncmp (argv[idx_packet]->arg, "u", 1))
type = OSPF6_MESSAGE_TYPE_UNKNOWN;
@@ -2395,11 +2376,11 @@ DEFUN (debug_ospf6_message,
else if (! strncmp (argv[idx_packet]->arg, "a", 1))
type = OSPF6_MESSAGE_TYPE_ALL;
- if (argc == 1)
+ if (argc == 4)
level = OSPF6_DEBUG_MESSAGE_SEND | OSPF6_DEBUG_MESSAGE_RECV;
- else if (! strncmp (argv[4]->arg, "s", 1))
+ else if (! strncmp (argv[idx_send_recv]->arg, "s", 1))
level = OSPF6_DEBUG_MESSAGE_SEND;
- else if (! strncmp (argv[4]->arg, "r", 1))
+ else if (! strncmp (argv[idx_send_recv]->arg, "r", 1))
level = OSPF6_DEBUG_MESSAGE_RECV;
if (type == OSPF6_MESSAGE_TYPE_ALL)
@@ -2413,31 +2394,9 @@ DEFUN (debug_ospf6_message,
return CMD_SUCCESS;
}
-
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf6 message "
- * "(unknown|hello|dbdesc|lsreq|lsupdate|lsack|all) (send|recv)",
- * NO_STR
- * DEBUG_STR
- * OSPF6_STR
- * "Debug OSPFv3 message\n"
- * "Debug Unknown message\n"
- * "Debug Hello message\n"
- * "Debug Database Description message\n"
- * "Debug Link State Request message\n"
- * "Debug Link State Update message\n"
- * "Debug Link State Acknowledgement message\n"
- * "Debug All message\n"
- * "Debug only sending message\n"
- * "Debug only receiving message\n"
- *
- *
- */
DEFUN (no_debug_ospf6_message,
no_debug_ospf6_message_cmd,
- "no debug ospf6 message <unknown|hello|dbdesc|lsreq|lsupdate|lsack|all>",
+ "no debug ospf6 message <unknown|hello|dbdesc|lsreq|lsupdate|lsack|all> [<send|recv>]",
NO_STR
DEBUG_STR
OSPF6_STR
@@ -2449,16 +2408,15 @@ DEFUN (no_debug_ospf6_message,
"Debug Link State Update message\n"
"Debug Link State Acknowledgement message\n"
"Debug All message\n"
- )
+ "Debug only sending message\n"
+ "Debug only receiving message\n")
{
- /* CHECK ME argc referenced below */
int idx_packet = 4;
+ int idx_send_recv = 5;
unsigned char level = 0;
int type = 0;
int i;
- assert (argc > 0);
-
/* check type */
if (! strncmp (argv[idx_packet]->arg, "u", 1))
type = OSPF6_MESSAGE_TYPE_UNKNOWN;
@@ -2475,11 +2433,11 @@ DEFUN (no_debug_ospf6_message,
else if (! strncmp (argv[idx_packet]->arg, "a", 1))
type = OSPF6_MESSAGE_TYPE_ALL;
- if (argc == 1)
+ if (argc == 5)
level = OSPF6_DEBUG_MESSAGE_SEND | OSPF6_DEBUG_MESSAGE_RECV;
- else if (! strncmp (argv[5]->arg, "s", 1))
+ else if (! strncmp (argv[idx_send_recv]->arg, "s", 1))
level = OSPF6_DEBUG_MESSAGE_SEND;
- else if (! strncmp (argv[5]->arg, "r", 1))
+ else if (! strncmp (argv[idx_send_recv]->arg, "r", 1))
level = OSPF6_DEBUG_MESSAGE_RECV;
if (type == OSPF6_MESSAGE_TYPE_ALL)
diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c
index 573fced39..1c55175d2 100644
--- a/ospf6d/ospf6_neighbor.c
+++ b/ospf6d/ospf6_neighbor.c
@@ -827,28 +827,17 @@ ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on)
ospf6_bfd_show_info(vty, on->bfd_info, 0);
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 ospf6 neighbor (detail|drchoice)",
- * SHOW_STR
- * IP6_STR
- * OSPF6_STR
- * "Neighbor list\n"
- * "Display details\n"
- * "Display DR choices\n"
- *
- *
- */
DEFUN (show_ipv6_ospf6_neighbor,
show_ipv6_ospf6_neighbor_cmd,
- "show ipv6 ospf6 neighbor",
+ "show ipv6 ospf6 neighbor [detail|drchoice]",
SHOW_STR
IP6_STR
OSPF6_STR
"Neighbor list\n"
- )
+ "Display details\n"
+ "Display DR choices\n")
{
- /* CHECK ME argc referenced below */
+ int idx_type = 4;
struct ospf6_neighbor *on;
struct ospf6_interface *oi;
struct ospf6_area *oa;
@@ -858,11 +847,11 @@ DEFUN (show_ipv6_ospf6_neighbor,
OSPF6_CMD_CHECK_RUNNING ();
showfunc = ospf6_neighbor_show;
- if (argc)
+ if (argc == 5)
{
- if (! strncmp (argv[4]->arg, "de", 2))
+ if (! strncmp (argv[idx_type]->arg, "de", 2))
showfunc = ospf6_neighbor_show_detail;
- else if (! strncmp (argv[4]->arg, "dr", 2))
+ else if (! strncmp (argv[idx_type]->arg, "dr", 2))
showfunc = ospf6_neighbor_show_drchoice;
}
@@ -927,32 +916,23 @@ ospf6_neighbor_init (void)
install_element (ENABLE_NODE, &show_ipv6_ospf6_neighbor_cmd);
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf6 neighbor (state|event)",
- * DEBUG_STR
- * OSPF6_STR
- * "Debug OSPFv3 Neighbor\n"
- * "Debug OSPFv3 Neighbor State Change\n"
- * "Debug OSPFv3 Neighbor Event\n"
- *
- *
- */
DEFUN (debug_ospf6_neighbor,
debug_ospf6_neighbor_cmd,
- "debug ospf6 neighbor",
+ "debug ospf6 neighbor [state|event]",
DEBUG_STR
OSPF6_STR
"Debug OSPFv3 Neighbor\n"
- )
+ "Debug OSPFv3 Neighbor State Change\n"
+ "Debug OSPFv3 Neighbor Event\n")
{
- /* CHECK ME argc referenced below */
+ int idx_type = 3;
unsigned char level = 0;
- if (argc)
+
+ if (argc == 4)
{
- if (! strncmp (argv[3]->arg, "s", 1))
+ if (! strncmp (argv[idx_type]->arg, "s", 1))
level = OSPF6_DEBUG_NEIGHBOR_STATE;
- if (! strncmp (argv[3]->arg, "e", 1))
+ else if (! strncmp (argv[idx_type]->arg, "e", 1))
level = OSPF6_DEBUG_NEIGHBOR_EVENT;
}
else
@@ -963,34 +943,24 @@ DEFUN (debug_ospf6_neighbor,
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf6 neighbor (state|event)",
- * NO_STR
- * DEBUG_STR
- * OSPF6_STR
- * "Debug OSPFv3 Neighbor\n"
- * "Debug OSPFv3 Neighbor State Change\n"
- * "Debug OSPFv3 Neighbor Event\n"
- *
- *
- */
DEFUN (no_debug_ospf6_neighbor,
no_debug_ospf6_neighbor_cmd,
- "no debug ospf6 neighbor",
+ "no debug ospf6 neighbor [state|event]",
NO_STR
DEBUG_STR
OSPF6_STR
"Debug OSPFv3 Neighbor\n"
- )
+ "Debug OSPFv3 Neighbor State Change\n"
+ "Debug OSPFv3 Neighbor Event\n")
{
- /* CHECK ME argc referenced below */
+ int idx_type = 4;
unsigned char level = 0;
- if (argc)
+
+ if (argc == 5)
{
- if (! strncmp (argv[4]->arg, "s", 1))
+ if (! strncmp (argv[idx_type]->arg, "s", 1))
level = OSPF6_DEBUG_NEIGHBOR_STATE;
- if (! strncmp (argv[4]->arg, "e", 1))
+ if (! strncmp (argv[idx_type]->arg, "e", 1))
level = OSPF6_DEBUG_NEIGHBOR_EVENT;
}
else
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index bc4c951f1..58bb2fc80 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -1298,7 +1298,7 @@ ospf6_route_show_table (struct vty *vty, int detail,
}
int
-ospf6_route_table_show (struct vty *vty, int argc, struct cmd_token **argv,
+ospf6_route_table_show (struct vty *vty, int argc_start, int argc, struct cmd_token **argv,
struct ospf6_route_table *table)
{
int summary = 0;
@@ -1312,7 +1312,7 @@ ospf6_route_table_show (struct vty *vty, int argc, struct cmd_token **argv,
memset (&prefix, 0, sizeof (struct prefix));
- for (i = 0; i < argc; i++)
+ for (i = argc_start; i < argc; i++)
{
if (! strcmp (argv[i]->arg, "summary"))
{
diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h
index 8c5ca4eb2..ad429d86c 100644
--- a/ospf6d/ospf6_route.h
+++ b/ospf6d/ospf6_route.h
@@ -328,7 +328,7 @@ extern void ospf6_route_dump (struct ospf6_route_table *table);
extern void ospf6_route_show (struct vty *vty, struct ospf6_route *route);
extern void ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route);
-extern int ospf6_route_table_show (struct vty *, int, struct cmd_token **,
+extern int ospf6_route_table_show (struct vty *, int, int, struct cmd_token **,
struct ospf6_route_table *);
extern int ospf6_linkstate_table_show (struct vty *vty, int argc,
struct cmd_token **argv,
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 659078353..67958be06 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -885,18 +885,11 @@ DEFUN (ospf6_timers_throttle_spf,
"Initial hold time (msec) between consecutive SPF calculations\n"
"Maximum hold time (msec)\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 3;
int idx_number_2 = 4;
int idx_number_3 = 5;
unsigned int delay, hold, max;
- if (argc != 3)
- {
- vty_out (vty, "Insufficient arguments%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
VTY_GET_INTEGER_RANGE ("SPF delay timer", delay, argv[idx_number]->arg, 0, 600000);
VTY_GET_INTEGER_RANGE ("SPF hold timer", hold, argv[idx_number_2]->arg, 0, 600000);
VTY_GET_INTEGER_RANGE ("SPF max-hold timer", max, argv[idx_number_3]->arg, 0, 600000);
@@ -904,25 +897,16 @@ DEFUN (ospf6_timers_throttle_spf,
return ospf6_timers_spf_set (vty, delay, hold, max);
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no timers throttle spf <0-600000> <0-600000> <0-600000>",
- * NO_STR
- * "Adjust routing timers\n"
- * "Throttling adaptive timer\n"
- * "OSPF6 SPF timers\n"
- * "Delay (msec) from first change received till SPF calculation\n"
- * "Initial hold time (msec) between consecutive SPF calculations\n"
- * "Maximum hold time (msec)\n"
- *
- */
DEFUN (no_ospf6_timers_throttle_spf,
no_ospf6_timers_throttle_spf_cmd,
- "no timers throttle spf",
+ "no timers throttle spf [(0-600000) (0-600000) (0-600000)]",
NO_STR
"Adjust routing timers\n"
"Throttling adaptive timer\n"
- "OSPF6 SPF timers\n")
+ "OSPF6 SPF timers\n"
+ "Delay (msec) from first change received till SPF calculation\n"
+ "Initial hold time (msec) between consecutive SPF calculations\n"
+ "Maximum hold time (msec)\n")
{
return ospf6_timers_spf_set (vty,
OSPF_SPF_DELAY_DEFAULT,
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 49e136c99..58301b1c0 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -405,7 +405,6 @@ DEFUN (ospf6_timers_lsa,
"Minimum delay in receiving new version of a LSA\n"
"Delay in milliseconds\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 3;
unsigned int minarrival;
struct ospf6 *ospf = vty->index;
@@ -413,47 +412,30 @@ DEFUN (ospf6_timers_lsa,
if (!ospf)
return CMD_SUCCESS;
- if (argc != 1)
- {
- vty_out (vty, "Insufficient number of arguments%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
VTY_GET_INTEGER ("LSA min-arrival", minarrival, argv[idx_number]->arg);
-
ospf->lsa_minarrival = minarrival;
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no timers lsa min-arrival <0-600000>",
- * NO_STR
- * "Adjust routing timers\n"
- * "OSPF6 LSA timers\n"
- * "Minimum delay in receiving new version of a LSA\n"
- * "Delay in milliseconds\n"
- *
- */
DEFUN (no_ospf6_timers_lsa,
no_ospf6_timers_lsa_cmd,
- "no timers lsa min-arrival",
+ "no timers lsa min-arrival [(0-600000)]",
NO_STR
"Adjust routing timers\n"
"OSPF6 LSA timers\n"
"Minimum delay in receiving new version of a LSA\n")
{
- /* CHECK ME argc referenced below */
+ int idx_number = 4;
unsigned int minarrival;
struct ospf6 *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
- if (argc)
+ if (argc == 5)
{
- VTY_GET_INTEGER ("LSA min-arrival", minarrival, argv[4]->arg);
+ VTY_GET_INTEGER ("LSA min-arrival", minarrival, argv[idx_number]->arg);
if (ospf->lsa_minarrival != minarrival ||
minarrival == OSPF_MIN_LS_ARRIVAL)
@@ -784,75 +766,42 @@ DEFUN (show_ipv6_ospf6,
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 ospf6 route (intra-area|inter-area|external-1|external-2)",
- * SHOW_STR
- * IP6_STR
- * OSPF6_STR
- * ROUTE_STR
- * "Display Intra-Area routes\n"
- * "Display Inter-Area routes\n"
- * "Display Type-1 External routes\n"
- * "Display Type-2 External routes\n"
- *
- *
- * "show ipv6 ospf6 route (X:X::X:X|X:X::X:X/M|detail|summary)",
- * SHOW_STR
- * IP6_STR
- * OSPF6_STR
- * ROUTE_STR
- * "Specify IPv6 address\n"
- * "Specify IPv6 prefix\n"
- * "Detailed information\n"
- * "Summary of route table\n"
- *
- *
- */
DEFUN (show_ipv6_ospf6_route,
show_ipv6_ospf6_route_cmd,
- "show ipv6 ospf6 route",
+ "show ipv6 ospf6 route [intra-area|inter-area|external-1|external-2|X:X::X:X|X:X::X:X/M|detail|summary]",
SHOW_STR
IP6_STR
OSPF6_STR
ROUTE_STR
- )
+ "Display Intra-Area routes\n"
+ "Display Inter-Area routes\n"
+ "Display Type-1 External routes\n"
+ "Display Type-2 External routes\n"
+ "Specify IPv6 address\n"
+ "Specify IPv6 prefix\n"
+ "Detailed information\n"
+ "Summary of route table\n")
{
- /* CHECK ME argc referenced below */
OSPF6_CMD_CHECK_RUNNING ();
- ospf6_route_table_show (vty, argc, argv, ospf6->route_table);
+ ospf6_route_table_show (vty, 4, argc, argv, ospf6->route_table);
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 ospf6 route X:X::X:X/M longer",
- * SHOW_STR
- * IP6_STR
- * OSPF6_STR
- * ROUTE_STR
- * "Specify IPv6 prefix\n"
- * "Display routes longer than the specified route\n"
- *
- *
- */
DEFUN (show_ipv6_ospf6_route_match,
show_ipv6_ospf6_route_match_cmd,
- "show ipv6 ospf6 route X:X::X:X/M match",
+ "show ipv6 ospf6 route X:X::X:X/M <match|longer>",
SHOW_STR
IP6_STR
OSPF6_STR
ROUTE_STR
"Specify IPv6 prefix\n"
"Display routes which match the specified route\n"
- )
+ "Display routes longer than the specified route\n")
{
- /* CHECK ME argc referenced below */
OSPF6_CMD_CHECK_RUNNING ();
- ospf6_route_table_show (vty, argc, argv, ospf6->route_table);
+ ospf6_route_table_show (vty, 4, argc, argv, ospf6->route_table);
return CMD_SUCCESS;
}
@@ -868,10 +817,9 @@ DEFUN (show_ipv6_ospf6_route_match_detail,
"Detailed information\n"
)
{
- /* CHECK ME argc referenced below */
OSPF6_CMD_CHECK_RUNNING ();
- ospf6_route_table_show (vty, argc, argv, ospf6->route_table);
+ ospf6_route_table_show (vty, 4, argc, argv, ospf6->route_table);
return CMD_SUCCESS;
}
@@ -891,10 +839,9 @@ DEFUN (show_ipv6_ospf6_route_type_detail,
"Detailed information\n"
)
{
- /* CHECK ME argc referenced below */
OSPF6_CMD_CHECK_RUNNING ();
- ospf6_route_table_show (vty, argc, argv, ospf6->route_table);
+ ospf6_route_table_show (vty, 4, argc, argv, ospf6->route_table);
return CMD_SUCCESS;
}
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index 44d1bbfaf..ded8041cb 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -707,18 +707,9 @@ ospf6_zebra_init (struct thread_master *master)
/* Debug */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf6 zebra",
- * DEBUG_STR
- * OSPF6_STR
- * "Debug connection between zebra\n"
- *
- *
- */
DEFUN (debug_ospf6_zebra_sendrecv,
debug_ospf6_zebra_sendrecv_cmd,
- "debug ospf6 zebra <send|recv>",
+ "debug ospf6 zebra [<send|recv>]",
DEBUG_STR
OSPF6_STR
"Debug connection between zebra\n"
@@ -726,15 +717,14 @@ DEFUN (debug_ospf6_zebra_sendrecv,
"Debug Receiving zebra\n"
)
{
- /* CHECK ME argc referenced below */
int idx_send_recv = 3;
unsigned char level = 0;
- if (argc)
+ if (argc == 4)
{
- if (! strncmp (argv[idx_send_recv]->arg, "s", 1))
+ if (strmatch(argv[idx_send_recv]->text, "send"))
level = OSPF6_DEBUG_ZEBRA_SEND;
- else if (! strncmp (argv[idx_send_recv]->arg, "r", 1))
+ else if (strmatch(argv[idx_send_recv]->text, "recv"))
level = OSPF6_DEBUG_ZEBRA_RECV;
}
else
@@ -744,21 +734,9 @@ DEFUN (debug_ospf6_zebra_sendrecv,
return CMD_SUCCESS;
}
-
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf6 zebra",
- * NO_STR
- * DEBUG_STR
- * OSPF6_STR
- * "Debug connection between zebra\n"
- *
- *
- */
DEFUN (no_debug_ospf6_zebra_sendrecv,
no_debug_ospf6_zebra_sendrecv_cmd,
- "no debug ospf6 zebra <send|recv>",
+ "no debug ospf6 zebra [<send|recv>]",
NO_STR
DEBUG_STR
OSPF6_STR
@@ -767,15 +745,14 @@ DEFUN (no_debug_ospf6_zebra_sendrecv,
"Debug Receiving zebra\n"
)
{
- /* CHECK ME argc referenced below */
int idx_send_recv = 4;
unsigned char level = 0;
- if (argc)
+ if (argc == 5)
{
- if (! strncmp (argv[idx_send_recv]->arg, "s", 1))
+ if (strmatch(argv[idx_send_recv]->text, "send"))
level = OSPF6_DEBUG_ZEBRA_SEND;
- else if (! strncmp (argv[idx_send_recv]->arg, "r", 1))
+ else if (strmatch(argv[idx_send_recv]->text, "recv"))
level = OSPF6_DEBUG_ZEBRA_RECV;
}
else
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index 08afb75d2..de5c91828 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -1028,11 +1028,11 @@ debug_ospf_nsm_common (struct vty *vty, int arg_base, int argc, struct cmd_token
DEBUG_ON (nsm, NSM);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "s", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "status"))
DEBUG_ON (nsm, NSM_STATUS);
- else if (strncmp (argv[arg_base + 0]->arg, "e", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "events"))
DEBUG_ON (nsm, NSM_EVENTS);
- else if (strncmp (argv[arg_base + 0]->arg, "t", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "timers"))
DEBUG_ON (nsm, NSM_TIMERS);
}
@@ -1044,61 +1044,41 @@ debug_ospf_nsm_common (struct vty *vty, int arg_base, int argc, struct cmd_token
TERM_DEBUG_ON (nsm, NSM);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "s", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "status"))
TERM_DEBUG_ON (nsm, NSM_STATUS);
- else if (strncmp (argv[arg_base + 0]->arg, "e", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "events"))
TERM_DEBUG_ON (nsm, NSM_EVENTS);
- else if (strncmp (argv[arg_base + 0]->arg, "t", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "timers"))
TERM_DEBUG_ON (nsm, NSM_TIMERS);
}
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf nsm (status|events|timers)",
- * DEBUG_STR
- * OSPF_STR
- * "OSPF Neighbor State Machine\n"
- * "NSM Status Information\n"
- * "NSM Event Information\n"
- * "NSM Timer Information\n"
- *
- */
DEFUN (debug_ospf_nsm,
debug_ospf_nsm_cmd,
- "debug ospf nsm",
+ "debug ospf nsm [status|events|timers]",
DEBUG_STR
OSPF_STR
- "OSPF Neighbor State Machine\n")
+ "OSPF Neighbor State Machine\n"
+ "NSM Status Information\n"
+ "NSM Event Information\n"
+ "NSM Timer Information\n")
{
- /* CHECK ME argc referenced below */
- return debug_ospf_nsm_common (vty, 0, argc, argv);
+ return debug_ospf_nsm_common (vty, 3, argc, argv);
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf <1-65535> nsm (status|events|timers)",
- * DEBUG_STR
- * OSPF_STR
- * "Instance ID\n"
- * "OSPF Neighbor State Machine\n"
- * "NSM Status Information\n"
- * "NSM Event Information\n"
- * "NSM Timer Information\n"
- *
- */
DEFUN (debug_ospf_instance_nsm,
debug_ospf_instance_nsm_cmd,
- "debug ospf (1-65535) nsm",
+ "debug ospf (1-65535) nsm [status|events|timers]",
DEBUG_STR
OSPF_STR
"Instance ID\n"
- "OSPF Neighbor State Machine\n")
+ "OSPF Neighbor State Machine\n"
+ "NSM Status Information\n"
+ "NSM Event Information\n"
+ "NSM Timer Information\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 2;
u_short instance = 0;
@@ -1106,7 +1086,7 @@ DEFUN (debug_ospf_instance_nsm,
if (!ospf_lookup_instance (instance))
return CMD_SUCCESS;
- return debug_ospf_nsm_common (vty, 1, argc, argv);
+ return debug_ospf_nsm_common (vty, 4, argc, argv);
}
@@ -1119,11 +1099,11 @@ no_debug_ospf_nsm_common (struct vty *vty, int arg_base, int argc, struct cmd_to
DEBUG_OFF (nsm, NSM);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "s", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "status"))
DEBUG_OFF (nsm, NSM_STATUS);
- else if (strncmp (argv[arg_base + 0]->arg, "e", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "events"))
DEBUG_OFF (nsm, NSM_EVENTS);
- else if (strncmp (argv[arg_base + 0]->arg, "t", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "timers"))
DEBUG_OFF (nsm, NSM_TIMERS);
}
@@ -1135,65 +1115,44 @@ no_debug_ospf_nsm_common (struct vty *vty, int arg_base, int argc, struct cmd_to
TERM_DEBUG_OFF (nsm, NSM);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "s", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "status"))
TERM_DEBUG_OFF (nsm, NSM_STATUS);
- else if (strncmp (argv[arg_base + 0]->arg, "e", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "events"))
TERM_DEBUG_OFF (nsm, NSM_EVENTS);
- else if (strncmp (argv[arg_base + 0]->arg, "t", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "timers"))
TERM_DEBUG_OFF (nsm, NSM_TIMERS);
}
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf nsm (status|events|timers)",
- * NO_STR
- * "Debugging functions\n"
- * "OSPF information\n"
- * "OSPF Interface State Machine\n"
- * "NSM Status Information\n"
- * "NSM Event Information\n"
- * "NSM Timer Information\n"
- *
- */
DEFUN (no_debug_ospf_nsm,
no_debug_ospf_nsm_cmd,
- "no debug ospf nsm",
+ "no debug ospf nsm [status|events|timers]",
NO_STR
DEBUG_STR
OSPF_STR
- "OSPF Neighbor State Machine")
+ "OSPF Neighbor State Machine"
+ "NSM Status Information\n"
+ "NSM Event Information\n"
+ "NSM Timer Information\n")
{
- /* CHECK ME argc referenced below */
- return no_debug_ospf_nsm_common(vty, 0, argc, argv);
+ return no_debug_ospf_nsm_common(vty, 4, argc, argv);
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf <1-65535> nsm (status|events|timers)",
- * NO_STR
- * "Debugging functions\n"
- * "OSPF information\n"
- * "Instance ID\n"
- * "OSPF Interface State Machine\n"
- * "NSM Status Information\n"
- * "NSM Event Information\n"
- * "NSM Timer Information\n"
- *
- */
DEFUN (no_debug_ospf_instance_nsm,
no_debug_ospf_instance_nsm_cmd,
- "no debug ospf (1-65535) nsm",
+ "no debug ospf (1-65535) nsm [status|events|timers]",
NO_STR
DEBUG_STR
OSPF_STR
"Instance ID\n"
- "OSPF Neighbor State Machine")
+ "OSPF Neighbor State Machine"
+ "NSM Status Information\n"
+ "NSM Event Information\n"
+ "NSM Timer Information\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 3;
u_short instance = 0;
@@ -1201,11 +1160,10 @@ DEFUN (no_debug_ospf_instance_nsm,
if (!ospf_lookup_instance (instance))
return CMD_SUCCESS;
- return no_debug_ospf_nsm_common(vty, 1, argc, argv);
+ return no_debug_ospf_nsm_common(vty, 5, argc, argv);
}
-
static int
debug_ospf_lsa_common (struct vty *vty, int arg_base, int argc, struct cmd_token **argv)
{
@@ -1215,13 +1173,13 @@ debug_ospf_lsa_common (struct vty *vty, int arg_base, int argc, struct cmd_token
DEBUG_ON (lsa, LSA);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "g", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "generate"))
DEBUG_ON (lsa, LSA_GENERATE);
- else if (strncmp (argv[arg_base + 0]->arg, "f", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "flooding"))
DEBUG_ON (lsa, LSA_FLOODING);
- else if (strncmp (argv[arg_base + 0]->arg, "i", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "install"))
DEBUG_ON (lsa, LSA_INSTALL);
- else if (strncmp (argv[arg_base + 0]->arg, "r", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "refresh"))
DEBUG_ON (lsa, LSA_REFRESH);
}
@@ -1233,65 +1191,45 @@ debug_ospf_lsa_common (struct vty *vty, int arg_base, int argc, struct cmd_token
TERM_DEBUG_ON (lsa, LSA);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "g", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "generate"))
TERM_DEBUG_ON (lsa, LSA_GENERATE);
- else if (strncmp (argv[arg_base + 0]->arg, "f", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "flooding"))
TERM_DEBUG_ON (lsa, LSA_FLOODING);
- else if (strncmp (argv[arg_base + 0]->arg, "i", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "install"))
TERM_DEBUG_ON (lsa, LSA_INSTALL);
- else if (strncmp (argv[arg_base + 0]->arg, "r", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "refresh"))
TERM_DEBUG_ON (lsa, LSA_REFRESH);
}
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf lsa (generate|flooding|install|refresh)",
- * DEBUG_STR
- * OSPF_STR
- * "OSPF Link State Advertisement\n"
- * "LSA Generation\n"
- * "LSA Flooding\n"
- * "LSA Install/Delete\n"
- * "LSA Refresh\n"
- *
- */
DEFUN (debug_ospf_lsa,
debug_ospf_lsa_cmd,
- "debug ospf lsa",
+ "debug ospf lsa [generate|flooding|install|refresh]",
DEBUG_STR
OSPF_STR
- "OSPF Link State Advertisement\n")
+ "OSPF Link State Advertisement\n"
+ "LSA Generation\n"
+ "LSA Flooding\n"
+ "LSA Install/Delete\n"
+ "LSA Refresh\n")
{
- /* CHECK ME argc referenced below */
- return debug_ospf_lsa_common(vty, 0, argc, argv);
+ return debug_ospf_lsa_common(vty, 3, argc, argv);
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf <1-65535> lsa (generate|flooding|install|refresh)",
- * DEBUG_STR
- * OSPF_STR
- * "Instance ID\n"
- * "OSPF Link State Advertisement\n"
- * "LSA Generation\n"
- * "LSA Flooding\n"
- * "LSA Install/Delete\n"
- * "LSA Refresh\n"
- *
- */
DEFUN (debug_ospf_instance_lsa,
debug_ospf_instance_lsa_cmd,
- "debug ospf (1-65535) lsa",
+ "debug ospf (1-65535) lsa [generate|flooding|install|refresh]",
DEBUG_STR
OSPF_STR
"Instance ID\n"
- "OSPF Link State Advertisement\n")
+ "OSPF Link State Advertisement\n"
+ "LSA Generation\n"
+ "LSA Flooding\n"
+ "LSA Install/Delete\n"
+ "LSA Refresh\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 2;
u_short instance = 0;
@@ -1299,7 +1237,7 @@ DEFUN (debug_ospf_instance_lsa,
if (!ospf_lookup_instance (instance))
return CMD_SUCCESS;
- return debug_ospf_lsa_common(vty, 1, argc, argv);
+ return debug_ospf_lsa_common(vty, 4, argc, argv);
}
@@ -1312,13 +1250,13 @@ no_debug_ospf_lsa_common (struct vty *vty, int arg_base, int argc, struct cmd_to
DEBUG_OFF (lsa, LSA);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "g", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "generate"))
DEBUG_OFF (lsa, LSA_GENERATE);
- else if (strncmp (argv[arg_base + 0]->arg, "f", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "flooding"))
DEBUG_OFF (lsa, LSA_FLOODING);
- else if (strncmp (argv[arg_base + 0]->arg, "i", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "install"))
DEBUG_OFF (lsa, LSA_INSTALL);
- else if (strncmp (argv[arg_base + 0]->arg, "r", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "refresh"))
DEBUG_OFF (lsa, LSA_REFRESH);
}
@@ -1330,69 +1268,47 @@ no_debug_ospf_lsa_common (struct vty *vty, int arg_base, int argc, struct cmd_to
TERM_DEBUG_OFF (lsa, LSA);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "g", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "generate"))
TERM_DEBUG_OFF (lsa, LSA_GENERATE);
- else if (strncmp (argv[arg_base + 0]->arg, "f", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "flooding"))
TERM_DEBUG_OFF (lsa, LSA_FLOODING);
- else if (strncmp (argv[arg_base + 0]->arg, "i", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "install"))
TERM_DEBUG_OFF (lsa, LSA_INSTALL);
- else if (strncmp (argv[arg_base + 0]->arg, "r", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "refresh"))
TERM_DEBUG_OFF (lsa, LSA_REFRESH);
}
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf lsa (generate|flooding|install|refresh)",
- * NO_STR
- * DEBUG_STR
- * OSPF_STR
- * "OSPF Link State Advertisement\n"
- * "LSA Generation\n"
- * "LSA Flooding\n"
- * "LSA Install/Delete\n"
- * "LSA Refres\n"
- *
- */
DEFUN (no_debug_ospf_lsa,
no_debug_ospf_lsa_cmd,
- "no debug ospf lsa",
+ "no debug ospf lsa [generate|flooding|install|refresh]",
NO_STR
DEBUG_STR
OSPF_STR
- "OSPF Link State Advertisement\n")
+ "OSPF Link State Advertisement\n"
+ "LSA Generation\n"
+ "LSA Flooding\n"
+ "LSA Install/Delete\n"
+ "LSA Refres\n")
{
- /* CHECK ME argc referenced below */
- return no_debug_ospf_lsa_common (vty, 0, argc, argv);
+ return no_debug_ospf_lsa_common (vty, 4, argc, argv);
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf <1-65535> lsa (generate|flooding|install|refresh)",
- * NO_STR
- * DEBUG_STR
- * OSPF_STR
- * "Instance ID\n"
- * "OSPF Link State Advertisement\n"
- * "LSA Generation\n"
- * "LSA Flooding\n"
- * "LSA Install/Delete\n"
- * "LSA Refres\n"
- *
- */
DEFUN (no_debug_ospf_instance_lsa,
no_debug_ospf_instance_lsa_cmd,
- "no debug ospf (1-65535) lsa",
+ "no debug ospf (1-65535) lsa [generate|flooding|install|refresh]",
NO_STR
DEBUG_STR
OSPF_STR
"Instance ID\n"
- "OSPF Link State Advertisement\n")
+ "OSPF Link State Advertisement\n"
+ "LSA Generation\n"
+ "LSA Flooding\n"
+ "LSA Install/Delete\n"
+ "LSA Refres\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 3;
u_short instance = 0;
@@ -1400,11 +1316,10 @@ DEFUN (no_debug_ospf_instance_lsa,
if (!ospf_lookup_instance (instance))
return CMD_SUCCESS;
- return no_debug_ospf_lsa_common (vty, 1, argc, argv);
+ return no_debug_ospf_lsa_common (vty, 5, argc, argv);
}
-
static int
debug_ospf_zebra_common (struct vty *vty, int arg_base, int argc, struct cmd_token **argv)
{
@@ -1414,9 +1329,9 @@ debug_ospf_zebra_common (struct vty *vty, int arg_base, int argc, struct cmd_tok
DEBUG_ON (zebra, ZEBRA);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "i", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "interface"))
DEBUG_ON (zebra, ZEBRA_INTERFACE);
- else if (strncmp (argv[arg_base + 0]->arg, "r", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "redistribute"))
DEBUG_ON (zebra, ZEBRA_REDISTRIBUTE);
}
@@ -1428,57 +1343,37 @@ debug_ospf_zebra_common (struct vty *vty, int arg_base, int argc, struct cmd_tok
TERM_DEBUG_ON (zebra, ZEBRA);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "i", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "interface"))
TERM_DEBUG_ON (zebra, ZEBRA_INTERFACE);
- else if (strncmp (argv[arg_base + 0]->arg, "r", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "redistribute"))
TERM_DEBUG_ON (zebra, ZEBRA_REDISTRIBUTE);
}
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf zebra (interface|redistribute)",
- * DEBUG_STR
- * OSPF_STR
- * "OSPF Zebra information\n"
- * "Zebra interface\n"
- * "Zebra redistribute\n"
- *
- */
DEFUN (debug_ospf_zebra,
debug_ospf_zebra_cmd,
- "debug ospf zebra",
+ "debug ospf zebra [interface|redistribute]",
DEBUG_STR
OSPF_STR
- "OSPF Zebra information\n")
+ "OSPF Zebra information\n"
+ "Zebra interface\n"
+ "Zebra redistribute\n")
{
- /* CHECK ME argc referenced below */
- return debug_ospf_zebra_common(vty, 0, argc, argv);
+ return debug_ospf_zebra_common(vty, 3, argc, argv);
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "debug ospf <1-65535> zebra (interface|redistribute)",
- * DEBUG_STR
- * OSPF_STR
- * "Instance ID\n"
- * "OSPF Zebra information\n"
- * "Zebra interface\n"
- * "Zebra redistribute\n"
- *
- */
DEFUN (debug_ospf_instance_zebra,
debug_ospf_instance_zebra_cmd,
- "debug ospf (1-65535) zebra",
+ "debug ospf (1-65535) zebra [interface|redistribute]",
DEBUG_STR
OSPF_STR
"Instance ID\n"
- "OSPF Zebra information\n")
+ "OSPF Zebra information\n"
+ "Zebra interface\n"
+ "Zebra redistribute\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 2;
u_short instance = 0;
@@ -1486,7 +1381,7 @@ DEFUN (debug_ospf_instance_zebra,
if (!ospf_lookup_instance (instance))
return CMD_SUCCESS;
- return debug_ospf_zebra_common(vty, 1, argc, argv);
+ return debug_ospf_zebra_common(vty, 4, argc, argv);
}
@@ -1500,9 +1395,9 @@ no_debug_ospf_zebra_common(struct vty *vty, int arg_base, int argc,
DEBUG_OFF (zebra, ZEBRA);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "i", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "interface"))
DEBUG_OFF (zebra, ZEBRA_INTERFACE);
- else if (strncmp (argv[arg_base + 0]->arg, "r", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "redistribute"))
DEBUG_OFF (zebra, ZEBRA_REDISTRIBUTE);
}
@@ -1514,61 +1409,39 @@ no_debug_ospf_zebra_common(struct vty *vty, int arg_base, int argc,
TERM_DEBUG_OFF (zebra, ZEBRA);
else if (argc == arg_base + 1)
{
- if (strncmp (argv[arg_base + 0]->arg, "i", 1) == 0)
+ if (strmatch(argv[arg_base]->text, "interface"))
TERM_DEBUG_OFF (zebra, ZEBRA_INTERFACE);
- else if (strncmp (argv[arg_base + 0]->arg, "r", 1) == 0)
+ else if (strmatch(argv[arg_base]->text, "redistribute"))
TERM_DEBUG_OFF (zebra, ZEBRA_REDISTRIBUTE);
}
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf zebra (interface|redistribute)",
- * NO_STR
- * DEBUG_STR
- * OSPF_STR
- * "OSPF Zebra information\n"
- * "Zebra interface\n"
- * "Zebra redistribute\n"
- *
- */
DEFUN (no_debug_ospf_zebra,
no_debug_ospf_zebra_cmd,
- "no debug ospf zebra",
+ "no debug ospf zebra [interface|redistribute]",
NO_STR
DEBUG_STR
OSPF_STR
- "OSPF Zebra information\n")
+ "OSPF Zebra information\n"
+ "Zebra interface\n"
+ "Zebra redistribute\n")
{
- /* CHECK ME argc referenced below */
- return no_debug_ospf_zebra_common(vty, 0, argc, argv);
+ return no_debug_ospf_zebra_common(vty, 4, argc, argv);
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no debug ospf <1-65535> zebra (interface|redistribute)",
- * NO_STR
- * DEBUG_STR
- * OSPF_STR
- * "Instance ID\n"
- * "OSPF Zebra information\n"
- * "Zebra interface\n"
- * "Zebra redistribute\n"
- *
- */
DEFUN (no_debug_ospf_instance_zebra,
no_debug_ospf_instance_zebra_cmd,
- "no debug ospf (1-65535) zebra",
+ "no debug ospf (1-65535) zebra [interface|redistribute]",
NO_STR
DEBUG_STR
OSPF_STR
"Instance ID\n"
- "OSPF Zebra information\n")
+ "OSPF Zebra information\n"
+ "Zebra interface\n"
+ "Zebra redistribute\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 3;
u_short instance = 0;
@@ -1576,7 +1449,7 @@ DEFUN (no_debug_ospf_instance_zebra,
if (!ospf_lookup_instance (instance))
return CMD_SUCCESS;
- return no_debug_ospf_zebra_common(vty, 1, argc, argv);
+ return no_debug_ospf_zebra_common(vty, 5, argc, argv);
}
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index ecf883c69..a1981be86 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -792,7 +792,6 @@ DEFUN (ospf_opaque,
"OSPF specific commands\n"
"Enable the Opaque-LSA capability (rfc2370)\n")
{
- /* CHECK ME argc referenced below */
return capability_opaque (self, vty, argc, argv);
}
@@ -827,7 +826,6 @@ DEFUN (no_ospf_opaque,
"OSPF specific commands\n"
"Enable the Opaque-LSA capability (rfc2370)\n")
{
- /* CHECK ME argc referenced below */
return no_capability_opaque (self, vty, argc, argv);
}
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index ac9f9c7d3..26034fd36 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -2620,13 +2620,12 @@ DEFUN (show_ip_ospf_mpls_te_link,
"Interface information\n"
"Interface name\n")
{
- /* CHECK ME argc referenced below */
int idx_interface = 5;
struct interface *ifp;
struct listnode *node, *nnode;
/* Show All Interfaces. */
- if (argc == 0)
+ if (argc == 5)
{
for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT), node, nnode, ifp))
show_mpls_te_link_sub (vty, ifp);