diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-09-30 15:38:08 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-09-30 15:38:08 +0200 |
commit | 093d7a3a3413250e8328abebd372bb695f874ca8 (patch) | |
tree | 54d7c5e1912c16b80279b3d5b5439d539574f062 /ospf6d | |
parent | ospf6d: scrubbed some argc CHECK MEs (diff) | |
download | frr-093d7a3a3413250e8328abebd372bb695f874ca8.tar.xz frr-093d7a3a3413250e8328abebd372bb695f874ca8.zip |
ospf6d: scrubbed some argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'ospf6d')
-rw-r--r-- | ospf6d/ospf6_area.c | 41 | ||||
-rw-r--r-- | ospf6d/ospf6_interface.c | 81 | ||||
-rw-r--r-- | ospf6d/ospf6_route.c | 5 | ||||
-rw-r--r-- | ospf6d/ospf6d.c | 285 |
4 files changed, 64 insertions, 348 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index bd9c0bcb2..766562a82 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -433,44 +433,21 @@ ospf6_area_show (struct vty *vty, struct ospf6_area *oa) oa = ospf6_area_get (area_id, ospf6); \ } -/* - * CHECK ME - The following ALIASes need to be implemented in this DEFUN - * "area (A.B.C.D|<0-4294967295>) range X:X::X:X/M advertise cost <0-16777215>", - * "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" - * - * "area A.B.C.D range X:X::X:X/M (advertise|not-advertise)", - * "OSPF area parameters\n" - * OSPF6_AREA_ID_STR - * "Configured address range\n" - * "Specify IPv6 prefix\n" - * - * - * "area (A.B.C.D|<0-4294967295>) range X:X::X:X/M cost <0-16777215>", - * "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 (area_range, area_range_cmd, - "area A.B.C.D range X:X::X:X/M", + "area <A.B.C.D|(0-4294967295) range X:X::X:X/M [<advertise|not-advertise|cost (0-16777215)>]", "OSPF area parameters\n" OSPF6_AREA_ID_STR "Configured address range\n" "Specify IPv6 prefix\n" - ) + "Advertise\n" + "Do not advertise\n" + "User specified metric for this range\n" + "Advertised metric for this range\n") { - /* CHECK ME argc referenced below */ int idx_ipv4 = 1; int idx_ipv6_prefixlen = 3; + int idx_type = 4; int ret; struct ospf6_area *oa; struct prefix prefix; @@ -498,13 +475,13 @@ DEFUN (area_range, (u_int32_t) htonl(ospf6_new_range_ls_id (oa->range_table)); } - if (argc > 2) + if (argc > idx_type) { - if (strcmp (argv[4]->arg, "not-advertise") == 0) + if (strmatch (argv[idx_type]->text, "not-advertise")) { SET_FLAG (range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE); } - else if (strcmp (argv[4]->arg, "advertise") == 0) + else if (strmatch (argv[idx_type]->text, "advertise")) { UNSET_FLAG (range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE); } diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 5002222f1..27788745d 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1019,46 +1019,22 @@ DEFUN (show_ipv6_ospf6_interface, return CMD_SUCCESS; } - -/* - * CHECK ME - The following ALIASes need to be implemented in this DEFUN - * "show ipv6 ospf6 interface IFNAME prefix (X:X::X:X|X:X::X:X/M|detail)", - * SHOW_STR - * IP6_STR - * OSPF6_STR - * INTERFACE_STR - * IFNAME_STR - * "Display connected prefixes to advertise\n" - * OSPF6_ROUTE_ADDRESS_STR - * OSPF6_ROUTE_PREFIX_STR - * "Display details of the prefixes\n" - * - * - * "show ipv6 ospf6 interface IFNAME prefix X:X::X:X/M (match|detail)", - * SHOW_STR - * IP6_STR - * OSPF6_STR - * INTERFACE_STR - * IFNAME_STR - * "Display connected prefixes to advertise\n" - * OSPF6_ROUTE_PREFIX_STR - * OSPF6_ROUTE_MATCH_STR - * "Display details of the prefixes\n" - * - * - */ DEFUN (show_ipv6_ospf6_interface_ifname_prefix, show_ipv6_ospf6_interface_ifname_prefix_cmd, - "show ipv6 ospf6 interface IFNAME prefix", + "show ipv6 ospf6 interface IFNAME prefix [<X:X::X:X|X:X::X:X/M>] [<match|detail>]", SHOW_STR IP6_STR OSPF6_STR INTERFACE_STR IFNAME_STR - "Display connected prefixes to advertise\n") + "Display connected prefixes to advertise\n" + OSPF6_ROUTE_ADDRESS_STR + OSPF6_ROUTE_PREFIX_STR + OSPF6_ROUTE_MATCH_STR + "Display details of the prefixes\n") { - /* CHECK ME argc referenced below */ int idx_ifname = 4; + int idx_prefix = 6; struct interface *ifp; struct ospf6_interface *oi; @@ -1076,49 +1052,25 @@ DEFUN (show_ipv6_ospf6_interface_ifname_prefix, return CMD_WARNING; } - ospf6_route_table_show (vty, 6, argc, argv, oi->route_connected); + ospf6_route_table_show (vty, idx_prefix, argc, argv, oi->route_connected); return CMD_SUCCESS; } - - -/* - * CHECK ME - The following ALIASes need to be implemented in this DEFUN - * "show ipv6 ospf6 interface prefix X:X::X:X/M (match|detail)", - * SHOW_STR - * IP6_STR - * OSPF6_STR - * INTERFACE_STR - * "Display connected prefixes to advertise\n" - * OSPF6_ROUTE_PREFIX_STR - * OSPF6_ROUTE_MATCH_STR - * "Display details of the prefixes\n" - * - * - * "show ipv6 ospf6 interface prefix (X:X::X:X|X:X::X:X/M|detail)", - * SHOW_STR - * IP6_STR - * OSPF6_STR - * INTERFACE_STR - * "Display connected prefixes to advertise\n" - * OSPF6_ROUTE_ADDRESS_STR - * OSPF6_ROUTE_PREFIX_STR - * "Display details of the prefixes\n" - * - * - */ DEFUN (show_ipv6_ospf6_interface_prefix, show_ipv6_ospf6_interface_prefix_cmd, - "show ipv6 ospf6 interface prefix", + "show ipv6 ospf6 interface prefix [<X:X::X:X|X:X::X:X/M>] [<match|detail>]", SHOW_STR IP6_STR OSPF6_STR INTERFACE_STR "Display connected prefixes to advertise\n" - ) + OSPF6_ROUTE_ADDRESS_STR + OSPF6_ROUTE_PREFIX_STR + OSPF6_ROUTE_MATCH_STR + "Display details of the prefixes\n") { - /* CHECK ME argc referenced below */ + int idx_prefix = 5; struct listnode *i; struct ospf6_interface *oi; struct interface *ifp; @@ -1129,15 +1081,12 @@ DEFUN (show_ipv6_ospf6_interface_prefix, if (oi == NULL) continue; - ospf6_route_table_show (vty, 5, argc, argv, oi->route_connected); + ospf6_route_table_show (vty, idx_prefix, argc, argv, oi->route_connected); } return CMD_SUCCESS; } - - - /* interface variable set command */ DEFUN (ipv6_ospf6_ifmtu, ipv6_ospf6_ifmtu_cmd, diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 58bb2fc80..3263f4a06 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -1473,7 +1473,8 @@ ospf6_linkstate_show_table (struct vty *vty, int detail, } int -ospf6_linkstate_table_show (struct vty *vty, int argc, struct cmd_token **argv, +ospf6_linkstate_table_show (struct vty *vty, int idx_ipv4, int argc, + struct cmd_token **argv, struct ospf6_route_table *table) { int detail = 0; @@ -1486,7 +1487,7 @@ ospf6_linkstate_table_show (struct vty *vty, int argc, struct cmd_token **argv, memset (&id, 0, sizeof (struct prefix)); memset (&prefix, 0, sizeof (struct prefix)); - for (i = 0; i < argc; i++) + for (i = idx_ipv4; i < argc; i++) { if (! strcmp (argv[i]->arg, "detail")) { diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index e825f6ad1..785c9361c 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -285,56 +285,21 @@ DEFUN (show_ipv6_ospf6_database_type, return CMD_SUCCESS; } - -/* - * CHECK ME - The following ALIASes need to be implemented in this DEFUN - * "show ipv6 ospf6 database * A.B.C.D (detail|dump|internal)", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Any Link state Type\n" - * "Specify Link state ID as IPv4 address notation\n" - * "Display details of LSAs\n" - * "Dump LSAs\n" - * "Display LSA's internal information\n" - * - * - * "show ipv6 ospf6 database linkstate-id A.B.C.D (detail|dump|internal)", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Search by Link state ID\n" - * "Specify Link state ID as IPv4 address notation\n" - * "Display details of LSAs\n" - * "Dump LSAs\n" - * "Display LSA's internal information\n" - * - * - * "show ipv6 ospf6 database linkstate-id A.B.C.D", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Search by Link state ID\n" - * "Specify Link state ID as IPv4 address notation\n" - * - * - */ DEFUN (show_ipv6_ospf6_database_id, show_ipv6_ospf6_database_id_cmd, - "show ipv6 ospf6 database * A.B.C.D", + "show ipv6 ospf6 database <*|linkstate-id> A.B.C.D [<detail|dump|internal>]", SHOW_STR IPV6_STR OSPF6_STR "Display Link state database\n" "Any Link state Type\n" + "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" - ) + "Display details of LSAs\n" + "Dump LSAs\n" + "Display LSA's internal information\n") { - /* CHECK ME argc referenced below */ - int idx_ipv4 = 5; + int idx_ipv4 = 4; int idx_level = 6; int level; struct listnode *i, *j; @@ -344,7 +309,10 @@ DEFUN (show_ipv6_ospf6_database_id, u_int32_t id = 0; OSPF6_CMD_CHECK_RUNNING (); - inet_pton (AF_INET, argv[idx_ipv4]->arg, &id); + + if (argv[idx_ipv4]->type == IPV4_TKN) + inet_pton (AF_INET, argv[idx_ipv4]->arg, &id); + level = parse_show_level (idx_level, argc, argv); for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) @@ -370,59 +338,21 @@ DEFUN (show_ipv6_ospf6_database_id, return CMD_SUCCESS; } - - - -/* - * CHECK ME - The following ALIASes need to be implemented in this DEFUN - * "show ipv6 ospf6 database * * A.B.C.D (detail|dump|internal)", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Any Link state Type\n" - * "Any Link state ID\n" - * "Specify Advertising Router as IPv4 address notation\n" - * "Display details of LSAs\n" - * "Dump LSAs\n" - * "Display LSA's internal information\n" - * - * - * "show ipv6 ospf6 database adv-router A.B.C.D", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Search by Advertising Router\n" - * "Specify Advertising Router as IPv4 address notation\n" - * - * - * "show ipv6 ospf6 database adv-router A.B.C.D (detail|dump|internal)", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Search by Advertising Router\n" - * "Specify Advertising Router as IPv4 address notation\n" - * "Display details of LSAs\n" - * "Dump LSAs\n" - * "Display LSA's internal information\n" - * - * - */ DEFUN (show_ipv6_ospf6_database_router, show_ipv6_ospf6_database_router_cmd, - "show ipv6 ospf6 database * * A.B.C.D", + "show ipv6 ospf6 database <*|adv-router> * A.B.C.D <detail|dump|internal>", SHOW_STR IPV6_STR OSPF6_STR "Display Link state database\n" "Any Link state Type\n" + "Search by Advertising Router\n" "Any Link state ID\n" "Specify Advertising Router as IPv4 address notation\n" - ) + "Display details of LSAs\n" + "Dump LSAs\n" + "Display LSA's internal information\n") { - /* CHECK ME argc referenced below */ int idx_ipv4 = 6; int idx_level = 7; int level; @@ -459,74 +389,9 @@ DEFUN (show_ipv6_ospf6_database_router, return CMD_SUCCESS; } - - - -/* - * CHECK ME - The following ALIASes need to be implemented in this DEFUN - * "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D (detail|dump|internal)", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Display Router LSAs\n" - * "Display Network LSAs\n" - * "Display Inter-Area-Prefix LSAs\n" - * "Display Inter-Area-Router LSAs\n" - * "Display As-External LSAs\n" - * "Display Group-Membership LSAs\n" - * "Display Type-7 LSAs\n" - * "Display Link LSAs\n" - * "Display Intra-Area-Prefix LSAs\n" - * "Search by Link state ID\n" - * "Specify Link state ID as IPv4 address notation\n" - * "Display details of LSAs\n" - * "Dump LSAs\n" - * "Display LSA's internal information\n" - * - * - * "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) A.B.C.D (detail|dump|internal)", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Display Router LSAs\n" - * "Display Network LSAs\n" - * "Display Inter-Area-Prefix LSAs\n" - * "Display Inter-Area-Router LSAs\n" - * "Display As-External LSAs\n" - * "Display Group-Membership LSAs\n" - * "Display Type-7 LSAs\n" - * "Display Link LSAs\n" - * "Display Intra-Area-Prefix LSAs\n" - * "Specify Link state ID as IPv4 address notation\n" - * "Display details of LSAs\n" - * "Dump LSAs\n" - * "Display LSA's internal information\n" - * - * - * "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Display Router LSAs\n" - * "Display Network LSAs\n" - * "Display Inter-Area-Prefix LSAs\n" - * "Display Inter-Area-Router LSAs\n" - * "Display As-External LSAs\n" - * "Display Group-Membership LSAs\n" - * "Display Type-7 LSAs\n" - * "Display Link LSAs\n" - * "Display Intra-Area-Prefix LSAs\n" - * "Search by Link state ID\n" - * "Specify Link state ID as IPv4 address notation\n" - * - * - */ DEFUN (show_ipv6_ospf6_database_type_id, show_ipv6_ospf6_database_type_id_cmd, - "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> A.B.C.D", + "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> [linkstate-id] A.B.C.D [<detail|dump|internal>]", SHOW_STR IPV6_STR OSPF6_STR @@ -540,13 +405,16 @@ DEFUN (show_ipv6_ospf6_database_type_id, "Display Type-7 LSAs\n" "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n" + "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" + "Display details of LSAs\n" + "Dump LSAs\n" + "Display LSA's internal information\n" ) { - /* CHECK ME argc referenced below */ int idx_lsa = 4; - int idx_ipv4 = 5; - int idx_level = 6; + int idx_ipv4 = 6; + int idx_level = 7; int level; struct listnode *i, *j; struct ospf6 *o = ospf6; @@ -597,75 +465,9 @@ DEFUN (show_ipv6_ospf6_database_type_id, return CMD_SUCCESS; } - - - -/* - * CHECK ME - The following ALIASes need to be implemented in this DEFUN - * "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) * A.B.C.D (detail|dump|internal)", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Display Router LSAs\n" - * "Display Network LSAs\n" - * "Display Inter-Area-Prefix LSAs\n" - * "Display Inter-Area-Router LSAs\n" - * "Display As-External LSAs\n" - * "Display Group-Membership LSAs\n" - * "Display Type-7 LSAs\n" - * "Display Link LSAs\n" - * "Display Intra-Area-Prefix LSAs\n" - * "Any Link state ID\n" - * "Specify Advertising Router as IPv4 address notation\n" - * "Display details of LSAs\n" - * "Dump LSAs\n" - * "Display LSA's internal information\n" - * - * - * "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) adv-router A.B.C.D (detail|dump|internal)", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Display Router LSAs\n" - * "Display Network LSAs\n" - * "Display Inter-Area-Prefix LSAs\n" - * "Display Inter-Area-Router LSAs\n" - * "Display As-External LSAs\n" - * "Display Group-Membership LSAs\n" - * "Display Type-7 LSAs\n" - * "Display Link LSAs\n" - * "Display Intra-Area-Prefix LSAs\n" - * "Search by Advertising Router\n" - * "Specify Advertising Router as IPv4 address notation\n" - * "Display details of LSAs\n" - * "Dump LSAs\n" - * "Display LSA's internal information\n" - * - * - * "show ipv6 ospf6 database (router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix) adv-router A.B.C.D", - * SHOW_STR - * IPV6_STR - * OSPF6_STR - * "Display Link state database\n" - * "Display Router LSAs\n" - * "Display Network LSAs\n" - * "Display Inter-Area-Prefix LSAs\n" - * "Display Inter-Area-Router LSAs\n" - * "Display As-External LSAs\n" - * "Display Group-Membership LSAs\n" - * "Display Type-7 LSAs\n" - * "Display Link LSAs\n" - * "Display Intra-Area-Prefix LSAs\n" - * "Search by Advertising Router\n" - * "Specify Advertising Router as IPv4 address notation\n" - * - * - */ DEFUN (show_ipv6_ospf6_database_type_router, show_ipv6_ospf6_database_type_router_cmd, - "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> * A.B.C.D", + "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> <*|adv-router> A.B.C.D [<detail|dump|internal>]", SHOW_STR IPV6_STR OSPF6_STR @@ -680,10 +482,13 @@ DEFUN (show_ipv6_ospf6_database_type_router, "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n" "Any Link state ID\n" + "Search by Advertising Router\n" "Specify Advertising Router as IPv4 address notation\n" + "Display details of LSAs\n" + "Dump LSAs\n" + "Display LSA's internal information\n" ) { - /* CHECK ME argc referenced below */ int idx_lsa = 4; int idx_ipv4 = 6; int idx_level = 7; @@ -1334,37 +1139,21 @@ DEFUN (show_ipv6_ospf6_border_routers, } -/* - * CHECK ME - The following ALIASes need to be implemented in this DEFUN - * "show ipv6 ospf6 linkstate network A.B.C.D A.B.C.D", - * SHOW_STR - * IP6_STR - * OSPF6_STR - * "Display linkstate routing table\n" - * "Display Network Entry\n" - * "Specify Router ID as IPv4 address notation\n" - * "Specify Link state ID as IPv4 address notation\n" - * - * "show ipv6 ospf6 linkstate router A.B.C.D", - * SHOW_STR - * IP6_STR - * OSPF6_STR - * "Display linkstate routing table\n" - * "Display Router Entry\n" - * "Specify Router ID as IPv4 address notation\n" - * - * - */ DEFUN (show_ipv6_ospf6_linkstate, show_ipv6_ospf6_linkstate_cmd, - "show ipv6 ospf6 linkstate", + "show ipv6 ospf6 linkstate <router A.B.C.D|network A.B.C.D A.B.C.D>", SHOW_STR IP6_STR OSPF6_STR "Display linkstate routing table\n" + "Display Router Entry\n" + "Specify Router ID as IPv4 address notation\n" + "Display Network Entry\n" + "Specify Router ID as IPv4 address notation\n" + "Specify Link state ID as IPv4 address notation\n" ) { - /* CHECK ME argc referenced below */ + int idx_ipv4 = 4; struct listnode *node; struct ospf6_area *oa; @@ -1374,7 +1163,7 @@ DEFUN (show_ipv6_ospf6_linkstate, { vty_out (vty, "%s SPF Result in Area %s%s%s", VNL, oa->name, VNL, VNL); - ospf6_linkstate_table_show (vty, argc, argv, oa->spf_table); + ospf6_linkstate_table_show (vty, idx_ipv4, argc, argv, oa->spf_table); } vty_out (vty, "%s", VNL); @@ -1392,7 +1181,7 @@ DEFUN (show_ipv6_ospf6_linkstate_detail, "Display linkstate routing table\n" ) { - /* CHECK ME argc referenced below */ + int idx_detail = 4; struct listnode *node; struct ospf6_area *oa; @@ -1402,7 +1191,7 @@ DEFUN (show_ipv6_ospf6_linkstate_detail, { vty_out (vty, "%s SPF Result in Area %s%s%s", VNL, oa->name, VNL, VNL); - ospf6_linkstate_table_show (vty, argc, argv, oa->spf_table); + ospf6_linkstate_table_show (vty, idx_detail, argc, argv, oa->spf_table); } vty_out (vty, "%s", VNL); |