]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd and zebra: scrubbed argc CHECK MEs
authorDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 29 Sep 2016 18:21:36 +0000 (18:21 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 29 Sep 2016 18:21:36 +0000 (18:21 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
bgpd/bgp_dump.c
bgpd/bgp_mplsvpn.c
bgpd/bgp_route.c
bgpd/bgp_routemap.c
bgpd/bgp_vty.c
tools/argv_translator.py
zebra/interface.c
zebra/router-id.c
zebra/test_main.c
zebra/zebra_routemap.c
zebra/zebra_vty.c

index cb2dd931d3bfa5194531b956edc936113d9eb048..162642d2b01aff83e769c779758c04876f22819b 100644 (file)
@@ -736,7 +736,6 @@ DEFUN (dump_bgp_all,
        "Output filename\n"
        "Interval of output\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_dump_routes = 2;
   int idx_path = 3;
   int idx_interval = 4;
@@ -766,7 +765,7 @@ DEFUN (dump_bgp_all,
     }
 
   /* When an interval is given */
-  if (argc == 3)
+  if (argc == idx_interval + 1)
       interval = argv[idx_interval]->arg;
 
   return bgp_dump_set (vty, bgp_dump_struct, bgp_dump_type,
index 03d712e714e8575b4943838d99efd08c4af91114..48baedcea51237ce1847c7f87fc83785b6993b67 100644 (file)
@@ -924,7 +924,6 @@ DEFUN (show_ip_bgp_vpnv4_all_neighbor_routes,
        "Display routes learned from neighbor\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 6;
   union sockunion su;
   struct peer *peer;
@@ -980,7 +979,6 @@ DEFUN (show_ip_bgp_vpnv4_rd_neighbor_routes,
        "Display routes learned from neighbor\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_ext_community = 5;
   int idx_ipv4 = 7;
   int ret;
@@ -1053,7 +1051,6 @@ DEFUN (show_ip_bgp_vpnv4_all_neighbor_advertised_routes,
        "Display the routes advertised to a BGP neighbor\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 6;
   int ret;
   struct peer *peer;
@@ -1108,7 +1105,6 @@ DEFUN (show_ip_bgp_vpnv4_rd_neighbor_advertised_routes,
        "Display the routes advertised to a BGP neighbor\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_ext_community = 5;
   int idx_ipv4 = 7;
   int ret;
index ac2d0ffc778aaedfd678f87a561d11f372bf1d50..68a1ca7a3dc77cd0f5ff905693f93a148fbe3259 100644 (file)
@@ -7772,7 +7772,6 @@ DEFUN (show_ip_bgp_ipv4,
        "Display route and more specific routes\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_view_vrf = 3;
   int idx_vrf = 4;
   int idx_afi;
@@ -7880,7 +7879,6 @@ DEFUN (show_ip_bgp_route,
        "Display only multipaths\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_view_vrf = 3;
   int idx_vrf = 4;
   int idx_afi;
@@ -7932,7 +7930,6 @@ DEFUN (show_ip_bgp_instance_all,
        BGP_INSTANCE_ALL_HELP_STR
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   u_char uj = use_json(argc, argv);
 
   /* CHECK ME we need to revisit all of the bgp_show_all_ commands */
@@ -7948,7 +7945,6 @@ DEFUN (show_bgp_instance_all,
        BGP_INSTANCE_ALL_HELP_STR
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   u_char uj = use_json(argc, argv);
 
   bgp_show_all_instances_routes_vty (vty, AFI_IP6, SAFI_UNICAST, uj);
@@ -8865,7 +8861,6 @@ DEFUN (show_ip_bgp_neighbor_prefix_counts,
        "Display detailed prefix count information\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_peer = 4;
   struct peer *peer;
   u_char uj = use_json(argc, argv);
@@ -8891,7 +8886,6 @@ DEFUN (show_ip_bgp_instance_neighbor_prefix_counts,
        "Display detailed prefix count information\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 4;
   int idx_peer = 6;
   struct peer *peer;
@@ -8917,7 +8911,6 @@ DEFUN (show_bgp_ipv6_neighbor_prefix_counts,
        "Display detailed prefix count information\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_peer = 4;
   struct peer *peer;
   u_char uj = use_json(argc, argv);
@@ -8943,7 +8936,6 @@ DEFUN (show_bgp_instance_ipv6_neighbor_prefix_counts,
        "Display detailed prefix count information\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 3;
   int idx_peer = 6;
   struct peer *peer;
@@ -8972,7 +8964,6 @@ DEFUN (show_ip_bgp_ipv4_neighbor_prefix_counts,
        "Display detailed prefix count information\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_safi = 4;
   int idx_peer = 6;
   struct peer *peer;
@@ -9004,7 +8995,6 @@ DEFUN (show_ip_bgp_vpnv4_neighbor_prefix_counts,
        "Display detailed prefix count information\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_peer = 6;
   struct peer *peer;
   u_char uj = use_json(argc, argv);
@@ -9281,7 +9271,6 @@ DEFUN (show_ip_bgp_instance_neighbor_advertised_route,
        "Name of the route map\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_view_vrf = 3;
   int idx_vrf = 4;
   int idx_afi = 5;
@@ -9344,7 +9333,6 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter,
        "Display the prefixlist filter\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_view_vrf = 3;
   int idx_vrf = 4;
   int idx_afi;
@@ -9454,7 +9442,6 @@ DEFUN (show_ip_bgp_neighbor_routes,
        "Display flap statistics of the routes learned from neighbor\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_view_vrf = 3;
   int idx_vrf = 4;
   int idx_afi;
@@ -9792,7 +9779,6 @@ DEFUN (bgp_damp_set,
        "Value to start suppressing a route\n"
        "Maximum duration to suppress a stable route\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_half_life = 2;
   int idx_reuse = 3;
   int idx_suppress = 4;
index 7e1e20458bf67b6e6ec3877a1f3289e41559d1f5..3ddfef4be19f9430f11259cbf8a24f35895f48f4 100644 (file)
@@ -3026,7 +3026,6 @@ DEFUN (no_match_peer,
        "IP address of peer\n"
        "IPv6 address of peer\n")
 {
-  /* CHECK ME argc referenced below */
  int idx_peer = 3;
 
  if (argc <= idx_peer)
@@ -3065,7 +3064,6 @@ DEFUN (no_match_ip_address,
        "IP access-list number (expanded range)\n"
        "IP Access-list name\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 4;
   if (argc <= idx_word)
     return bgp_route_match_delete (vty, vty->index, "ip address", NULL,
@@ -3102,7 +3100,6 @@ DEFUN (no_match_ip_next_hop,
        "IP access-list number (expanded range)\n"
        "IP Access-list name\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 4;
   if (argc <= idx_word)
     return bgp_route_match_delete (vty, vty->index, "ip next-hop", NULL,
@@ -3134,7 +3131,6 @@ DEFUN (no_match_probability,
        "Match portion of routes defined by percentage value\n"
        "Percentage of routes\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_number = 3;
   if (argc <= idx_number)
     return bgp_route_match_delete (vty, vty->index, "probability", NULL,
@@ -3171,7 +3167,6 @@ DEFUN (no_match_ip_route_source,
        "IP access-list number (expanded range)\n"
        "IP standard access-list name\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_number = 4;
   if (argc <= idx_number)
     return bgp_route_match_delete (vty, vty->index, "ip route-source",
@@ -3206,7 +3201,6 @@ DEFUN (no_match_ip_address_prefix_list,
        "Match entries of prefix-lists\n"
        "IP prefix-list name\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 5;
   if (argc <= idx_word)
     return bgp_route_match_delete (vty, vty->index, "ip address prefix-list",
@@ -3240,7 +3234,6 @@ DEFUN (no_match_ip_next_hop_prefix_list,
        "Match entries of prefix-lists\n"
        "IP prefix-list name\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 5;
   if (argc <= idx_word)
     return bgp_route_match_delete (vty, vty->index, "ip next-hop prefix-list",
@@ -3275,7 +3268,6 @@ DEFUN (no_match_ip_route_source_prefix_list,
        "Match entries of prefix-lists\n"
        "IP prefix-list name\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 5;
   if (argc <= idx_word)
     return bgp_route_match_delete (vty, vty->index, "ip route-source prefix-list",
@@ -3306,7 +3298,6 @@ DEFUN (no_match_metric,
        "Match metric of route\n"
        "Metric value\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_number = 3;
   if (argc <= idx_number)
     return bgp_route_match_delete (vty, vty->index, "metric",
@@ -3338,7 +3329,6 @@ DEFUN (no_match_local_pref,
        "Match local preference of route\n"
        "Local preference value\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_localpref = 3;
   if (argc <= idx_localpref)
     return bgp_route_match_delete (vty, vty->index, "local-preference",
@@ -3615,7 +3605,6 @@ DEFUN (no_set_ip_nexthop,
        "Use peer address (for BGP only)\n"
        "IP address of next hop\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_peer = 4;
   if (argc <= idx_peer)
     return bgp_route_set_delete (vty, vty->index, "ip next-hop", NULL);
@@ -3659,7 +3648,6 @@ DEFUN (no_set_metric,
        "Metric value for destination routing protocol\n"
        "Metric value\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_number = 3;
   if (argc <= idx_number)
     return bgp_route_set_delete (vty, vty->index, "metric", NULL);
@@ -3687,7 +3675,6 @@ DEFUN (no_set_local_pref,
        "BGP local preference path attribute\n"
        "Preference value\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_localpref = 3;
   if (argc <= idx_localpref)
     return bgp_route_set_delete (vty, vty->index, "local-preference", NULL);
@@ -3715,7 +3702,6 @@ DEFUN (no_set_weight,
        "BGP weight for routing table\n"
        "Weight value\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_weight = 3;
   if (argc <= idx_weight)
     return bgp_route_set_delete (vty, vty->index, "weight", NULL);
@@ -4111,7 +4097,6 @@ DEFUN (no_set_aggregator_as,
        "AS number\n"
        "IP address of aggregator\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_asn = 4;
   int idx_ip = 5;
   int ret;
@@ -4161,7 +4146,6 @@ DEFUN (no_set_tag,
        "Tag value for routing protocol\n"
        "Tag value\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_number = 3;
   if (argc <= idx_number)
     return bgp_route_set_delete (vty, vty->index, "tag", NULL);
@@ -4342,7 +4326,6 @@ DEFUN (no_set_ipv6_nexthop_global,
        "IPv6 global address\n"
        "IPv6 address of next hop\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6 = 5;
   if (argc <= idx_ipv6)
     return bgp_route_set_delete (vty, vty->index, "ipv6 next-hop global", NULL);
@@ -4389,7 +4372,6 @@ DEFUN (no_set_ipv6_nexthop_local,
        "IPv6 local address\n"
        "IPv6 address of next hop\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6 = 5;
   if (argc <= idx_ipv6)
     return bgp_route_set_delete (vty, vty->index, "ipv6 next-hop local", NULL);
@@ -4420,7 +4402,6 @@ DEFUN (no_set_vpnv4_nexthop,
        "VPNv4 next-hop address\n"
        "IP address of next hop\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 4;
   if (argc <= idx_ipv4)
     return bgp_route_set_delete (vty, vty->index, "vpnv4 next-hop", NULL);
@@ -4448,7 +4429,6 @@ DEFUN (no_set_originator_id,
        "BGP originator ID attribute\n"
        "IP address of originator\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_id = 3;
   if (argc < idx_id)
     return bgp_route_set_delete (vty, vty->index, "originator-id", NULL);
index 362e7db0f1b4fde8849b93c56c45a59ed3f7ac03..4e4571a01a38327036615221c2045a000ff5bfa0 100644 (file)
@@ -664,7 +664,6 @@ DEFUN (router_bgp,
        AS_STR
        BGP_INSTANCE_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_asn = 2;
   int idx_view_vrf = 3;
   int idx_vrf = 4;
@@ -745,7 +744,6 @@ DEFUN (no_router_bgp,
        AS_STR
        BGP_INSTANCE_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_asn = 3;
   int idx_vrf = 5;
   as_t as;
@@ -829,7 +827,6 @@ DEFUN (no_bgp_router_id,
        "Override configured router identifier\n"
        "Manually configured router identifier\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_router_id = 3;
   int ret;
   struct in_addr id;
@@ -1111,21 +1108,12 @@ DEFUN (bgp_maxmed_onstartup,
        "Effective on a startup\n"
        "Time (seconds) period for max-med\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_number = 3;
   struct bgp *bgp;
 
   bgp = vty->index;
-
-  if (argc != 1)
-    {
-      vty_out (vty, "%% Must supply max-med on-startup period");
-      return CMD_WARNING;
-    }
-
   VTY_GET_INTEGER ("max-med on-startup period", bgp->v_maxmed_onstartup, argv[idx_number]->arg);
   bgp->maxmed_onstartup_value = BGP_MAXMED_VALUE_DEFAULT;
-
   bgp_maxmed_update(bgp);
 
   return CMD_SUCCESS;
@@ -1140,22 +1128,13 @@ DEFUN (bgp_maxmed_onstartup_medv,
        "Time (seconds) period for max-med\n"
        "Max MED value to be used\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_number = 3;
   int idx_number_2 = 4;
   struct bgp *bgp;
 
   bgp = vty->index;
-
-  if (argc != 2)
-    {
-      vty_out (vty, "%% Must supply max-med on-startup period and med value");
-      return CMD_WARNING;
-    }
-
   VTY_GET_INTEGER ("max-med on-startup period", bgp->v_maxmed_onstartup, argv[idx_number]->arg);
   VTY_GET_INTEGER ("max-med on-startup med-value", bgp->maxmed_onstartup_value, argv[idx_number_2]->arg);
-
   bgp_maxmed_update(bgp);
 
   return CMD_SUCCESS;
@@ -2785,7 +2764,6 @@ DEFUN (neighbor_interface_config,
        "Member of the peer-group\n"
        "peer-group name\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 1;
   int idx_peer_group_word = 4;
 
@@ -2807,7 +2785,6 @@ DEFUN (neighbor_interface_config_v6only,
        "Member of the peer-group\n"
        "peer-group name\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 1;
   int idx_peer_group_word = 5;
 
@@ -4934,13 +4911,9 @@ DEFUN (neighbor_interface,
        "Interface\n"
        "Interface name\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_ip = 1;
   int idx_word = 3;
-  if (argc == 3)
-    return peer_interface_vty (vty, argv[idx_ip]->arg, argv[idx_word]->arg);
-  else
-    return peer_interface_vty (vty, argv[idx_ip]->arg, argv[idx_word]->arg);
+  return peer_interface_vty (vty, argv[idx_ip]->arg, argv[idx_word]->arg);
 }
 
 DEFUN (no_neighbor_interface,
@@ -5530,7 +5503,6 @@ DEFUN (neighbor_allowas_in,
        "Accept as-path with my AS present in it\n"
        "Number of occurances of AS number\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_peer = 1;
   int idx_number = 3;
   int ret;
@@ -6024,7 +5996,6 @@ DEFUN (clear_ip_bgp_all,
        BGP_SOFT_IN_STR
        BGP_SOFT_OUT_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_view_vrf = 3;
   int idx_vrf = 4;
   int idx_clr_sort = 5;
@@ -6218,7 +6189,6 @@ DEFUN (show_bgp_vrfs,
        "Show BGP VRFs\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   struct list *inst = bm->bgp;
   struct listnode *node;
   struct bgp *bgp;
@@ -6874,7 +6844,6 @@ DEFUN (show_ip_bgp_summary,
        "Summary of BGP neighbor status\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_view_vrf = 3;
   int idx_vrf = 4;
   int idx_afi;
@@ -6901,7 +6870,6 @@ DEFUN (show_ip_bgp_instance_all_summary,
        "Summary of BGP neighbor status\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   u_char uj = use_json(argc, argv);
 
   bgp_show_all_instances_summary_vty (vty, AFI_IP, SAFI_UNICAST, uj);
@@ -8753,7 +8721,6 @@ DEFUN (show_ip_bgp_neighbors,
        "Neighbor on bgp configured interface\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_ip = 1;
   int idx_view_vrf = 3;
   int idx_vrf = 4;
@@ -8801,7 +8768,6 @@ DEFUN (show_ip_bgp_instance_all_neighbors,
        "Detailed information on TCP and BGP neighbor connections\n"
        "JavaScript Object Notation\n")
 {
-  /* CHECK ME argc referenced below */
   u_char uj = use_json(argc, argv);
 
   bgp_show_all_instances_neighbors_vty (vty, uj);
@@ -8936,7 +8902,6 @@ DEFUN (show_ip_bgp_updgrps,
        "Detailed info about dynamic update groups\n"
        "Specific subgroup to display detailed info for\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_view_vrf = 3;
   int idx_vrf = 4;
   int idx_afi;
@@ -11321,7 +11286,6 @@ DEFUN (ip_community_list_standard,
        "Specify community to accept\n"
        COMMUNITY_VAL_STR)
 {
-  /* CHECK ME argc referenced below */
   return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
 }
 
@@ -11338,7 +11302,6 @@ DEFUN (no_ip_community_list_standard_all,
        "Specify community to accept\n"
        COMMUNITY_VAL_STR)
 {
-  /* CHECK ME argc referenced below */
   return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
 }
 
@@ -11355,7 +11318,6 @@ DEFUN (ip_community_list_expanded_all,
        "Specify community to accept\n"
        COMMUNITY_VAL_STR)
 {
-  /* CHECK ME argc referenced below */
   return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
 }
 
@@ -11372,7 +11334,6 @@ DEFUN (no_ip_community_list_expanded_all,
        "Specify community to accept\n"
        COMMUNITY_VAL_STR)
 {
-  /* CHECK ME argc referenced below */
   return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
 }
 
@@ -11564,7 +11525,6 @@ DEFUN (ip_extcommunity_list_standard,
        "Specify community to accept\n"
        EXTCOMMUNITY_VAL_STR)
 {
-  /* CHECK ME argc referenced below */
   return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
 }
 
@@ -11580,7 +11540,6 @@ DEFUN (ip_extcommunity_list_name_expanded,
        "Specify community to accept\n"
        "An ordered list as a regular-expression\n")
 {
-  /* CHECK ME argc referenced below */
   return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
 }
 
@@ -11597,7 +11556,6 @@ DEFUN (no_ip_extcommunity_list_standard_all,
        "Specify community to accept\n"
        EXTCOMMUNITY_VAL_STR)
 {
-  /* CHECK ME argc referenced below */
   return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
 }
 
@@ -11614,7 +11572,6 @@ DEFUN (no_ip_extcommunity_list_expanded_all,
        "Specify community to accept\n"
        "An ordered list as a regular-expression\n")
 {
-  /* CHECK ME argc referenced below */
   return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
 }
 
index 6c0d20b802e776838c98e2f7a3836aa00667cfd6..02e7bac68f4ef52eefd8941ba393165dbf4ebb0d 100755 (executable)
@@ -726,6 +726,18 @@ DEFUN (no_bgp_maxmed_onstartup,
             if 'use_json (argc, argv)' in line:
                 continue
 
+            if 'use_json(argc, argv)' in line:
+                continue
+
+            if 'bgp_get_argv_vrf (argc,)' in line:
+                continue
+
+            if 'bgp_get_argv_afi_safi (argc,' in line:
+                continue
+
+            if 'zebra_vty_ip_route_tdv_helper (argc,' in line:
+                continue
+
             if 'argc' in line:
                 return True
         return False
@@ -742,8 +754,9 @@ DEFUN (no_bgp_maxmed_onstartup,
         lines.extend(self.help_strings)
         lines.append('{\n')
 
-        if self.uses_argc():
-            lines.append("  /* CHECK ME argc referenced below */\n")
+        # uncomment this to do ospf_vty.c
+        # if self.uses_argc():
+        #     lines.append("  /* CHECK ME argc referenced below */\n")
         lines.extend(self.guts)
 
         '''
index f49ab49036345654316805730ae2154dbea4bc44..62340a460a15640bdd9211c47a8e944cbbaddb6d 100644 (file)
@@ -1305,7 +1305,6 @@ DEFUN (show_interface,
        "Interface status and configuration\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   struct listnode *node;
   struct interface *ifp;
   vrf_id_t vrf_id = VRF_DEFAULT;
@@ -1355,7 +1354,6 @@ DEFUN (show_interface_name_vrf,
        "Interface name\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ifname = 2;
   int idx_name = 4;
   struct interface *ifp;
@@ -1363,8 +1361,7 @@ DEFUN (show_interface_name_vrf,
 
   interface_update_stats ();
 
-  if (argc > 1)
-    VRF_GET_ID (vrf_id, argv[idx_name]->arg);
+  VRF_GET_ID (vrf_id, argv[idx_name]->arg);
 
   /* Specified interface print. */
   ifp = if_lookup_by_name_vrf (argv[idx_ifname]->arg, vrf_id);
@@ -1465,7 +1462,6 @@ DEFUN (show_interface_desc,
        "Interface description\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   vrf_id_t vrf_id = VRF_DEFAULT;
 
   if (argc > 3)
@@ -2083,7 +2079,6 @@ DEFUN (link_params_delay,
        "Maximum delay\n"
        "Maximum delay in micro-second as decimal (0...16777215)\n")
 {
-  /* CHECK ME argc referenced below */
   /* Get and Check new delay values */
   u_int32_t delay = 0, low = 0, high = 0;
   VTY_GET_ULONG("delay", delay, argv[1]->arg);
index 80ad0afa649fb4bc4c774f50297831e7e59b34cd..23b8cc743c3b5b08e2ecd75b9d2f2ce269cd95fc 100644 (file)
@@ -221,7 +221,6 @@ DEFUN (router_id,
        "IP address to use for router-id\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 1;
   int idx_name = 3;
 
@@ -251,7 +250,6 @@ DEFUN (no_router_id,
        "IP address to use for router-id\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_name = 4;
 
   struct prefix rid;
index 0e850f1629bbed646b2f245708e36c877ec4e613..d3813d73560d59fccc58f54076e00ca4fa5b5eb3 100644 (file)
@@ -124,11 +124,8 @@ DEFUN (test_interface_state,
        "up\n"
        "down\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_up_down = 1;
   struct interface *ifp;
-  if (argc < 1)
-    return CMD_WARNING;
   
   ifp = vty->index;
   if (ifp->ifindex == IFINDEX_INTERNAL)
index 87dc85dd2e8c4a63bcae8ea98eabd3d33e5e0e25..6b861d78040c24c748bb44d0c719c38c009017d8 100644 (file)
@@ -314,7 +314,6 @@ DEFUN (no_match_interface,
        "Match first hop interface of route\n"
        "Interface name\n")
 {
-  /* CHECK ME argc referenced below */
   char *iface = (argc == 4) ? argv[3]->arg : NULL;
   return zebra_route_match_delete (vty, vty->index, "interface", iface, RMAP_EVENT_MATCH_DELETED);
 }
@@ -339,7 +338,6 @@ DEFUN (no_match_tag,
        MATCH_STR
        "Match tag of route\n")
 {
-  /* CHECK ME argc referenced below */
   char *tag = (argc == 4) ? argv[3]->arg : NULL;
   return zebra_route_match_delete (vty, vty->index, "tag", tag, RMAP_EVENT_MATCH_DELETED);
 }
@@ -370,7 +368,6 @@ DEFUN (no_match_ip_next_hop,
        "IP access-list number (expanded range)\n"
        "IP Access-list name\n")
 {
-  /* CHECK ME argc referenced below */
   char *al = (argc == 5) ? argv[4]->arg : NULL;
   return zebra_route_match_delete (vty, vty->index, "ip next-hop", al, RMAP_EVENT_FILTER_DELETED);
 }
@@ -400,7 +397,6 @@ DEFUN (no_match_ip_next_hop_prefix_list,
        "Match entries of prefix-lists\n"
        "IP prefix-list name\n")
 {
-  /* CHECK ME argc referenced below */
   char *plist = (argc == 6) ? argv[5]->arg : NULL;
   return zebra_route_match_delete (vty, vty->index,
                                   "ip next-hop prefix-list", plist,
@@ -435,7 +431,6 @@ DEFUN (no_match_ip_address,
        "IP access-list number (expanded range)\n"
        "IP Access-list name\n")
 {
-  /* CHECK ME argc referenced below */
   char *al = (argc == 5) ? argv[4]->arg : NULL;
   return zebra_route_match_delete (vty, vty->index, "ip address", al, RMAP_EVENT_FILTER_DELETED);
 }
@@ -465,7 +460,6 @@ DEFUN (no_match_ip_address_prefix_list,
        "Match entries of prefix-lists\n"
        "IP prefix-list name\n")
 {
-  /* CHECK ME argc referenced below */
   char *plist = (argc == 6) ? argv[5]->arg : NULL;
   return zebra_route_match_delete (vty, vty->index,
                                   "ip address prefix-list", plist,
@@ -495,7 +489,6 @@ DEFUN (no_match_ip_address_prefix_len,
        "Match prefixlen of ip address of route\n"
        "Prefix length\n")
 {
-  /* CHECK ME argc referenced below */
   char *plen = (argc == 6) ? argv[5]->arg : NULL;
   return zebra_route_match_delete (vty, vty->index,
                                   "ip address prefix-len", plen,
@@ -526,7 +519,6 @@ DEFUN (no_match_ip_nexthop_prefix_len,
        "Match prefix length of nexthop\n"
        "Prefix length\n")
 {
-  /* CHECK ME argc referenced below */
   char *plen = (argc == 6) ? argv[5]->arg : NULL;
   return zebra_route_match_delete (vty, vty->index,
                                   "ip next-hop prefix-len", plen,
@@ -560,7 +552,6 @@ DEFUN (no_match_source_protocol,
        "No match protocol via which the route was learnt\n"
        )
 {
-  /* CHECK ME argc referenced below */
   char *proto = (argc == 4) ? argv[3]->text : NULL;
   return zebra_route_match_delete (vty, vty->index, "source-protocol", proto, RMAP_EVENT_MATCH_DELETED);
 }
@@ -634,7 +625,6 @@ DEFUN (no_set_src,
        SET_STR
        "Source address for route\n")
 {
-  /* CHECK ME argc referenced below */
   char *ip = (argc == 4) ? argv[3]->arg : NULL;
   return zebra_route_set_delete (vty, vty->index, "src", ip);
 }
@@ -718,7 +708,6 @@ DEFUN (no_ip_protocol,
        "Specify route map\n"
        "Route map name\n")
 {
-  /* CHECK ME argc referenced below */
   char *proto = argv[3]->text;
   char *rmap = (argc == 6) ? argv[5]->arg : NULL;
   int i;
@@ -829,7 +818,6 @@ DEFUN (no_ipv6_protocol,
        "Specify route map\n"
        "Route map name\n")
 {
-  /* CHECK ME argc referenced below */
   const char *proto = argv[3]->text;
   const char *rmap = (argc == 6) ? argv[5]->arg : NULL;
   int i;
@@ -936,7 +924,6 @@ DEFUN (no_ip_protocol_nht_rmap,
        "Specify route map\n"
        "Route map name\n")
 {
-  /* CHECK ME argc referenced below */
   char *proto = argv[3]->text;
   char *rmap = (argc == 6) ? argv[5]->arg : NULL;
   int i;
@@ -1032,7 +1019,6 @@ DEFUN (no_ipv6_protocol_nht_rmap,
        "Specify route map\n"
        "Route map name\n")
 {
-  /* CHECK ME argc referenced below */
   char *proto = argv[3]->text;
   char *rmap = (argc == 6) ? argv[5]->arg : NULL;
   int i;
index b57634a8f9e1db77574288dae89dec860ddf7589..02b68201ec1ba0bdfe73fca97cf4713bcac767f7 100644 (file)
@@ -191,7 +191,6 @@ DEFUN (ip_mroute_dist,
        "Nexthop interface name\n"
        "Distance\n")
 {
-  /* CHECK ME argc referenced below */
   char *destprefix = argv[2]->arg;
   char *nexthop = argv[3]->arg;
   char *distance = (argc == 5) ? argv[4]->arg : NULL;
@@ -209,7 +208,6 @@ DEFUN (no_ip_mroute_dist,
        "Nexthop interface name\n"
        "Distance\n")
 {
-  /* CHECK ME argc referenced below */
   char *destprefix = argv[2]->arg;
   char *nexthop = argv[3]->arg;
   char *distance = (argc == 5) ? argv[4]->arg : NULL;
@@ -353,7 +351,6 @@ DEFUN (ip_route,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4_prefixlen = 2;
   int idx_ipv4_ifname_null = 3;
   int idx_curr = 4;
@@ -385,7 +382,6 @@ DEFUN (ip_route_flags,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4_prefixlen = 2;
   int idx_ipv4_ifname = 3;
   int idx_reject_blackhole = 4;
@@ -416,7 +412,6 @@ DEFUN (ip_route_flags2,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4_prefixlen = 2;
   int idx_reject_blackhole = 3;
   int idx_curr = 4;
@@ -449,7 +444,6 @@ DEFUN (ip_route_mask,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 2;
   int idx_ipv4_2 = 3;
   int idx_ipv4_ifname_null = 4;
@@ -482,7 +476,6 @@ DEFUN (ip_route_mask_flags,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 2;
   int idx_ipv4_2 = 3;
   int idx_ipv4_ifname = 4;
@@ -516,7 +509,6 @@ DEFUN (ip_route_mask_flags2,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 2;
   int idx_ipv4_2 = 3;
   int idx_reject_blackhole = 4;
@@ -549,7 +541,6 @@ DEFUN (no_ip_route,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4_prefixlen = 3;
   int idx_ipv4_ifname_null = 4;
   int idx_curr = 5;
@@ -580,7 +571,6 @@ DEFUN (no_ip_route_flags2,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4_prefixlen = 3;
   int idx_curr = 5;
   char *tag, *distance, *vrf;
@@ -610,7 +600,6 @@ DEFUN (no_ip_route_mask,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 3;
   int idx_ipv4_2 = 4;
   int idx_ipv4_ifname_null = 5;
@@ -643,7 +632,6 @@ DEFUN (no_ip_route_mask_flags2,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 3;
   int idx_ipv4_2 = 4;
   int idx_curr = 6;
@@ -675,7 +663,6 @@ DEFUN (no_ip_route_flags,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4_prefixlen = 3;
   int idx_ipv4_ifname = 4;
   int idx_reject_blackhole = 5;
@@ -710,7 +697,6 @@ DEFUN (no_ip_route_mask_flags,
        "Distance value for this route\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 3;
   int idx_ipv4_2 = 4;
   int idx_ipv4_ifname = 5;
@@ -1153,7 +1139,6 @@ DEFUN (show_ip_route,
        IP_STR
        "IP routing table\n")
 {
-  /* CHECK ME argc referenced below */
   return do_show_ip_route (vty, VRF_DEFAULT_NAME, SAFI_UNICAST, use_json(argc, argv));
 }
 
@@ -1249,14 +1234,11 @@ DEFUN (show_ip_route_vrf,
        "IP routing table\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
+  int idx_vrf = 4;
   int idx_json = 5;
   u_char uj = use_json(argc, argv);
 
-  if (argc == 1 && uj)
-    return do_show_ip_route (vty, NULL, SAFI_UNICAST, uj);
-  else
-    return do_show_ip_route (vty, argv[idx_json]->arg, SAFI_UNICAST, uj);
+  return do_show_ip_route (vty, argv[idx_vrf]->arg, SAFI_UNICAST, uj);
 }
 
 DEFUN (show_ip_nht,
@@ -1267,7 +1249,6 @@ DEFUN (show_ip_nht,
        "IP nexthop tracking table\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_vrf = 4;
   vrf_id_t vrf_id = VRF_DEFAULT;
 
@@ -1308,7 +1289,6 @@ DEFUN (show_ipv6_nht,
        "IPv6 nexthop tracking table\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_vrf = 4;
   vrf_id_t vrf_id = VRF_DEFAULT;
 
@@ -2525,7 +2505,6 @@ DEFUN (ipv6_route,
        "Distance value for this prefix\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6_prefixlen = 2;
   int idx_ipv6_ifname = 3;
   int idx_curr = 4;
@@ -2558,7 +2537,6 @@ DEFUN (ipv6_route_flags,
        "Distance value for this prefix\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6_prefixlen = 2;
   int idx_ipv6_ifname = 3;
   int idx_reject_blackhole = 4;
@@ -2589,7 +2567,6 @@ DEFUN (ipv6_route_ifname,
        "Distance value for this prefix\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6_prefixlen = 2;
   int idx_ipv6 = 3;
   int idx_interface = 4;
@@ -2622,7 +2599,6 @@ DEFUN (ipv6_route_ifname_flags,
        "Distance value for this prefix\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6_prefixlen = 2;
   int idx_ipv6 = 3;
   int idx_interface = 4;
@@ -2655,7 +2631,6 @@ DEFUN (no_ipv6_route,
        "Distance value for this prefix\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6_prefixlen = 3;
   int idx_ipv6_ifname = 4;
   int idx_curr = 5;
@@ -2687,7 +2662,6 @@ DEFUN (no_ipv6_route_flags,
        "Distance value for this prefix\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6_prefixlen = 3;
   int idx_ipv6_ifname = 4;
   int idx_reject_blackhole = 5;
@@ -2719,7 +2693,6 @@ DEFUN (no_ipv6_route_ifname,
        "Distance value for this prefix\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6_prefixlen = 3;
   int idx_ipv6 = 4;
   int idx_interface = 5;
@@ -2753,7 +2726,6 @@ DEFUN (no_ipv6_route_ifname_flags,
        "Distance value for this prefix\n"
        VRF_CMD_HELP_STR)
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv6_prefixlen = 3;
   int idx_ipv6 = 4;
   int idx_interface = 5;