]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Remove weird blackhole/reject static routes
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 12 Dec 2016 23:29:39 +0000 (23:29 +0000)
committerRenato Westphal <renato@openbsd.org>
Wed, 14 Dec 2016 10:26:37 +0000 (08:26 -0200)
Doesn't make sense to fully configure a static route and then
specify that it should be rejected. Remove & rename relevant
commands.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
zebra/zebra_vty.c

index f32b51f037ef97bfd79abe0b054b5dfb9aa7a045..397a4890114c185937c642555aae1a106984743d 100644 (file)
@@ -407,40 +407,6 @@ DEFUN (ip_route,
 
 DEFUN (ip_route_flags,
        ip_route_flags_cmd,
-       "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]",
-       IP_STR
-       "Establish static routes\n"
-       "IP destination prefix (e.g. 10.0.0.0/8)\n"
-       "IP gateway address\n"
-       "IP gateway interface name\n"
-       "Emit an ICMP unreachable when matched\n"
-       "Silently discard pkts when matched\n"
-       "Set tag for this route\n"
-       "Tag value\n"
-       "Distance value for this route\n"
-        VRF_CMD_HELP_STR
-       "Specify labels for this route\n"
-       "One or more labels separated by '/'\n")
-{
-  int idx_ipv4_prefixlen = 2;
-  int idx_ipv4_ifname = 3;
-  int idx_reject_blackhole = 4;
-  int idx_curr = 5;
-  char *tag, *distance, *vrf;
-
-  tag = distance = vrf = NULL;
-  zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf, NULL);
-
-  return zebra_static_ipv4 (vty, SAFI_UNICAST, 1,
-                           argv[idx_ipv4_prefixlen]->arg,
-                           NULL,
-                           argv[idx_ipv4_ifname]->arg,
-                           argv[idx_reject_blackhole]->arg,
-                            tag, distance, vrf, NULL);
-}
-
-DEFUN (ip_route_flags2,
-       ip_route_flags2_cmd,
        "ip route A.B.C.D/M <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]",
        IP_STR
        "Establish static routes\n"
@@ -506,43 +472,6 @@ DEFUN (ip_route_mask,
 
 DEFUN (ip_route_mask_flags,
        ip_route_mask_flags_cmd,
-       "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]",
-       IP_STR
-       "Establish static routes\n"
-       "IP destination prefix\n"
-       "IP destination prefix mask\n"
-       "IP gateway address\n"
-       "IP gateway interface name\n"
-       "Emit an ICMP unreachable when matched\n"
-       "Silently discard pkts when matched\n"
-       "Set tag for this route\n"
-       "Tag value\n"
-       "Distance value for this route\n"
-       VRF_CMD_HELP_STR
-       "Specify labels for this route\n"
-       "One or more labels separated by '/'\n")
-{
-  int idx_ipv4 = 2;
-  int idx_ipv4_2 = 3;
-  int idx_ipv4_ifname = 4;
-  int idx_reject_blackhole = 5;
-  int idx_curr = 6;
-  char *tag, *distance, *vrf;
-
-  tag = distance = vrf = NULL;
-  zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf, NULL);
-
-  return zebra_static_ipv4 (vty, SAFI_UNICAST, 1,
-                           argv[idx_ipv4]->arg,
-                           argv[idx_ipv4_2]->arg,
-                           argv[idx_ipv4_ifname]->arg,
-                           argv[idx_reject_blackhole]->arg,
-                           tag, distance, vrf, NULL);
-}
-
-
-DEFUN (ip_route_mask_flags2,
-       ip_route_mask_flags2_cmd,
        "ip route A.B.C.D A.B.C.D <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]",
        IP_STR
        "Establish static routes\n"
@@ -607,8 +536,8 @@ DEFUN (no_ip_route,
                            tag, distance, vrf, NULL);
 }
 
-DEFUN (no_ip_route_flags2,
-       no_ip_route_flags2_cmd,
+DEFUN (no_ip_route_flags,
+       no_ip_route_flags_cmd,
        "no ip route A.B.C.D/M <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]",
        NO_STR
        IP_STR
@@ -671,8 +600,8 @@ DEFUN (no_ip_route_mask,
                            tag, distance, vrf, NULL);
 }
 
-DEFUN (no_ip_route_mask_flags2,
-       no_ip_route_mask_flags2_cmd,
+DEFUN (no_ip_route_mask_flags,
+       no_ip_route_mask_flags_cmd,
        "no ip route A.B.C.D A.B.C.D <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]",
        NO_STR
        IP_STR
@@ -703,78 +632,6 @@ DEFUN (no_ip_route_mask_flags2,
                            tag, distance, vrf, NULL);
 }
 
-DEFUN (no_ip_route_flags,
-       no_ip_route_flags_cmd,
-       "no ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]",
-       NO_STR
-       IP_STR
-       "Establish static routes\n"
-       "IP destination prefix (e.g. 10.0.0.0/8)\n"
-       "IP gateway address\n"
-       "IP gateway interface name\n"
-       "Emit an ICMP unreachable when matched\n"
-       "Silently discard pkts when matched\n"
-       "Tag of this route\n"
-       "Tag value\n"
-       "Distance value for this route\n"
-       VRF_CMD_HELP_STR
-       "Specify labels for this route\n"
-       "One or more labels separated by '/'\n")
-{
-  int idx_ipv4_prefixlen = 3;
-  int idx_ipv4_ifname = 4;
-  int idx_reject_blackhole = 5;
-  int idx_curr = 6;
-  char *tag, *distance, *vrf;
-
-  tag = distance = vrf = NULL;
-  zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf, NULL);
-
-  return zebra_static_ipv4 (vty, SAFI_UNICAST, 0,
-                           argv[idx_ipv4_prefixlen]->arg,
-                           NULL,
-                           argv[idx_ipv4_ifname]->arg,
-                           argv[idx_reject_blackhole]->arg,
-                           tag, distance, vrf, NULL);
-}
-
-DEFUN (no_ip_route_mask_flags,
-       no_ip_route_mask_flags_cmd,
-       "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> [tag (1-4294967295)] [(1-255)] [vrf NAME]",
-       NO_STR
-       IP_STR
-       "Establish static routes\n"
-       "IP destination prefix\n"
-       "IP destination prefix mask\n"
-       "IP gateway address\n"
-       "IP gateway interface name\n"
-       "Emit an ICMP unreachable when matched\n"
-       "Silently discard pkts when matched\n"
-       "Tag of this route\n"
-       "Tag value\n"
-       "Distance value for this route\n"
-       VRF_CMD_HELP_STR
-       "Specify labels for this route\n"
-       "One or more labels separated by '/'\n")
-{
-  int idx_ipv4 = 3;
-  int idx_ipv4_2 = 4;
-  int idx_ipv4_ifname = 5;
-  int idx_reject_blackhole = 6;
-  int idx_curr = 7;
-  char *tag, *distance, *vrf;
-
-  tag = distance = vrf = NULL;
-  zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf, NULL);
-
-  return zebra_static_ipv4 (vty, SAFI_UNICAST, 0,
-                           argv[idx_ipv4]->arg,
-                           argv[idx_ipv4_2]->arg,
-                           argv[idx_ipv4_ifname]->arg,
-                           argv[idx_reject_blackhole]->arg,
-                           tag, distance, vrf, NULL);
-}
-
 /* New RIB.  Detailed information for IPv4 route. */
 static void
 vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
@@ -3953,14 +3810,10 @@ zebra_vty_init (void)
   install_element (CONFIG_NODE, &no_ip_multicast_mode_cmd);
   install_element (CONFIG_NODE, &ip_route_cmd);
   install_element (CONFIG_NODE, &ip_route_flags_cmd);
-  install_element (CONFIG_NODE, &ip_route_flags2_cmd);
   install_element (CONFIG_NODE, &ip_route_mask_cmd);
   install_element (CONFIG_NODE, &ip_route_mask_flags_cmd);
-  install_element (CONFIG_NODE, &ip_route_mask_flags2_cmd);
   install_element (CONFIG_NODE, &no_ip_route_cmd);
-  install_element (CONFIG_NODE, &no_ip_route_flags2_cmd);
   install_element (CONFIG_NODE, &no_ip_route_mask_cmd);
-  install_element (CONFIG_NODE, &no_ip_route_mask_flags2_cmd);
   install_element (CONFIG_NODE, &ip_zebra_import_table_distance_cmd);
   install_element (CONFIG_NODE, &no_ip_zebra_import_table_cmd);