summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-09-27 00:10:55 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-09-27 00:10:55 +0000
commitcc13f81fb877c3d71caaa893cb45a682c8041b3d (patch)
tree6b80de731719ddb403c3b32013f676fae8d00ec9
parent55c727dd758cd69aa7e2760df6bca8fb5f3db4d9 (diff)
parente961923c7217b935027107cad30c35c3907c936f (diff)
Merge branch 'vtysh-grammar' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into vtysh-grammar
-rw-r--r--bgpd/bgp_filter.c4
-rw-r--r--bgpd/bgp_route.c60
-rw-r--r--bgpd/bgp_routemap.c4
-rw-r--r--bgpd/bgp_vty.c569
-rw-r--r--lib/filter.c4
-rw-r--r--lib/plist.c4
-rw-r--r--pimd/pim_cmd.c4
-rw-r--r--tests/heavy-thread.c2
-rw-r--r--tests/heavy-wq.c2
-rw-r--r--tests/heavy.c2
-rw-r--r--vtysh/vtysh.c2
-rw-r--r--zebra/zebra_vty.c3359
12 files changed, 433 insertions, 3583 deletions
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c
index 05d5eafae6..5af840810b 100644
--- a/bgpd/bgp_filter.c
+++ b/bgpd/bgp_filter.c
@@ -428,7 +428,7 @@ as_list_dup_check (struct as_list *aslist, struct as_filter *new)
DEFUN (ip_as_path,
ip_as_path_cmd,
- "ip as-path access-list WORD <deny|permit> .LINE",
+ "ip as-path access-list WORD <deny|permit> LINE...",
IP_STR
"BGP autonomous system path filter\n"
"Specify an access list name\n"
@@ -486,7 +486,7 @@ DEFUN (ip_as_path,
DEFUN (no_ip_as_path,
no_ip_as_path_cmd,
- "no ip as-path access-list WORD <deny|permit> .LINE",
+ "no ip as-path access-list WORD <deny|permit> LINE...",
NO_STR
IP_STR
"BGP autonomous system path filter\n"
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index d5dc37a03c..712d9fda76 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -7732,17 +7732,14 @@ bgp_show_route (struct vty *vty, const char *view_name, const char *ip_str,
/* BGP route print out function. */
DEFUN (show_ip_bgp_ipv4,
show_ip_bgp_ipv4_cmd,
- "show [ip] bgp [<view|vrf> WORD] [<ipv4 unicast|ipv4 multicast|ipv6 unicast|vpnv4 unicast|encap unicast>] [cidr-only|community|<[dampening] <flap-statistics|dampened-paths>>|regexp .LINE|route-map WORD|prefix-list WORD|filter-list WORD|community <AA:NN|local-AS|no-advertise|no-export> [exact-match]|community-list <(1-500)|WORD> [exact-match]|<A.B.C.D/M|k X:X::X:X/M> longer-prefixes] [json]",
+ "show [ip] bgp [<view|vrf> WORD] [<<ipv4|ipv6|vpnv4|encap> [unicast]|ipv4 multicast>] [cidr-only|community|<[dampening] <flap-statistics|dampened-paths>>|regexp .LINE|route-map WORD|prefix-list WORD|filter-list WORD|community <AA:NN|local-AS|no-advertise|no-export> [exact-match]|community-list <(1-500)|WORD> [exact-match]|<A.B.C.D/M|k X:X::X:X/M> longer-prefixes] [json]",
SHOW_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
"Address Family modifier\n"
"Address family\n"
@@ -7799,9 +7796,6 @@ DEFUN (show_ip_bgp_ipv4,
return CMD_WARNING;
}
- // "show [ip] bgp [<view|vrf> WORD] [<ipv4 unicast|ipv4 multicast|ipv6 unicast|vpnv4 unicast|encap unicast>]
- // [cidr-only|<[dampening] <flap-statistics|dampened-paths>>|regexp .LINE|prefix-list WORD|filter-list WORD|
- // community [<AA:NN|local-AS|no-advertise|no-export>]|community-list <(1-500)|WORD> [exact-match]|A.B.C.D/M longer-prefixes] [json]",
if (strmatch(argv[idx_sh_type]->text, "cidr-only"))
return bgp_show (vty, bgp, afi, safi, bgp_show_type_cidr_only, NULL, uj);
@@ -7863,13 +7857,13 @@ DEFUN (show_ip_bgp_ipv4,
DEFUN (show_ip_bgp_route,
show_ip_bgp_route_cmd,
- "show [ip] bgp [<view|vrf> WORD] [<ipv4 unicast|ipv4 multicast|ipv6 unicast|vpnv4 unicast [rd ASN:nn_or_IP-address:nn]|encap unicast>] <A.B.C.D|A.B.C.D/M|X:X::X:X|X:X::X:X/M> [bestpath|multipath] [json]",
+ "show [ip] bgp [<view|vrf> WORD] [<<ipv4|ipv6|encap> [unicast]|ipv4 multicast|vpnv4 unicast [rd ASN:nn_or_IP-address:nn]>] <A.B.C.D|A.B.C.D/M|X:X::X:X|X:X::X:X/M> [bestpath|multipath] [json]",
SHOW_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Address family\n"
- "Address Family modifier\n"
+ "Address family\n"
"Address family\n"
"Address Family modifier\n"
"Address family\n"
@@ -7878,8 +7872,6 @@ DEFUN (show_ip_bgp_route,
"Address Family modifier\n"
"Display information for a route distinguisher\n"
"VPN Route Distinguisher\n"
- "Address family\n"
- "Address Family modifier\n"
"Network in the BGP routing table to display\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"IPv6 prefix <network>/<length>\n"
@@ -9256,17 +9248,14 @@ peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,
DEFUN (show_ip_bgp_instance_neighbor_advertised_route,
show_ip_bgp_instance_neighbor_advertised_route_cmd,
- "show [ip] bgp [<view|vrf>] WORD [<ipv4 unicast|ipv4 multicast|ipv6 unicast|vpnv4 unicast|encap unicast>] neighbors <A.B.C.D|X:X::X:X|WORD> [<received-routes [route-map WORD]|advertised-routes [route-map WORD]>] [json]",
+ "show [ip] bgp [<view|vrf>] WORD [<<ipv4|ipv6|vpnv4|encap> [unicast]|ipv4 multicast>] neighbors <A.B.C.D|X:X::X:X|WORD> [<received-routes [route-map WORD]|advertised-routes [route-map WORD]>] [json]",
SHOW_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
"Address Family modifier\n"
"Address family\n"
@@ -9432,17 +9421,14 @@ bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
DEFUN (show_ip_bgp_neighbor_routes,
show_ip_bgp_neighbor_routes_cmd,
- "show [ip] bgp [<view|vrf> WORD] [<ipv4 unicast|ipv4 multicast|ipv6 unicast|vpnv4 unicast|encap unicast>] neighbors <A.B.C.D|X:X::X:X|WORD> <flap-statistics|dampened-routes|routes> [json]",
+ "show [ip] bgp [<view|vrf> WORD] [<<ipv4|ipv6|vpnv4|encap> [unicast]|ipv4 multicast>] neighbors <A.B.C.D|X:X::X:X|WORD> <flap-statistics|dampened-routes|routes> [json]",
SHOW_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
"Address Family modifier\n"
"Address family\n"
@@ -9783,21 +9769,9 @@ DEFUN (no_bgp_distance_source_access_list,
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "bgp dampening",
- * "BGP Specific commands\n"
- * "Enable route-flap dampening\n"
- *
- * "bgp dampening <1-45>",
- * "BGP Specific commands\n"
- * "Enable route-flap dampening\n"
- * "Half-life time for the penalty\n"
- *
- */
DEFUN (bgp_damp_set,
bgp_damp_set_cmd,
- "bgp dampening (1-45) (1-20000) (1-20000) (1-255)",
+ "bgp dampening [(1-45) [(1-20000) (1-20000) (1-255)]]",
"BGP Specific commands\n"
"Enable route-flap dampening\n"
"Half-life time for the penalty\n"
@@ -9805,26 +9779,26 @@ DEFUN (bgp_damp_set,
"Value to start suppressing a route\n"
"Maximum duration to suppress a stable route\n")
{
- int idx_number = 2;
- int idx_number_2 = 3;
- int idx_number_3 = 4;
- int idx_number_4 = 5;
+ int idx_half_life = 2;
+ int idx_reuse = 3;
+ int idx_suppress = 4;
+ int idx_max_suppress = 5;
struct bgp *bgp;
int half = DEFAULT_HALF_LIFE * 60;
int reuse = DEFAULT_REUSE;
int suppress = DEFAULT_SUPPRESS;
int max = 4 * half;
- if (argc == 4)
+ if (argc == 6)
{
- half = atoi (argv[idx_number]->arg) * 60;
- reuse = atoi (argv[idx_number_2]->arg);
- suppress = atoi (argv[idx_number_3]->arg);
- max = atoi (argv[idx_number_4]->arg) * 60;
+ half = atoi (argv[idx_half_life]->arg) * 60;
+ reuse = atoi (argv[idx_reuse]->arg);
+ suppress = atoi (argv[idx_suppress]->arg);
+ max = atoi (argv[idx_max_suppress]->arg) * 60;
}
- else if (argc == 1)
+ else if (argc == 3)
{
- half = atoi (argv[idx_number]->arg) * 60;
+ half = atoi (argv[idx_half_life]->arg) * 60;
max = 4 * half;
}
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index e1d8ca896d..dc90094f65 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -3938,7 +3938,7 @@ DEFUN (no_set_aspath_exclude,
DEFUN (set_community,
set_community_cmd,
- "set community .AA:NN",
+ "set community AA:NN...",
SET_STR
"BGP community attribute\n"
COMMUNITY_VAL_STR)
@@ -4047,7 +4047,7 @@ DEFUN (set_community_none,
* "BGP community attribute\n"
* "No community attribute\n"
*
- * "no set community .AA:NN",
+ * "no set community AA:NN...",
* NO_STR
* SET_STR
* "BGP community attribute\n"
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 2b2731a890..1fcdede2db 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -656,28 +656,17 @@ DEFUN (no_auto_summary,
}
/* "router bgp" commands. */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "router bgp",
- * ROUTER_STR
- * BGP_STR
- *
- * "router bgp (1-4294967295) (view|vrf) WORD",
- * ROUTER_STR
- * BGP_STR
- * AS_STR
- * "BGP view\nBGP VRF\n"
- * "View/VRF name\n"
- *
- */
DEFUN (router_bgp,
router_bgp_cmd,
- "router bgp (1-4294967295)",
+ "router bgp [(1-4294967295) [<view|vrf> WORD]]",
ROUTER_STR
BGP_STR
- AS_STR)
+ AS_STR
+ BGP_INSTANCE_HELP_STR)
{
- int idx_number = 2;
+ int idx_asn = 2;
+ int idx_view_vrf = 3;
+ int idx_vrf = 4;
int ret;
as_t as;
struct bgp *bgp;
@@ -685,7 +674,7 @@ DEFUN (router_bgp,
enum bgp_instance_type inst_type;
// "router bgp" without an ASN
- if (argc < 1)
+ if (argc == 2)
{
//Pending: Make VRF option available for ASN less config
bgp = bgp_get_default();
@@ -706,15 +695,16 @@ DEFUN (router_bgp,
// "router bgp X"
else
{
- VTY_GET_INTEGER_RANGE ("AS", as, argv[idx_number]->arg, 1, BGP_AS4_MAX);
+ VTY_GET_INTEGER_RANGE ("AS", as, argv[idx_asn]->arg, 1, BGP_AS4_MAX);
inst_type = BGP_INSTANCE_TYPE_DEFAULT;
- if (argc == 3)
+ if (argc > 3)
{
- name = argv[4]->arg;
- if (!strcmp(argv[3]->arg, "vrf"))
+ name = argv[idx_vrf]->arg;
+
+ if (!strcmp(argv[idx_view_vrf]->text, "vrf"))
inst_type = BGP_INSTANCE_TYPE_VRF;
- else if (!strcmp(argv[3]->arg, "view"))
+ else if (!strcmp(argv[idx_view_vrf]->text, "view"))
inst_type = BGP_INSTANCE_TYPE_VIEW;
}
@@ -745,38 +735,24 @@ DEFUN (router_bgp,
}
/* "no router bgp" commands. */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no router bgp",
- * NO_STR
- * ROUTER_STR
- * BGP_STR
- *
- * "no router bgp (1-4294967295) (view|vrf) WORD",
- * NO_STR
- * ROUTER_STR
- * BGP_STR
- * AS_STR
- * "BGP view\nBGP VRF\n"
- * "View/VRF name\n"
- *
- */
DEFUN (no_router_bgp,
no_router_bgp_cmd,
- "no router bgp (1-4294967295)",
+ "no router bgp [(1-4294967295) [<view|vrf> WORD]]",
NO_STR
ROUTER_STR
BGP_STR
- AS_STR)
+ AS_STR
+ BGP_INSTANCE_HELP_STR)
{
- int idx_number = 3;
+ int idx_asn = 3;
+ int idx_view_vrf = 4;
+ int idx_vrf = 5;
as_t as;
struct bgp *bgp;
const char *name = NULL;
-
// "no router bgp" without an ASN
- if (argc < 1)
+ if (argc == 3)
{
//Pending: Make VRF option available for ASN less config
bgp = bgp_get_default();
@@ -795,10 +771,10 @@ DEFUN (no_router_bgp,
}
else
{
- VTY_GET_INTEGER_RANGE ("AS", as, argv[idx_number]->arg, 1, BGP_AS4_MAX);
+ VTY_GET_INTEGER_RANGE ("AS", as, argv[idx_asn]->arg, 1, BGP_AS4_MAX);
- if (argc == 3)
- name = argv[5]->arg;
+ if (argc > 4)
+ name = argv[idx_vrf]->arg;
/* Lookup bgp structure. */
bgp = bgp_lookup (as, name);
@@ -844,31 +820,24 @@ DEFUN (bgp_router_id,
return CMD_SUCCESS;
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no bgp router-id A.B.C.D",
- * NO_STR
- * BGP_STR
- * "Override configured router identifier\n"
- * "Manually configured router identifier\n"
- *
- */
DEFUN (no_bgp_router_id,
no_bgp_router_id_cmd,
- "no bgp router-id",
+ "no bgp router-id [A.B.C.D]",
NO_STR
BGP_STR
- "Override configured router identifier\n")
+ "Override configured router identifier\n"
+ "Manually configured router identifier\n")
{
+ int idx_router_id = 3;
int ret;
struct in_addr id;
struct bgp *bgp;
bgp = vty->index;
- if (argc == 1)
+ if (argc > idx_router_id)
{
- ret = inet_aton (argv[3]->arg, &id);
+ ret = inet_aton (argv[idx_router_id]->arg, &id);
if (! ret)
{
vty_out (vty, "%% Malformed BGP router identifier%s", VTY_NEWLINE);
@@ -2801,55 +2770,45 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi,
return bgp_vty_return (vty, ret);
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "neighbor WORD interface peer-group WORD",
- * NEIGHBOR_STR
- * "Interface name or neighbor tag\n"
- * "Enable BGP on interface\n"
- * "Member of the peer-group\n"
- * "peer-group name\n"
- *
- */
DEFUN (neighbor_interface_config,
neighbor_interface_config_cmd,
- "neighbor WORD interface",
+ "neighbor WORD interface [peer-group WORD]",
NEIGHBOR_STR
"Interface name or neighbor tag\n"
- "Enable BGP on interface\n")
+ "Enable BGP on interface\n"
+ "Member of the peer-group\n"
+ "peer-group name\n")
{
int idx_word = 1;
- if (argc == 2)
+ int idx_peer_group_word = 4;
+
+ if (argc > idx_peer_group_word)
return peer_conf_interface_get (vty, argv[idx_word]->arg, AFI_IP, SAFI_UNICAST, 0,
- argv[3]->arg, NULL);
+ argv[idx_peer_group_word]->arg, NULL);
else
return peer_conf_interface_get (vty, argv[idx_word]->arg, AFI_IP, SAFI_UNICAST, 0,
NULL, NULL);
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "neighbor WORD interface v6only peer-group WORD",
- * NEIGHBOR_STR
- * "Interface name or neighbor tag\n"
- * "Enable BGP on interface\n"
- * "Enable BGP with v6 link-local only\n"
- * "Member of the peer-group\n"
- * "peer-group name\n"
- *
- */
DEFUN (neighbor_interface_config_v6only,
neighbor_interface_config_v6only_cmd,
- "neighbor WORD interface v6only",
+ "neighbor WORD interface v6only [peer-group WORD]",
NEIGHBOR_STR
"Interface name or neighbor tag\n"
"Enable BGP on interface\n"
- "Enable BGP with v6 link-local only\n")
+ "Enable BGP with v6 link-local only\n"
+ "Member of the peer-group\n"
+ "peer-group name\n")
{
int idx_word = 1;
+ int idx_peer_group_word = 5;
+
+ if (argc > idx_peer_group_word)
+ return peer_conf_interface_get (vty, argv[idx_word]->arg, AFI_IP, SAFI_UNICAST, 1,
+ argv[idx_peer_group_word]->arg, NULL);
+
return peer_conf_interface_get (vty, argv[idx_word]->arg, AFI_IP, SAFI_UNICAST, 1,
- argv[5]->arg, NULL);
+ NULL, NULL);
}
@@ -2967,56 +2926,17 @@ DEFUN (no_neighbor,
return CMD_SUCCESS;
}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no neighbor WORD interface remote-as ((1-4294967295)|internal|external)",
- * NO_STR
- * NEIGHBOR_STR
- * "Interface name\n"
- * "Configure BGP on interface\n"
- * AS_STR
- *
- * "no neighbor WORD interface v6only peer-group WORD",
- * NO_STR
- * NEIGHBOR_STR
- * "Interface name\n"
- * "Configure BGP on interface\n"
- * "Enable BGP with v6 link-local only\n"
- * "Member of the peer-group\n"
- * "peer-group name\n"
- *
- * "no neighbor WORD interface v6only remote-as ((1-4294967295)|internal|external)",
- * NO_STR
- * NEIGHBOR_STR
- * "Interface name\n"
- * "Configure BGP on interface\n"
- * "Enable BGP with v6 link-local only\n"
- * AS_STR
- *
- * "no neighbor WORD interface v6only",
- * NO_STR
- * NEIGHBOR_STR
- * "Interface name\n"
- * "Configure BGP on interface\n"
- * "Enable BGP with v6 link-local only\n"
- *
- * "no neighbor WORD interface peer-group WORD",
- * NO_STR
- * NEIGHBOR_STR
- * "Interface name\n"
- * "Configure BGP on interface\n"
- * "Member of the peer-group\n"
- * "peer-group name\n"
- *
- */
DEFUN (no_neighbor_interface_config,
no_neighbor_interface_config_cmd,
- "no neighbor WORD interface",
+ "no neighbor WORD interface [v6only] [peer-group WORD] [remote-as <(1-4294967295)|internal|external>]",
NO_STR
NEIGHBOR_STR
"Interface name\n"
- "Configure BGP on interface\n")
+ "Configure BGP on interface\n"
+ "Enable BGP with v6 link-local only\n"
+ "Member of the peer-group\n"
+ "peer-group name\n"
+ AS_STR)
{
int idx_word = 2;
struct peer *peer;
@@ -4083,57 +4003,6 @@ DEFUN (no_neighbor_nexthop_local_unchanged,
PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED );
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med next-hop as-path",
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "Med attribute\n"
- * "Nexthop attribute\n"
- * "As-path attribute\n"
- *
- * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med as-path next-hop",
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "Med attribute\n"
- * "As-path attribute\n"
- * "Nexthop attribute\n"
- *
- * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path next-hop med",
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "As-path attribute\n"
- * "Nexthop attribute\n"
- * "Med attribute\n"
- *
- * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop as-path med",
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "Nexthop attribute\n"
- * "As-path attribute\n"
- * "Med attribute\n"
- *
- * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path med next-hop",
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "As-path attribute\n"
- * "Med attribute\n"
- * "Nexthop attribute\n"
- *
- * "neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop med as-path",
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "Nexthop attribute\n"
- * "Med attribute\n"
- * "As-path attribute\n"
- *
- */
DEFUN (neighbor_attr_unchanged,
neighbor_attr_unchanged_cmd,
"neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged",
@@ -4244,76 +4113,16 @@ DEFUN (neighbor_attr_unchanged4,
bgp_node_safi (vty), flags);
}
-
-
-
-
-
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop med as-path",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "Nexthop attribute\n"
- * "Med attribute\n"
- * "As-path attribute\n"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path med next-hop",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "As-path attribute\n"
- * "Med attribute\n"
- * "Nexthop attribute\n"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med as-path next-hop",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "Med attribute\n"
- * "As-path attribute\n"
- * "Nexthop attribute\n"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop as-path med",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "Nexthop attribute\n"
- * "As-path attribute\n"
- * "Med attribute\n"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path next-hop med",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "As-path attribute\n"
- * "Nexthop attribute\n"
- * "Med attribute\n"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med next-hop as-path",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "BGP attribute is propagated unchanged to this neighbor\n"
- * "Med attribute\n"
- * "Nexthop attribute\n"
- * "As-path attribute\n"
- *
- */
DEFUN (no_neighbor_attr_unchanged,
no_neighbor_attr_unchanged_cmd,
- "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged",
+ "no neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged [as-path] [next-hop] [med]",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "BGP attribute is propagated unchanged to this neighbor\n")
+ "BGP attribute is propagated unchanged to this neighbor\n"
+ "As-path attribute\n"
+ "Med attribute\n"
+ "Nexthop attribute\n")
{
int idx_peer = 2;
return peer_af_flag_unset_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty),
@@ -4529,7 +4338,7 @@ DEFUN (no_neighbor_disable_connected_check,
DEFUN (neighbor_description,
neighbor_description_cmd,
- "neighbor <A.B.C.D|X:X::X:X|WORD> description .LINE",
+ "neighbor <A.B.C.D|X:X::X:X|WORD> description LINE...",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Neighbor specific description\n"
@@ -4555,9 +4364,6 @@ DEFUN (neighbor_description,
return CMD_SUCCESS;
}
-/* CHECK ME quentin mentioned something about LINE vs .LINE vs LINE... but
- * I don't remember what. We need to check all LINE and AA:NN
- * */
DEFUN (no_neighbor_description,
no_neighbor_description_cmd,
"no neighbor <A.B.C.D|X:X::X:X|WORD> description [LINE]",
@@ -5686,67 +5492,18 @@ DEFUN (neighbor_maximum_prefix_threshold_restart,
bgp_node_safi (vty), argv[idx_number]->arg, argv[idx_number_2]->arg, 0, argv[idx_number_3]->arg);
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295>",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "Maximum number of prefix accept from this peer\n"
- * "maximum no. of prefix limit\n"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> <1-100> restart <1-65535>",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "Maximum number of prefix accept from this peer\n"
- * "maximum no. of prefix limit\n"
- * "Threshold value (%) at which to generate a warning msg\n"
- * "Restart bgp connection after limit is exceeded\n"
- * "Restart interval in minutes"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> warning-only",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "Maximum number of prefix accept from this peer\n"
- * "maximum no. of prefix limit\n"
- * "Only give warning message when limit is exceeded\n"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> restart <1-65535>",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "Maximum number of prefix accept from this peer\n"
- * "maximum no. of prefix limit\n"
- * "Restart bgp connection after limit is exceeded\n"
- * "Restart interval in minutes"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> <1-100> warning-only",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "Maximum number of prefix accept from this peer\n"
- * "maximum no. of prefix limit\n"
- * "Threshold value (%) at which to generate a warning msg\n"
- * "Only give warning message when limit is exceeded\n"
- *
- * "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix <1-4294967295> <1-100>",
- * NO_STR
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "Maximum number of prefix accept from this peer\n"
- * "maximum no. of prefix limit\n"
- * "Threshold value (%) at which to generate a warning msg\n"
- *
- */
DEFUN (no_neighbor_maximum_prefix,
no_neighbor_maximum_prefix_cmd,
- "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix",
+ "no neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix [<1-4294967295> [<1-100>] [restart <1-65535>] [warning-only]]",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "Maximum number of prefix accept from this peer\n")
+ "Maximum number of prefix accept from this peer\n"
+ "maximum no. of prefix limit\n"
+ "Threshold value (%) at which to generate a warning msg\n"
+ "Restart bgp connection after limit is exceeded\n"
+ "Restart interval in minutes"
+ "Only give warning message when limit is exceeded\n")
{
int idx_peer = 2;
return peer_maximum_prefix_unset_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty),
@@ -5755,23 +5512,16 @@ DEFUN (no_neighbor_maximum_prefix,
/* "neighbor allowas-in" */
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in <1-10>",
- * NEIGHBOR_STR
- * NEIGHBOR_ADDR_STR2
- * "Accept as-path with my AS present in it\n"
- * "Number of occurances of AS number\n"
- *
- */
DEFUN (neighbor_allowas_in,
neighbor_allowas_in_cmd,
- "neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in",
+ "neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in [(1-10)]",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "Accept as-path with my AS present in it\n")
+ "Accept as-path with my AS present in it\n"
+ "Number of occurances of AS number\n")
{
int idx_peer = 1;
+ int idx_number = 3;
int ret;
struct peer *peer;
unsigned int allow_num;
@@ -5780,10 +5530,10 @@ DEFUN (neighbor_allowas_in,
if (! peer)
return CMD_WARNING;
- if (argc == 1)
+ if (argc <= idx_number)
allow_num = 3;
else
- VTY_GET_INTEGER_RANGE ("AS number", allow_num, argv[3]->arg, 1, 10);
+ VTY_GET_INTEGER_RANGE ("AS number", allow_num, argv[idx_number]->arg, 1, 10);
ret = peer_allowas_in_set (peer, bgp_node_afi (vty), bgp_node_safi (vty),
allow_num);
@@ -6233,7 +5983,7 @@ bgp_get_argv_afi_safi (int argc, struct cmd_token **argv,
/* one clear bgp command to rule them all */
DEFUN (clear_ip_bgp_all,
clear_ip_bgp_all_cmd,
- "clear [ip] bgp [<view|vrf> WORD] <*|A.B.C.D|X:X::X:X|WORD|(1-4294967295)|external|peer-group WORD> [<ipv4 unicast|ipv4 multicast|ipv6 unicast|vpnv4 unicast|encap unicast>] [<soft [<in|out>]|in [prefix-filter]|out>]",
+ "clear [ip] bgp [<view|vrf> WORD] <*|A.B.C.D|X:X::X:X|WORD|(1-4294967295)|external|peer-group WORD> [<<ipv4|ipv6|vpnv4|encap> [unicast]|ipv4 multicast>] [<soft [<in|out>]|in [prefix-filter]|out>]",
CLEAR_STR
IP_STR
BGP_STR
@@ -6247,11 +5997,8 @@ DEFUN (clear_ip_bgp_all,
"Clear all members of peer-group\n"
"BGP peer-group name\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
"Address Family modifier\n"
"Address family\n"
@@ -7099,17 +6846,14 @@ bgp_show_all_instances_summary_vty (struct vty *vty, afi_t afi, safi_t safi,
/* `show ip bgp summary' commands. */
DEFUN (show_ip_bgp_summary,
show_ip_bgp_summary_cmd,
- "show [ip] bgp [<view|vrf> WORD] [<ipv4 unicast|ipv4 multicast|ipv6 unicast|vpnv4 unicast|encap unicast>] summary [json]",
+ "show [ip] bgp [<view|vrf> WORD] [<<ipv4|ipv6|vpnv4|encap> [unicast]|ipv4 multicast>] summary [json]",
SHOW_STR
IP_STR
BGP_STR
BGP_INSTANCE_HELP_STR
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
- "Address Family modifier\n"
"Address family\n"
"Address Family modifier\n"
"Address family\n"
@@ -9157,7 +8901,7 @@ bgp_show_all_instances_updgrps_vty (struct vty *vty, afi_t afi, safi_t safi)
DEFUN (show_ip_bgp_updgrps,
show_ip_bgp_updgrps_cmd,
- "show [ip] bgp [<view|vrf> WORD] [<ipv4 unicast|ipv4 multicast|ipv6 unicast|vpnv4 unicast|encap unicast>] update-groups [SUBGROUP-ID]",
+ "show [ip] bgp [<view|vrf> WORD] [<<ipv4|ipv6|vpnv4|encap> [unicast]|ipv4 multicast>] update-groups [SUBGROUP-ID]",
SHOW_STR
IP_STR
BGP_STR
@@ -10001,57 +9745,18 @@ DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap,
return bgp_redistribute_set (vty->index, AFI_IP, protocol, instance);
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no redistribute (ospf|table) <1-65535> route-map WORD",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * "Open Shortest Path First (OSPFv2)\n"
- * "Non-main Kernel Routing Table\n"
- * "Instance ID/Table ID\n"
- * "Route map reference\n"
- * "Pointer to route-map entries\n"
- *
- * "no redistribute (ospf|table) <1-65535> metric <0-4294967295>",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * "Open Shortest Path First (OSPFv2)\n"
- * "Non-main Kernel Routing Table\n"
- * "Instance ID/Table ID\n"
- * "Metric for redistributed routes\n"
- * "Default metric\n"
- *
- * "no redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295>",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * "Open Shortest Path First (OSPFv2)\n"
- * "Non-main Kernel Routing Table\n"
- * "Instance ID/Table ID\n"
- * "Route map reference\n"
- * "Pointer to route-map entries\n"
- * "Metric for redistributed routes\n"
- * "Default metric\n"
- *
- * "no redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * "Open Shortest Path First (OSPFv2)\n"
- * "Non-main Kernel Routing Table\n"
- * "Instance ID/Table ID\n"
- * "Metric for redistributed routes\n"
- * "Default metric\n"
- * "Route map reference\n"
- * "Pointer to route-map entries\n"
- *
- */
DEFUN (no_bgp_redistribute_ipv4_ospf,
no_bgp_redistribute_ipv4_ospf_cmd,
- "no redistribute <ospf|table> (1-65535)",
+ "no redistribute <ospf|table> (1-65535) [metric <0-4294967295>] [route-map WORD]",
NO_STR
"Redistribute information from another routing protocol\n"
"Open Shortest Path First (OSPFv2)\n"
"Non-main Kernel Routing Table\n"
- "Instance ID/Table ID\n")
+ "Instance ID/Table ID\n"
+ "Metric for redistributed routes\n"
+ "Default metric\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n")
{
int idx_ospf_table = 2;
int idx_number = 3;
@@ -10067,51 +9772,16 @@ DEFUN (no_bgp_redistribute_ipv4_ospf,
return bgp_redistribute_unset (vty->index, AFI_IP, protocol, instance);
}
-
-
-
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no redistribute <kernel|connected|static|rip|ospf|isis|pim|table> metric <0-4294967295> route-map WORD",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * QUAGGA_IP_REDIST_HELP_STR_BGPD
- * "Metric for redistributed routes\n"
- * "Default metric\n"
- * "Route map reference\n"
- * "Pointer to route-map entries\n"
- *
- * "no redistribute <kernel|connected|static|rip|ospf|isis|pim|table> route-map WORD",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * QUAGGA_IP_REDIST_HELP_STR_BGPD
- * "Route map reference\n"
- * "Pointer to route-map entries\n"
- *
- * "no redistribute <kernel|connected|static|rip|ospf|isis|pim|table> route-map WORD metric <0-4294967295>",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * QUAGGA_IP_REDIST_HELP_STR_BGPD
- * "Route map reference\n"
- * "Pointer to route-map entries\n"
- * "Metric for redistributed routes\n"
- * "Default metric\n"
- *
- * "no redistribute <kernel|connected|static|rip|ospf|isis|pim|table> metric <0-4294967295>",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * QUAGGA_IP_REDIST_HELP_STR_BGPD
- * "Metric for redistributed routes\n"
- * "Default metric\n"
- *
- */
DEFUN (no_bgp_redistribute_ipv4,
no_bgp_redistribute_ipv4_cmd,
- "no redistribute <kernel|connected|static|rip|ospf|isis|pim|table>",
+ "no redistribute <kernel|connected|static|rip|ospf|isis|pim|table> [metric <0-4294967295>] [route-map WORD]",
NO_STR
"Redistribute information from another routing protocol\n"
- QUAGGA_IP_REDIST_HELP_STR_BGPD)
+ QUAGGA_IP_REDIST_HELP_STR_BGPD
+ "Metric for redistributed routes\n"
+ "Default metric\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n")
{
int idx_protocol = 2;
int type;
@@ -10125,10 +9795,6 @@ DEFUN (no_bgp_redistribute_ipv4,
return bgp_redistribute_unset (vty->index, AFI_IP, type, 0);
}
-
-
-
-
#ifdef HAVE_IPV6
DEFUN (bgp_redistribute_ipv6,
bgp_redistribute_ipv6_cmd,
@@ -10264,47 +9930,16 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap,
return bgp_redistribute_set (vty->index, AFI_IP6, type, 0);
}
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no redistribute <kernel|connected|static|ripng|ospf6|isis|table> route-map WORD",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * QUAGGA_IP6_REDIST_HELP_STR_BGPD
- * "Route map reference\n"
- * "Pointer to route-map entries\n"
- *
- * "no redistribute <kernel|connected|static|ripng|ospf6|isis|table> route-map WORD metric <0-4294967295>",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * QUAGGA_IP6_REDIST_HELP_STR_BGPD
- * "Route map reference\n"
- * "Pointer to route-map entries\n"
- * "Metric for redistributed routes\n"
- * "Default metric\n"
- *
- * "no redistribute <kernel|connected|static|ripng|ospf6|isis|table> metric <0-4294967295> route-map WORD",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * QUAGGA_IP6_REDIST_HELP_STR_BGPD
- * "Metric for redistributed routes\n"
- * "Default metric\n"
- * "Route map reference\n"
- * "Pointer to route-map entries\n"
- *
- * "no redistribute <kernel|connected|static|ripng|ospf6|isis|table> metric <0-4294967295>",
- * NO_STR
- * "Redistribute information from another routing protocol\n"
- * QUAGGA_IP6_REDIST_HELP_STR_BGPD
- * "Metric for redistributed routes\n"
- * "Default metric\n"
- *
- */
DEFUN (no_bgp_redistribute_ipv6,
no_bgp_redistribute_ipv6_cmd,
- "no redistribute <kernel|connected|static|ripng|ospf6|isis|table>",
+ "no redistribute <kernel|connected|static|ripng|ospf6|isis|table> [metric <0-4294967295>] [route-map WORD]",
NO_STR
"Redistribute information from another routing protocol\n"
- QUAGGA_IP6_REDIST_HELP_STR_BGPD)
+ QUAGGA_IP6_REDIST_HELP_STR_BGPD
+ "Metric for redistributed routes\n"
+ "Default metric\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n")
{
int idx_protocol = 2;
int type;
@@ -11658,7 +11293,7 @@ community_list_unset_vty (struct vty *vty, int argc, struct cmd_token **argv,
/* ip community-list standard */
DEFUN (ip_community_list_standard,
ip_community_list_standard_cmd,
- "ip community-list <(1-99)|standard WORD> <deny|permit> [.AA:NN]",
+ "ip community-list <(1-99)|standard WORD> <deny|permit> AA:NN...",
IP_STR
COMMUNITY_LIST_STR
"Community list number (standard)\n"
@@ -11673,7 +11308,7 @@ DEFUN (ip_community_list_standard,
DEFUN (no_ip_community_list_standard_all,
no_ip_community_list_standard_all_cmd,
- "no ip community-list <(1-99)|standard WORD> [<deny|permit> [.AA:NN]]",
+ "no ip community-list <(1-99)|standard WORD> <deny|permit> AA:NN...",
NO_STR
IP_STR
COMMUNITY_LIST_STR
@@ -11690,7 +11325,7 @@ DEFUN (no_ip_community_list_standard_all,
/* ip community-list expanded */
DEFUN (ip_community_list_expanded_all,
ip_community_list_expanded_all_cmd,
- "ip community-list <(100-500)|expanded WORD> [<deny|permit> [.LINE]]",
+ "ip community-list <(100-500)|expanded WORD> <deny|permit> LINE...",
IP_STR
COMMUNITY_LIST_STR
"Community list number (expanded)\n"
@@ -11705,7 +11340,7 @@ DEFUN (ip_community_list_expanded_all,
DEFUN (no_ip_community_list_expanded_all,
no_ip_community_list_expanded_all_cmd,
- "no ip community-list <(100-500)|expanded WORD> [<deny|permit> [.LINE]]",
+ "no ip community-list <(100-500)|expanded WORD> <deny|permit> LINE...",
NO_STR
IP_STR
COMMUNITY_LIST_STR
@@ -11897,7 +11532,7 @@ extcommunity_list_unset_vty (struct vty *vty, int argc, struct cmd_token **argv,
DEFUN (ip_extcommunity_list_standard,
ip_extcommunity_list_standard_cmd,
- "ip extcommunity-list <(1-99)|standard WORD> <deny|permit> [.AA:NN]",
+ "ip extcommunity-list <(1-99)|standard WORD> <deny|permit> AA:NN...",
IP_STR
EXTCOMMUNITY_LIST_STR
"Extended Community list number (standard)\n"
@@ -11912,7 +11547,7 @@ DEFUN (ip_extcommunity_list_standard,
DEFUN (ip_extcommunity_list_name_expanded,
ip_extcommunity_list_name_expanded_cmd,
- "ip extcommunity-list <(100-500)|expanded WORD> <deny|permit> [.LINE]",
+ "ip extcommunity-list <(100-500)|expanded WORD> <deny|permit> LINE...",
IP_STR
EXTCOMMUNITY_LIST_STR
"Extended Community list number (expanded)\n"
@@ -11927,7 +11562,7 @@ DEFUN (ip_extcommunity_list_name_expanded,
DEFUN (no_ip_extcommunity_list_standard_all,
no_ip_extcommunity_list_standard_all_cmd,
- "no ip extcommunity-list <(1-99)|standard WORD> <deny|permit> [.AA:NN]",
+ "no ip extcommunity-list <(1-99)|standard WORD> <deny|permit> AA:NN...",
NO_STR
IP_STR
EXTCOMMUNITY_LIST_STR
@@ -11943,7 +11578,7 @@ DEFUN (no_ip_extcommunity_list_standard_all,
DEFUN (no_ip_extcommunity_list_expanded_all,
no_ip_extcommunity_list_expanded_all_cmd,
- "no ip extcommunity-list <(100-500)|expanded WORD> <deny|permit> [.LINE]",
+ "no ip extcommunity-list <(100-500)|expanded WORD> <deny|permit> LINE...",
NO_STR
IP_STR
EXTCOMMUNITY_LIST_STR
diff --git a/lib/filter.c b/lib/filter.c
index 40bf0a3395..11dd7cd1c9 100644
--- a/lib/filter.c
+++ b/lib/filter.c
@@ -1470,7 +1470,7 @@ DEFUN (no_access_list_all,
DEFUN (access_list_remark,
access_list_remark_cmd,
- "access-list <(1-99)|(100-199)|(1300-1999)|(2000-2699)|WORD> remark .LINE",
+ "access-list <(1-99)|(100-199)|(1300-1999)|(2000-2699)|WORD> remark LINE...",
"Add an access list entry\n"
"IP standard access list\n"
"IP extended access list\n"
@@ -1666,7 +1666,7 @@ DEFUN (no_ipv6_access_list_all,
DEFUN (ipv6_access_list_remark,
ipv6_access_list_remark_cmd,
- "ipv6 access-list WORD remark .LINE",
+ "ipv6 access-list WORD remark LINE...",
IPV6_STR
"Add an access list entry\n"
"IPv6 zebra access-list\n"
diff --git a/lib/plist.c b/lib/plist.c
index 5911d6cf7f..0d1cafde66 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -1898,7 +1898,7 @@ DEFUN (no_ip_prefix_list_sequence_number,
DEFUN (ip_prefix_list_description,
ip_prefix_list_description_cmd,
- "ip prefix-list WORD description .LINE",
+ "ip prefix-list WORD description LINE...",
IP_STR
PREFIX_LIST_STR
"Name of a prefix list\n"
@@ -2609,7 +2609,7 @@ DEFUN (no_ipv6_prefix_list_sequence_number,
DEFUN (ipv6_prefix_list_description,
ipv6_prefix_list_description_cmd,
- "ipv6 prefix-list WORD description .LINE",
+ "ipv6 prefix-list WORD description LINE...",
IPV6_STR
PREFIX_LIST_STR
"Name of a prefix list\n"
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 52302a6460..f1c2753526 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -4160,7 +4160,7 @@ static struct igmp_sock *find_igmp_sock_by_fd(int fd)
DEFUN (test_igmp_receive_report,
test_igmp_receive_report_cmd,
- "test igmp receive report (0-65535) A.B.C.D (1-6) .LINE",
+ "test igmp receive report (0-65535) A.B.C.D (1-6) LINE...",
"Test\n"
"Test IGMP protocol\n"
"Test IGMP message\n"
@@ -4276,7 +4276,7 @@ static int hexval(uint8_t ch)
DEFUN (test_pim_receive_dump,
test_pim_receive_dump_cmd,
- "test pim receive dump INTERFACE A.B.C.D .LINE",
+ "test pim receive dump INTERFACE A.B.C.D LINE...",
"Test\n"
"Test PIM protocol\n"
"Test PIM message reception\n"
diff --git a/tests/heavy-thread.c b/tests/heavy-thread.c
index c2e71c17d6..c43fa76c0e 100644
--- a/tests/heavy-thread.c
+++ b/tests/heavy-thread.c
@@ -104,7 +104,7 @@ clear_something (struct thread *thread)
DEFUN (clear_foo,
clear_foo_cmd,
- "clear foo .LINE",
+ "clear foo LINE...",
"clear command\n"
"arbitrary string\n")
{
diff --git a/tests/heavy-wq.c b/tests/heavy-wq.c
index 2d15dc37bd..97371face1 100644
--- a/tests/heavy-wq.c
+++ b/tests/heavy-wq.c
@@ -140,7 +140,7 @@ clear_something (struct vty *vty, const char *str)
DEFUN (clear_foo,
clear_foo_cmd,
- "clear foo .LINE",
+ "clear foo LINE...",
"clear command\n"
"arbitrary string\n")
{
diff --git a/tests/heavy.c b/tests/heavy.c
index 9af46c88f7..6ba8d9aa6d 100644
--- a/tests/heavy.c
+++ b/tests/heavy.c
@@ -82,7 +82,7 @@ clear_something (struct vty *vty, const char *str)
DEFUN (clear_foo,
clear_foo_cmd,
- "clear foo .LINE",
+ "clear foo LINE...",
"clear command\n"
"arbitrary string\n")
{
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 05fb038184..e6aebd6b1a 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1700,7 +1700,7 @@ ALIAS (vtysh_exit_vrf,
* and isisd. */
DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD,
interface_desc_cmd,
- "description .LINE",
+ "description LINE...",
"Interface specific description\n"
"Characters describing this interface\n")
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 005c9370b5..88036f44bd 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -337,1274 +337,69 @@ DEFUN (show_ip_rpf_addr,
return CMD_SUCCESS;
}
-/* Static route configuration. */
-DEFUN (ip_route,
- ip_route_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0>",
- 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"
- "Null interface\n")
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname_null = 3;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, NULL,
- NULL, NULL);
-}
-
-DEFUN (ip_route_tag,
- ip_route_tag_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> tag (1-65535)",
- 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"
- "Null interface\n"
- "Set tag for this route\n"
- "Tag value\n")
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname_null = 3;
- int idx_number = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg,
- NULL, NULL);
-}
-
-DEFUN (ip_route_flags,
- ip_route_flags_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole>",
- 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")
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname = 3;
- int idx_reject_blackhole = 4;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, NULL,
- NULL, NULL);
-}
-
-DEFUN (ip_route_flags_tag,
- ip_route_flags_tag_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535)",
- 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")
-
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg,
- NULL, NULL);
-}
-
-DEFUN (ip_route_flags2,
- ip_route_flags2_cmd,
- "ip route A.B.C.D/M <reject|blackhole>",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv4_prefixlen = 2;
- int idx_reject_blackhole = 3;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, NULL,
- NULL, NULL);
-}
-
-DEFUN (ip_route_flags2_tag,
- ip_route_flags2_tag_cmd,
- "ip route A.B.C.D/M <reject|blackhole> tag (1-65535)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Set tag for this route\n"
- "Tag value\n")
-
-{
- int idx_ipv4_prefixlen = 2;
- int idx_reject_blackhole = 3;
- int idx_number = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg,
- NULL, NULL);
-}
-
-/* Mask as A.B.C.D format. */
-DEFUN (ip_route_mask,
- ip_route_mask_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0>",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "IP gateway address\n"
- "IP gateway interface name\n"
- "Null interface\n")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname_null = 4;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, NULL,
- NULL, NULL);
-}
-
-DEFUN (ip_route_mask_tag,
- ip_route_mask_tag_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> tag (1-65535)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "IP gateway address\n"
- "IP gateway interface name\n"
- "Null interface\n"
- "Set tag for this route\n"
- "Tag value\n")
-
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg,
- NULL, NULL);
-}
-
-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>",
- 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")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- 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, NULL,
- NULL, NULL);
-}
-
-DEFUN (ip_route_mask_flags_tag,
- ip_route_mask_flags_tag_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535)",
- 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")
-
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- 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, argv[idx_number]->arg,
- NULL, NULL);
-}
-
-DEFUN (ip_route_mask_flags2,
- ip_route_mask_flags2_cmd,
- "ip route A.B.C.D A.B.C.D <reject|blackhole>",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_reject_blackhole = 4;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL,
- NULL, NULL);
-}
-
-DEFUN (ip_route_mask_flags2_tag,
- ip_route_mask_flags2_tag_cmd,
- "ip route A.B.C.D A.B.C.D <reject|blackhole> tag (1-65535)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Set tag for this route\n"
- "Tag value\n")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg,
- NULL, NULL);
-}
-
-/* Distance option value. */
-DEFUN (ip_route_distance,
- ip_route_distance_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> (1-255)",
- 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"
- "Null interface\n"
- "Distance value for this route\n")
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname_null = 3;
- int idx_number = 4;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ip_route_tag_distance,
- ip_route_tag_distance_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> tag (1-65535) (1-255)",
- 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"
- "Null interface\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this route\n")
-
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname_null = 3;
- int idx_number = 5;
- int idx_number_2 = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (ip_route_flags_distance,
- ip_route_flags_distance_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> (1-255)",
- 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"
- "Distance value for this route\n")
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ip_route_flags_tag_distance,
- ip_route_flags_tag_distance_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) (1-255)",
- 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")
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (ip_route_flags_distance2,
- ip_route_flags_distance2_cmd,
- "ip route A.B.C.D/M <reject|blackhole> (1-255)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this route\n")
-{
- int idx_ipv4_prefixlen = 2;
- int idx_reject_blackhole = 3;
- int idx_number = 4;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ip_route_flags_tag_distance2,
- ip_route_flags_tag_distance2_cmd,
- "ip route A.B.C.D/M <reject|blackhole> tag (1-65535) (1-255)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\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")
-{
- int idx_ipv4_prefixlen = 2;
- int idx_reject_blackhole = 3;
- int idx_number = 5;
- int idx_number_2 = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (ip_route_mask_distance,
- ip_route_mask_distance_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> (1-255)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "IP gateway address\n"
- "IP gateway interface name\n"
- "Null interface\n"
- "Distance value for this route\n")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ip_route_mask_tag_distance,
- ip_route_mask_tag_distance_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> tag (1-65535) (1-255)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "IP gateway address\n"
- "IP gateway interface name\n"
- "Null interface\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this route\n")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (ip_route_mask_flags_tag_distance,
- ip_route_mask_flags_tag_distance_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) (1-255)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "IP gateway address\n"
- "IP gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this route\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- 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, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-
-DEFUN (ip_route_mask_flags_distance,
- ip_route_mask_flags_distance_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> (1-255)",
- 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"
- "Distance value for this route\n")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- 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, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ip_route_mask_flags_distance2,
- ip_route_mask_flags_distance2_cmd,
- "ip route A.B.C.D A.B.C.D <reject|blackhole> (1-255)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this route\n")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ip_route_mask_flags_tag_distance2,
- ip_route_mask_flags_tag_distance2_cmd,
- "ip route A.B.C.D A.B.C.D <reject|blackhole> tag (1-65535) (1-255)",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this route\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole)",
- * 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"
- *
- */
-DEFUN (no_ip_route,
- no_ip_route_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0>",
- 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"
- "Null interface\n")
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname_null = 4;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, NULL,
- NULL, NULL);
-}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
- * 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"
- *
- */
-DEFUN (no_ip_route_tag,
- no_ip_route_tag_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> tag (1-65535)",
- 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"
- "Null interface\n"
- "Tag of this route\n"
- "Tag value\n")
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg,
- NULL, NULL);
-}
-
-
-
-DEFUN (no_ip_route_flags2,
- no_ip_route_flags2_cmd,
- "no ip route A.B.C.D/M <reject|blackhole>",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv4_prefixlen = 3;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, NULL, NULL,
- NULL, NULL);
-}
-
-DEFUN (no_ip_route_flags2_tag,
- no_ip_route_flags2_tag_cmd,
- "no ip route A.B.C.D/M <reject|blackhole> tag (1-65535)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Tag of this route\n"
- "Tag value\n")
-{
- int idx_ipv4_prefixlen = 3;
- int idx_reject_blackhole = 4;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, NULL, argv[idx_reject_blackhole]->arg,
- NULL, NULL);
-}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole)",
- * 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"
- *
- */
-DEFUN (no_ip_route_mask,
- no_ip_route_mask_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0>",
- 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"
- "Null interface\n")
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname_null = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, NULL,
- NULL, NULL);
-}
-
-/*
- * CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535>",
- * 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"
- *
- */
-DEFUN (no_ip_route_mask_tag,
- no_ip_route_mask_tag_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> tag (1-65535)",
- 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"
- "Null interface\n"
- "Tag of this route\n"
- "Tag value\n")
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname_null = 5;
- int idx_number = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg,
- NULL, NULL);
-}
-
-
-
-DEFUN (no_ip_route_mask_flags2,
- no_ip_route_mask_flags2_cmd,
- "no ip route A.B.C.D A.B.C.D <reject|blackhole>",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, NULL, NULL,
- NULL, NULL);
-}
-
-DEFUN (no_ip_route_mask_flags2_tag,
- no_ip_route_mask_flags2_tag_cmd,
- "no ip route A.B.C.D A.B.C.D <reject|blackhole> tag (1-65535)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Tag of this route\n"
- "Tag value\n")
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_reject_blackhole = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg,
- NULL, NULL);
-}
-
-DEFUN (no_ip_route_distance,
- no_ip_route_distance_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> (1-255)",
- 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"
- "Null interface\n"
- "Distance value for this route\n")
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (no_ip_route_tag_distance,
- no_ip_route_tag_distance_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> tag (1-65535) (1-255)",
- 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"
- "Null interface\n"
- "Tag of this route\n"
- "Tag value\n"
- "Distance value for this route\n")
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (no_ip_route_flags_distance,
- no_ip_route_flags_distance_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> (1-255)",
- 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"
- "Distance value for this route\n")
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (no_ip_route_flags_tag_distance,
- no_ip_route_flags_tag_distance_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) (1-255)",
- 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")
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (no_ip_route_flags_distance2,
- no_ip_route_flags_distance2_cmd,
- "no ip route A.B.C.D/M <reject|blackhole> (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this route\n")
-{
- int idx_ipv4_prefixlen = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (no_ip_route_flags_tag_distance2,
- no_ip_route_flags_tag_distance2_cmd,
- "no ip route A.B.C.D/M <reject|blackhole> tag (1-65535) (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\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")
-{
- int idx_ipv4_prefixlen = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (no_ip_route_mask_distance,
- no_ip_route_mask_distance_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> (1-255)",
- 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"
- "Null interface\n"
- "Distance value for this route\n")
+static void
+zebra_vty_ip_route_tdv_helper (int argc, struct cmd_token *argv[],
+ int idx_curr, char **tag,
+ char **distance, char **vrf)
{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname_null = 5;
- int idx_number = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, NULL,
- argv[idx_number]->arg, NULL);
-}
+ if (argc > idx_curr)
+ {
+ if (strmatch (argv[idx_curr]->text, "tag"))
+ {
+ *tag = argv[idx_curr]->arg;
+ idx_curr++;
+ }
-DEFUN (no_ip_route_mask_tag_distance,
- no_ip_route_mask_tag_distance_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> tag (1-65535) (1-255)",
- 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"
- "Null interface\n"
- "Tag of this route\n"
- "Tag value\n"
- "Distance value for this route\n")
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname_null = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
+ if (strmatch (argv[idx_curr]->text, "vrf"))
+ {
+ *distance = NULL;
+ *vrf = argv[idx_curr]->arg;
+ }
+ else
+ {
+ *distance = argv[idx_curr]->arg;
+ *vrf = argv[++idx_curr]->arg;
+ }
+ }
-DEFUN (no_ip_route_mask_flags_distance,
- no_ip_route_mask_flags_distance_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> (1-255)",
- 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"
- "Distance value for this route\n")
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname = 5;
- int idx_reject_blackhole = 6;
- int idx_number = 7;
- 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, NULL,
- argv[idx_number]->arg, NULL);
+ return;
}
-DEFUN (no_ip_route_mask_flags_tag_distance,
- no_ip_route_mask_flags_tag_distance_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) (1-255)",
- 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")
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname = 5;
- int idx_reject_blackhole = 6;
- int idx_number = 8;
- int idx_number_2 = 9;
- 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, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (no_ip_route_mask_flags_distance2,
- no_ip_route_mask_flags_distance2_cmd,
- "no ip route A.B.C.D A.B.C.D <reject|blackhole> (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this route\n")
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL,
- argv[idx_number]->arg, NULL);
-}
-
-DEFUN (no_ip_route_mask_flags_tag_distance2,
- no_ip_route_mask_flags_tag_distance2_cmd,
- "no ip route A.B.C.D A.B.C.D <reject|blackhole> tag (1-65535) (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\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")
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg,
- argv[idx_number_2]->arg, NULL);
-}
/* Static route configuration. */
-DEFUN (ip_route_vrf,
- ip_route_vrf_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> 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"
- "Null interface\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname_null = 3;
- int idx_name = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_tag_vrf,
- ip_route_tag_vrf_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> tag (1-65535) 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"
- "Null interface\n"
- "Set tag for this route\n"
- "Tag value\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname_null = 3;
- int idx_number = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_flags_vrf,
- ip_route_flags_vrf_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_name = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_flags_tag_vrf,
- ip_route_flags_tag_vrf_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) 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"
- VRF_CMD_HELP_STR)
-
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_flags2_vrf,
- ip_route_flags2_vrf_cmd,
- "ip route A.B.C.D/M <reject|blackhole> vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 2;
- int idx_reject_blackhole = 3;
- int idx_name = 5;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_flags2_tag_vrf,
- ip_route_flags2_tag_vrf_cmd,
- "ip route A.B.C.D/M <reject|blackhole> tag (1-65535) vrf NAME",
+DEFUN (ip_route,
+ ip_route_cmd,
+ "ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> [tag (1-65535)] [(1-255)] [vrf NAME]",
IP_STR
"Establish static routes\n"
"IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Set tag for this route\n"
- "Tag value\n"
- VRF_CMD_HELP_STR)
-
-{
- int idx_ipv4_prefixlen = 2;
- int idx_reject_blackhole = 3;
- int idx_number = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-/* Mask as A.B.C.D format. */
-DEFUN (ip_route_mask_vrf,
- ip_route_mask_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> 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"
- "Null interface\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_name = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_mask_tag_vrf,
- ip_route_mask_tag_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> tag (1-65535) 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"
"Null interface\n"
"Set tag for this route\n"
"Tag value\n"
- VRF_CMD_HELP_STR)
-
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_mask_flags_vrf,
- ip_route_mask_flags_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_name = 7;
- 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, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_mask_flags_tag_vrf,
- ip_route_mask_flags_tag_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) 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"
- VRF_CMD_HELP_STR)
-
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_name = 9;
- 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, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_mask_flags2_vrf,
- ip_route_mask_flags2_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <reject|blackhole> vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_reject_blackhole = 4;
- int idx_name = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_mask_flags2_tag_vrf,
- ip_route_mask_flags2_tag_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <reject|blackhole> tag (1-65535) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Set tag for this route\n"
- "Tag value\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-/* Distance option value. */
-DEFUN (ip_route_distance_vrf,
- ip_route_distance_vrf_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> (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"
- "Null interface\n"
"Distance value for this route\n"
VRF_CMD_HELP_STR)
{
int idx_ipv4_prefixlen = 2;
int idx_ipv4_ifname_null = 3;
- int idx_number = 4;
- int idx_name = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 4;
+ char *tag, *distance, *vrf;
-DEFUN (ip_route_tag_distance_vrf,
- ip_route_tag_distance_vrf_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> tag (1-65535) (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"
- "Null interface\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname_null = 3;
- int idx_number = 5;
- int idx_number_2 = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
+ return zebra_static_ipv4 (vty, SAFI_UNICAST, 1,
+ argv[idx_ipv4_prefixlen]->arg,
+ NULL,
+ argv[idx_ipv4_ifname_null]->arg,
+ NULL,
+ tag, distance, vrf);
}
-DEFUN (ip_route_flags_distance_vrf,
- ip_route_flags_distance_vrf_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> (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"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 2;
- int idx_ipv4_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_flags_tag_distance_vrf,
- ip_route_flags_tag_distance_vrf_cmd,
- "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
+DEFUN (ip_route_flags,
+ ip_route_flags_cmd,
+ "ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> [tag (1-65535)] [(1-255)] [vrf NAME]",
IP_STR
"Establish static routes\n"
"IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -1620,33 +415,23 @@ DEFUN (ip_route_flags_tag_distance_vrf,
int idx_ipv4_prefixlen = 2;
int idx_ipv4_ifname = 3;
int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- int idx_name = 9;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 5;
+ char *tag, *distance, *vrf;
-DEFUN (ip_route_flags_distance2_vrf,
- ip_route_flags_distance2_vrf_cmd,
- "ip route A.B.C.D/M <reject|blackhole> (1-255) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 2;
- int idx_reject_blackhole = 3;
- int idx_number = 4;
- int idx_name = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
+
+ 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);
}
-DEFUN (ip_route_flags_tag_distance2_vrf,
- ip_route_flags_tag_distance2_vrf_cmd,
- "ip route A.B.C.D/M <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
+DEFUN (ip_route_flags2,
+ ip_route_flags2_cmd,
+ "ip route A.B.C.D/M <reject|blackhole> [tag (1-65535)] [(1-255)] [vrf NAME]",
IP_STR
"Establish static routes\n"
"IP destination prefix (e.g. 10.0.0.0/8)\n"
@@ -1659,36 +444,24 @@ DEFUN (ip_route_flags_tag_distance2_vrf,
{
int idx_ipv4_prefixlen = 2;
int idx_reject_blackhole = 3;
- int idx_number = 5;
- int idx_number_2 = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 4;
+ char *tag, *distance, *vrf;
-DEFUN (ip_route_mask_distance_vrf,
- ip_route_mask_distance_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> (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"
- "Null interface\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
+
+ return zebra_static_ipv4 (vty, SAFI_UNICAST, 1,
+ argv[idx_ipv4_prefixlen]->arg,
+ NULL,
+ NULL,
+ argv[idx_reject_blackhole]->arg,
+ tag, distance, vrf);
}
-DEFUN (ip_route_mask_tag_distance_vrf,
- ip_route_mask_tag_distance_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> tag (1-65535) (1-255) vrf NAME",
+/* Mask as A.B.C.D format. */
+DEFUN (ip_route_mask,
+ ip_route_mask_cmd,
+ "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> [tag (1-65535)] [(1-255)] [vrf NAME]",
IP_STR
"Establish static routes\n"
"IP destination prefix\n"
@@ -1704,146 +477,88 @@ DEFUN (ip_route_mask_tag_distance_vrf,
int idx_ipv4 = 2;
int idx_ipv4_2 = 3;
int idx_ipv4_ifname_null = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- int idx_name = 9;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
+ 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);
+
+ return zebra_static_ipv4 (vty, SAFI_UNICAST, 1,
+ argv[idx_ipv4]->arg,
+ argv[idx_ipv4_2]->arg,
+ argv[idx_ipv4_ifname_null]->arg,
+ NULL, tag, distance, vrf);
}
-DEFUN (ip_route_mask_flags_tag_distance_vrf,
- ip_route_mask_flags_tag_distance_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
+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-65535)] [(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"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
{
int idx_ipv4 = 2;
int idx_ipv4_2 = 3;
int idx_ipv4_ifname = 4;
int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- int idx_name = 10;
- 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, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ 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);
-DEFUN (ip_route_mask_flags_distance_vrf,
- ip_route_mask_flags_distance_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> (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"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- int idx_name = 8;
- 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, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ 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);
}
-DEFUN (ip_route_mask_flags_distance2_vrf,
- ip_route_mask_flags_distance2_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <reject|blackhole> (1-255) vrf NAME",
+
+DEFUN (ip_route_mask_flags2,
+ ip_route_mask_flags2_cmd,
+ "ip route A.B.C.D A.B.C.D <reject|blackhole> [tag (1-65535)] [(1-255)] [vrf NAME]",
IP_STR
"Establish static routes\n"
"IP destination prefix\n"
"IP destination prefix mask\n"
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 2;
- int idx_ipv4_2 = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
-
-DEFUN (ip_route_mask_flags_tag_distance2_vrf,
- ip_route_mask_flags_tag_distance2_vrf_cmd,
- "ip route A.B.C.D A.B.C.D <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
"Set tag for this route\n"
"Tag value\n"
"Distance value for this route\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
{
int idx_ipv4 = 2;
int idx_ipv4_2 = 3;
int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- int idx_name = 9;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 1, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 5;
+ char *tag, *distance, *vrf;
-DEFUN (no_ip_route_vrf,
- no_ip_route_vrf_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> 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"
- "Null interface\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_name = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, NULL, NULL, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (no_ip_route_flags_vrf,
- no_ip_route_flags_vrf_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
+ return zebra_static_ipv4 (vty, SAFI_UNICAST, 1,
+ argv[idx_ipv4]->arg,
+ argv[idx_ipv4_2]->arg,
+ NULL,
+ argv[idx_reject_blackhole]->arg,
+ tag, distance, vrf);
}
-DEFUN (no_ip_route_tag_vrf,
- no_ip_route_tag_vrf_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> tag (1-65535) vrf NAME",
+DEFUN (no_ip_route,
+ no_ip_route_cmd,
+ "no ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> [tag (1-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
@@ -1853,58 +568,28 @@ DEFUN (no_ip_route_tag_vrf,
"Null interface\n"
"Tag of this route\n"
"Tag value\n"
+ "Distance value for this route\n"
VRF_CMD_HELP_STR)
{
int idx_ipv4_prefixlen = 3;
int idx_ipv4_ifname_null = 4;
- int idx_number = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
+ int idx_curr = 5;
+ char *tag, *distance, *vrf;
-DEFUN (no_ip_route_flags_tag_vrf,
- no_ip_route_flags_tag_vrf_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_name = 9;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (no_ip_route_flags2_vrf,
- no_ip_route_flags2_vrf_cmd,
- "no ip route A.B.C.D/M <reject|blackhole> vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 3;
- int idx_reject_blackhole = 4;
- int idx_name = 6;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
+ return zebra_static_ipv4 (vty, SAFI_UNICAST, 0,
+ argv[idx_ipv4_prefixlen]->arg,
+ NULL,
+ argv[idx_ipv4_ifname_null]->arg,
+ NULL,
+ tag, distance, vrf);
}
-DEFUN (no_ip_route_flags2_tag_vrf,
- no_ip_route_flags2_tag_vrf_cmd,
- "no ip route A.B.C.D/M <reject|blackhole> tag (1-65535) vrf NAME",
+DEFUN (no_ip_route_flags2,
+ no_ip_route_flags2_cmd,
+ "no ip route A.B.C.D/M <reject|blackhole> [tag (1-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
@@ -1913,60 +598,25 @@ DEFUN (no_ip_route_flags2_tag_vrf,
"Silently discard pkts when matched\n"
"Tag of this route\n"
"Tag value\n"
+ "Distance value for this route\n"
VRF_CMD_HELP_STR)
{
int idx_ipv4_prefixlen = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
+ int idx_curr = 5;
+ char *tag, *distance, *vrf;
-DEFUN (no_ip_route_mask_vrf,
- no_ip_route_mask_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> 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"
- "Null interface\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname_null = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, NULL, NULL, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (no_ip_route_mask_flags_vrf,
- no_ip_route_mask_flags_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname = 5;
- int idx_reject_blackhole = 6;
- int idx_name = 8;
- 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, NULL, NULL, argv[idx_name]->arg);
+ return zebra_static_ipv4 (vty, SAFI_UNICAST, 0,
+ argv[idx_ipv4_prefixlen]->arg,
+ NULL, NULL, NULL,
+ tag, distance, vrf);
}
-DEFUN (no_ip_route_mask_tag_vrf,
- no_ip_route_mask_tag_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> tag (1-65535) vrf NAME",
+DEFUN (no_ip_route_mask,
+ no_ip_route_mask_cmd,
+ "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> [tag (1-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
@@ -1977,63 +627,29 @@ DEFUN (no_ip_route_mask_tag_vrf,
"Null interface\n"
"Tag of this route\n"
"Tag value\n"
+ "Distance value for this route\n"
VRF_CMD_HELP_STR)
{
int idx_ipv4 = 3;
int idx_ipv4_2 = 4;
int idx_ipv4_ifname_null = 5;
- int idx_number = 7;
- int idx_name = 9;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
+ int idx_curr = 6;
+ char *tag, *distance, *vrf;
-DEFUN (no_ip_route_mask_flags_tag_vrf,
- no_ip_route_mask_flags_tag_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname = 5;
- int idx_reject_blackhole = 6;
- int idx_number = 8;
- int idx_name = 10;
- 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, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (no_ip_route_mask_flags2_vrf,
- no_ip_route_mask_flags2_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <reject|blackhole> vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_reject_blackhole = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
+ return zebra_static_ipv4 (vty, SAFI_UNICAST, 0,
+ argv[idx_ipv4]->arg,
+ argv[idx_ipv4_2]->arg,
+ argv[idx_ipv4_ifname_null]->arg,
+ NULL,
+ tag, distance, vrf);
}
-DEFUN (no_ip_route_mask_flags2_tag_vrf,
- no_ip_route_mask_flags2_tag_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <reject|blackhole> tag (1-65535) vrf NAME",
+DEFUN (no_ip_route_mask_flags2,
+ no_ip_route_mask_flags2_cmd,
+ "no ip route A.B.C.D A.B.C.D <reject|blackhole> [tag (1-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
@@ -2043,85 +659,27 @@ DEFUN (no_ip_route_mask_flags2_tag_vrf,
"Silently discard pkts when matched\n"
"Tag of this route\n"
"Tag value\n"
+ "Distance value for this route\n"
VRF_CMD_HELP_STR)
{
int idx_ipv4 = 3;
int idx_ipv4_2 = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_name = 9;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
+ 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);
-DEFUN (no_ip_route_distance_vrf,
- no_ip_route_distance_vrf_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> (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"
- "Null interface\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ return zebra_static_ipv4 (vty, SAFI_UNICAST, 0,
+ argv[idx_ipv4]->arg,
+ argv[idx_ipv4_2]->arg,
+ NULL, NULL,
+ tag, distance, vrf);
}
-DEFUN (no_ip_route_tag_distance_vrf,
- no_ip_route_tag_distance_vrf_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE|null0> tag (1-65535) (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"
- "Null interface\n"
- "Tag of this route\n"
- "Tag value\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname_null = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- int idx_name = 9;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
-
-DEFUN (no_ip_route_flags_distance_vrf,
- no_ip_route_flags_distance_vrf_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> (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"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 3;
- int idx_ipv4_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
-
-DEFUN (no_ip_route_flags_tag_distance_vrf,
- no_ip_route_flags_tag_distance_vrf_cmd,
- "no ip route A.B.C.D/M <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
+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-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
@@ -2138,127 +696,23 @@ DEFUN (no_ip_route_flags_tag_distance_vrf,
int idx_ipv4_prefixlen = 3;
int idx_ipv4_ifname = 4;
int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- int idx_name = 10;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, argv[idx_ipv4_ifname]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg,argv[idx_name]->arg);
-}
-
-DEFUN (no_ip_route_flags_distance2_vrf,
- no_ip_route_flags_distance2_vrf_cmd,
- "no ip route A.B.C.D/M <reject|blackhole> (1-255) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4_prefixlen = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 5;
- int idx_name = 7;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
-
-DEFUN (no_ip_route_flags_tag_distance2_vrf,
- no_ip_route_flags_tag_distance2_vrf_cmd,
- "no ip route A.B.C.D/M <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix (e.g. 10.0.0.0/8)\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)
-{
- int idx_ipv4_prefixlen = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- int idx_name = 9;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4_prefixlen]->arg, NULL, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg , argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 6;
+ char *tag, *distance, *vrf;
-DEFUN (no_ip_route_mask_distance_vrf,
- no_ip_route_mask_distance_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> (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"
- "Null interface\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname_null = 5;
- int idx_number = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
-
-DEFUN (no_ip_route_mask_tag_distance_vrf,
- no_ip_route_mask_tag_distance_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE|null0> tag (1-65535) (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"
- "Null interface\n"
- "Tag of this route\n"
- "Tag value\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname_null = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- int idx_name = 10;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, argv[idx_ipv4_ifname_null]->arg, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (no_ip_route_mask_flags_distance_vrf,
- no_ip_route_mask_flags_distance_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> (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"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_ipv4_ifname = 5;
- int idx_reject_blackhole = 6;
- int idx_number = 7;
- int idx_name = 9;
- 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, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ 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);
}
-DEFUN (no_ip_route_mask_flags_tag_distance_vrf,
- no_ip_route_mask_flags_tag_distance_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <A.B.C.D|INTERFACE> <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
+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-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
@@ -2277,57 +731,21 @@ DEFUN (no_ip_route_mask_flags_tag_distance_vrf,
int idx_ipv4_2 = 4;
int idx_ipv4_ifname = 5;
int idx_reject_blackhole = 6;
- int idx_number = 8;
- int idx_number_2 = 9;
- int idx_name = 11;
- 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, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 7;
+ char *tag, *distance, *vrf;
-DEFUN (no_ip_route_mask_flags_distance2_vrf,
- no_ip_route_mask_flags_distance2_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <reject|blackhole> (1-255) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this route\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- int idx_name = 8;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (no_ip_route_mask_flags_tag_distance2_vrf,
- no_ip_route_mask_flags_tag_distance2_vrf_cmd,
- "no ip route A.B.C.D A.B.C.D <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IP destination prefix\n"
- "IP destination prefix mask\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)
-{
- int idx_ipv4 = 3;
- int idx_ipv4_2 = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- int idx_name = 10;
- return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[idx_ipv4]->arg, argv[idx_ipv4_2]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
+ 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);
}
+
/* New RIB. Detailed information for IPv4 route. */
static void
vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
@@ -3988,7 +2406,6 @@ static_config_ipv4 (struct vty *vty, safi_t safi, const char *cmd)
return write;
}
-#ifdef HAVE_IPV6
/* General fucntion for IPv6 static route. */
static int
static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
@@ -4109,162 +2526,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
DEFUN (ipv6_route,
ipv6_route_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE>",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, NULL, NULL, NULL);
-}
-
-DEFUN (ipv6_route_tag,
- ipv6_route_tag_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> tag (1-65535)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_number = 5;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, argv[idx_number]->arg, NULL, NULL);
-}
-
-DEFUN (ipv6_route_flags,
- ipv6_route_flags_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole>",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_reject_blackhole = 4;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, NULL, NULL);
-}
-
-DEFUN (ipv6_route_flags_tag,
- ipv6_route_flags_tag_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> tag (1-65535)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, NULL);
-}
-
-DEFUN (ipv6_route_ifname,
- ipv6_route_ifname_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, NULL, NULL, NULL);
-}
-DEFUN (ipv6_route_ifname_tag,
- ipv6_route_ifname_tag_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag (1-65535)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_number = 6;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, argv[idx_number]->arg, NULL, NULL);
-}
-
-DEFUN (ipv6_route_ifname_flags,
- ipv6_route_ifname_flags_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole>",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_reject_blackhole = 5;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, NULL, NULL, NULL);
-}
-
-DEFUN (ipv6_route_ifname_flags_tag,
- ipv6_route_ifname_flags_tag_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> tag (1-65535)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, NULL);
-}
-
-DEFUN (ipv6_route_pref,
- ipv6_route_pref_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> (1-255)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_number = 4;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, NULL, argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ipv6_route_pref_tag,
- ipv6_route_pref_tag_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> tag (1-65535) (1-255)",
+ "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> [tag (1-65535)] [(1-255)] [vrf NAME]",
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4272,565 +2534,28 @@ DEFUN (ipv6_route_pref_tag,
"IPv6 gateway interface name\n"
"Set tag for this route\n"
"Tag value\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_number = 5;
- int idx_number_2 = 6;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (ipv6_route_flags_pref,
- ipv6_route_flags_pref_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> (1-255)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 5;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ipv6_route_flags_pref_tag,
- ipv6_route_flags_pref_tag_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> tag (1-65535) (1-255)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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 prefix\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (ipv6_route_ifname_pref,
- ipv6_route_ifname_pref_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (1-255)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_number = 5;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, NULL, argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ipv6_route_ifname_pref_tag,
- ipv6_route_ifname_pref_tag_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag (1-65535) (1-255)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (ipv6_route_ifname_flags_pref,
- ipv6_route_ifname_flags_pref_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> (1-255)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, NULL);
-}
-
-DEFUN (ipv6_route_ifname_flags_pref_tag,
- ipv6_route_ifname_flags_pref_tag_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> tag (1-65535) (1-255)",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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 prefix\n")
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (no_ipv6_route,
- no_ipv6_route_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE>",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, NULL, NULL, NULL);
-}
-
-DEFUN (no_ipv6_route_tag,
- no_ipv6_route_tag_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> tag (1-65535)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_number = 6;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, argv[idx_number]->arg, NULL, NULL);
-}
-
-DEFUN (no_ipv6_route_flags,
- no_ipv6_route_flags_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole>",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_reject_blackhole = 5;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, NULL, NULL);
-}
-
-DEFUN (no_ipv6_route_flags_tag,
- no_ipv6_route_flags_tag_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> tag (1-65535)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, NULL);
-}
-
-DEFUN (no_ipv6_route_ifname,
- no_ipv6_route_ifname_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, NULL, NULL, NULL);
-}
-
-DEFUN (no_ipv6_route_ifname_tag,
- no_ipv6_route_ifname_tag_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag (1-65535)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_number = 7;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, argv[idx_number]->arg, NULL, NULL);
-}
-
-DEFUN (no_ipv6_route_ifname_flags,
- no_ipv6_route_ifname_flags_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole>",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_reject_blackhole = 6;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, NULL, NULL, NULL);
-}
-
-DEFUN (no_ipv6_route_ifname_flags_tag,
- no_ipv6_route_ifname_flags_tag_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> tag (1-65535)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_reject_blackhole = 6;
- int idx_number = 8;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, NULL);
-}
-
-DEFUN (no_ipv6_route_pref,
- no_ipv6_route_pref_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_number = 5;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, NULL, argv[idx_number]->arg, NULL);
-}
-
-DEFUN (no_ipv6_route_pref_tag,
- no_ipv6_route_pref_tag_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> tag (1-65535) (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (no_ipv6_route_flags_pref,
- no_ipv6_route_flags_pref_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- /* We do not care about argv[idx_reject_blackhole]->arg */
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, NULL);
-}
-
-DEFUN (no_ipv6_route_flags_pref_tag,
- no_ipv6_route_flags_pref_tag_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> tag (1-65535) (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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 prefix\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- /* We do not care about argv[idx_reject_blackhole]->arg */
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (no_ipv6_route_ifname_pref,
- no_ipv6_route_ifname_pref_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_number = 6;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, NULL, argv[idx_number]->arg, NULL);
-}
-
-DEFUN (no_ipv6_route_ifname_pref_tag,
- no_ipv6_route_ifname_pref_tag_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag (1-65535) (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (no_ipv6_route_ifname_flags_pref,
- no_ipv6_route_ifname_flags_pref_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this prefix\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_reject_blackhole = 6;
- int idx_number = 7;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, NULL);
-}
-
-DEFUN (no_ipv6_route_ifname_flags_pref_tag,
- no_ipv6_route_ifname_flags_pref_tag_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> tag (1-65535) (1-255)",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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 prefix\n")
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_reject_blackhole = 6;
- int idx_number = 8;
- int idx_number_2 = 9;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, NULL);
-}
-
-DEFUN (ipv6_route_vrf,
- ipv6_route_vrf_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
+ "Distance value for this prefix\n"
VRF_CMD_HELP_STR)
{
int idx_ipv6_prefixlen = 2;
int idx_ipv6_ifname = 3;
- int idx_name = 5;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, NULL, NULL, argv[idx_name]->arg);
-}
+ int idx_curr = 4;
+ char *tag, *distance, *vrf;
-DEFUN (ipv6_route_tag_vrf,
- ipv6_route_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> tag (1-65535) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_number = 5;
- int idx_name = 7;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (ipv6_route_flags_vrf,
- ipv6_route_flags_vrf_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_name = 6;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ipv6_route_flags_tag_vrf,
- ipv6_route_flags_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> tag (1-65535) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_name = 8;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
+ return static_ipv6_func (vty, 1,
+ argv[idx_ipv6_prefixlen]->arg,
+ argv[idx_ipv6_ifname]->arg,
+ NULL, NULL,
+ tag, distance, vrf);
}
-DEFUN (ipv6_route_ifname_vrf,
- ipv6_route_ifname_vrf_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_name = 6;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, NULL, NULL, argv[idx_name]->arg);
-}
-DEFUN (ipv6_route_ifname_tag_vrf,
- ipv6_route_ifname_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag (1-65535) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_number = 6;
- int idx_name = 8;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-DEFUN (ipv6_route_ifname_flags_vrf,
- ipv6_route_ifname_flags_vrf_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> vrf NAME",
+DEFUN (ipv6_route_flags,
+ ipv6_route_flags_cmd,
+ "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> [tag (1-65535)] [(1-255)] [vrf NAME]",
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4838,145 +2563,32 @@ DEFUN (ipv6_route_ifname_flags_vrf,
"IPv6 gateway interface name\n"
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_reject_blackhole = 5;
- int idx_name = 7;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ipv6_route_ifname_flags_tag_vrf,
- ipv6_route_ifname_flags_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> tag (1-65535) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_name = 9;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (ipv6_route_pref_vrf,
- ipv6_route_pref_vrf_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> (1-255) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Distance value for this prefix\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_number = 4;
- int idx_name = 6;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
-
-DEFUN (ipv6_route_pref_tag_vrf,
- ipv6_route_pref_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> tag (1-65535) (1-255) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this prefix\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_number = 5;
- int idx_number_2 = 6;
- int idx_name = 8;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
-
-DEFUN (ipv6_route_flags_pref_vrf,
- ipv6_route_flags_pref_vrf_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> (1-255) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
"Distance value for this prefix\n"
VRF_CMD_HELP_STR)
{
int idx_ipv6_prefixlen = 2;
int idx_ipv6_ifname = 3;
int idx_reject_blackhole = 4;
- int idx_number = 5;
- int idx_name = 7;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 5;
+ char *tag, *distance, *vrf;
-DEFUN (ipv6_route_flags_pref_tag_vrf,
- ipv6_route_flags_pref_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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 prefix\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6_ifname = 3;
- int idx_reject_blackhole = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- int idx_name = 9;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (ipv6_route_ifname_pref_vrf,
- ipv6_route_ifname_pref_vrf_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE (1-255) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Distance value for this prefix\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_number = 5;
- int idx_name = 7;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ return static_ipv6_func (vty, 1,
+ argv[idx_ipv6_prefixlen]->arg,
+ argv[idx_ipv6_ifname]->arg,
+ NULL,
+ argv[idx_reject_blackhole]->arg,
+ tag, distance, vrf);
}
-DEFUN (ipv6_route_ifname_pref_tag_vrf,
- ipv6_route_ifname_pref_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag (1-65535) (1-255) vrf NAME",
+DEFUN (ipv6_route_ifname,
+ ipv6_route_ifname_cmd,
+ "ipv6 route X:X::X:X/M X:X::X:X INTERFACE [tag (1-65535)] [(1-255)] [vrf NAME]",
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -4990,37 +2602,23 @@ DEFUN (ipv6_route_ifname_pref_tag_vrf,
int idx_ipv6_prefixlen = 2;
int idx_ipv6 = 3;
int idx_interface = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- int idx_name = 9;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 5;
+ char *tag, *distance, *vrf;
-DEFUN (ipv6_route_ifname_flags_pref_vrf,
- ipv6_route_ifname_flags_pref_vrf_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> (1-255) vrf NAME",
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this prefix\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 2;
- int idx_ipv6 = 3;
- int idx_interface = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- int idx_name = 8;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
+
+ return static_ipv6_func (vty, 1,
+ argv[idx_ipv6_prefixlen]->arg,
+ argv[idx_ipv6]->arg,
+ argv[idx_interface]->arg,
+ NULL,
+ tag, distance, vrf);
}
-DEFUN (ipv6_route_ifname_flags_pref_tag_vrf,
- ipv6_route_ifname_flags_pref_tag_vrf_cmd,
- "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
+DEFUN (ipv6_route_ifname_flags,
+ ipv6_route_ifname_flags_cmd,
+ "ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> [tag (1-65535)] [(1-255)] [vrf NAME]",
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
@@ -5037,243 +2635,52 @@ DEFUN (ipv6_route_ifname_flags_pref_tag_vrf,
int idx_ipv6 = 3;
int idx_interface = 4;
int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- int idx_name = 10;
- return static_ipv6_func (vty, 1, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 6;
+ char *tag, *distance, *vrf;
-DEFUN (no_ipv6_route_vrf,
- no_ipv6_route_vrf_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_name = 6;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, NULL, NULL, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (no_ipv6_route_tag_vrf,
- no_ipv6_route_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> tag (1-65535) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_number = 6;
- int idx_name = 8;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
+ return static_ipv6_func (vty, 1,
+ argv[idx_ipv6_prefixlen]->arg,
+ argv[idx_ipv6]->arg,
+ argv[idx_interface]->arg,
+ argv[idx_reject_blackhole]->arg,
+ tag, distance, vrf);
}
-DEFUN (no_ipv6_route_flags_vrf,
- no_ipv6_route_flags_vrf_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_name = 7;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (no_ipv6_route_flags_tag_vrf,
- no_ipv6_route_flags_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> tag (1-65535) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_name = 9;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (no_ipv6_route_ifname_vrf,
- no_ipv6_route_ifname_vrf_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_name = 7;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (no_ipv6_route_ifname_tag_vrf,
- no_ipv6_route_ifname_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag (1-65535) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_number = 7;
- int idx_name = 9;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (no_ipv6_route_ifname_flags_vrf,
- no_ipv6_route_ifname_flags_vrf_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_reject_blackhole = 6;
- int idx_name = 8;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, NULL, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (no_ipv6_route_ifname_flags_tag_vrf,
- no_ipv6_route_ifname_flags_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> tag (1-65535) vrf NAME",
+DEFUN (no_ipv6_route,
+ no_ipv6_route_cmd,
+ "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> [tag (1-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
"IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
"IPv6 gateway address\n"
"IPv6 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"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_reject_blackhole = 6;
- int idx_number = 8;
- int idx_name = 10;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, NULL, argv[idx_name]->arg);
-}
-
-DEFUN (no_ipv6_route_pref_vrf,
- no_ipv6_route_pref_vrf_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> (1-255) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
"Distance value for this prefix\n"
VRF_CMD_HELP_STR)
{
int idx_ipv6_prefixlen = 3;
int idx_ipv6_ifname = 4;
- int idx_number = 5;
- int idx_name = 7;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 5;
+ char *tag, *distance, *vrf;
-DEFUN (no_ipv6_route_pref_tag_vrf,
- no_ipv6_route_pref_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> tag (1-65535) (1-255) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Set tag for this route\n"
- "Tag value\n"
- "Distance value for this prefix\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_number = 6;
- int idx_number_2 = 7;
- int idx_name = 9;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
-DEFUN (no_ipv6_route_flags_pref_vrf,
- no_ipv6_route_flags_pref_vrf_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> (1-255) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this prefix\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6_ifname = 4;
- int idx_reject_blackhole = 5;
- int idx_number = 6;
- int idx_name = 8;
- /* We do not care about argv[idx_reject_blackhole]->arg */
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ return static_ipv6_func (vty, 0,
+ argv[idx_ipv6_prefixlen]->arg,
+ argv[idx_ipv6_ifname]->arg,
+ NULL, NULL,
+ tag, distance, vrf);
}
-DEFUN (no_ipv6_route_flags_pref_tag_vrf,
- no_ipv6_route_flags_pref_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
+DEFUN (no_ipv6_route_flags,
+ no_ipv6_route_flags_cmd,
+ "no ipv6 route X:X::X:X/M <X:X::X:X|INTERFACE> <reject|blackhole> [tag (1-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
@@ -5290,36 +2697,23 @@ DEFUN (no_ipv6_route_flags_pref_tag_vrf,
int idx_ipv6_prefixlen = 3;
int idx_ipv6_ifname = 4;
int idx_reject_blackhole = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- int idx_name = 10;
- /* We do not care about argv[idx_reject_blackhole]->arg */
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6_ifname]->arg, NULL, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 5;
+ char *tag, *distance, *vrf;
-DEFUN (no_ipv6_route_ifname_pref_vrf,
- no_ipv6_route_ifname_pref_vrf_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (1-255) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Distance value for this prefix\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_number = 6;
- int idx_name = 8;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
+
+ return static_ipv6_func (vty, 0,
+ argv[idx_ipv6_prefixlen]->arg,
+ argv[idx_ipv6_ifname]->arg,
+ NULL,
+ argv[idx_reject_blackhole]->arg,
+ tag, distance, vrf);
}
-DEFUN (no_ipv6_route_ifname_pref_tag_vrf,
- no_ipv6_route_ifname_pref_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE tag (1-65535) (1-255) vrf NAME",
+DEFUN (no_ipv6_route_ifname,
+ no_ipv6_route_ifname_cmd,
+ "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE [tag (1-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
@@ -5334,38 +2728,23 @@ DEFUN (no_ipv6_route_ifname_pref_tag_vrf,
int idx_ipv6_prefixlen = 3;
int idx_ipv6 = 4;
int idx_interface = 5;
- int idx_number = 7;
- int idx_number_2 = 8;
- int idx_name = 10;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, NULL, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
-}
+ int idx_curr = 6;
+ char *tag, *distance, *vrf;
-DEFUN (no_ipv6_route_ifname_flags_pref_vrf,
- no_ipv6_route_ifname_flags_pref_vrf_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> (1-255) vrf NAME",
- NO_STR
- IP_STR
- "Establish static routes\n"
- "IPv6 destination prefix (e.g. 3ffe:506::/32)\n"
- "IPv6 gateway address\n"
- "IPv6 gateway interface name\n"
- "Emit an ICMP unreachable when matched\n"
- "Silently discard pkts when matched\n"
- "Distance value for this prefix\n"
- VRF_CMD_HELP_STR)
-{
- int idx_ipv6_prefixlen = 3;
- int idx_ipv6 = 4;
- int idx_interface = 5;
- int idx_reject_blackhole = 6;
- int idx_number = 7;
- int idx_name = 9;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, NULL, argv[idx_number]->arg, argv[idx_name]->arg);
+ tag = distance = vrf = NULL;
+ zebra_vty_ip_route_tdv_helper (argc, argv, idx_curr, &tag, &distance, &vrf);
+
+ return static_ipv6_func (vty, 0,
+ argv[idx_ipv6_prefixlen]->arg,
+ argv[idx_ipv6]->arg,
+ argv[idx_interface]->arg,
+ NULL,
+ tag, distance, vrf);
}
-DEFUN (no_ipv6_route_ifname_flags_pref_tag_vrf,
- no_ipv6_route_ifname_flags_pref_tag_vrf_cmd,
- "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> tag (1-65535) (1-255) vrf NAME",
+DEFUN (no_ipv6_route_ifname_flags,
+ no_ipv6_route_ifname_flags_cmd,
+ "no ipv6 route X:X::X:X/M X:X::X:X INTERFACE <reject|blackhole> [tag (1-65535)] [(1-255)] [vrf NAME]",
NO_STR
IP_STR
"Establish static routes\n"
@@ -5383,15 +2762,23 @@ DEFUN (no_ipv6_route_ifname_flags_pref_tag_vrf,
int idx_ipv6 = 4;
int idx_interface = 5;
int idx_reject_blackhole = 6;
- int idx_number = 8;
- int idx_number_2 = 9;
- int idx_name = 11;
- return static_ipv6_func (vty, 0, argv[idx_ipv6_prefixlen]->arg, argv[idx_ipv6]->arg, argv[idx_interface]->arg, argv[idx_reject_blackhole]->arg, argv[idx_number]->arg, argv[idx_number_2]->arg, argv[idx_name]->arg);
+ 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);
+
+ return static_ipv6_func (vty, 0,
+ argv[idx_ipv6_prefixlen]->arg,
+ argv[idx_ipv6]->arg,
+ argv[idx_interface]->arg,
+ argv[idx_reject_blackhole]->arg,
+ tag, distance, vrf);
}
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 route vrf NAME [json]",
+ * "show ipv6 route " VRF_CMD_STR " [json]",
* SHOW_STR
* IP_STR
* "IPv6 routing table\n"
@@ -5597,7 +2984,7 @@ DEFUN (show_ipv6_route_prefix_longer,
/*
* CHECK ME - The following ALIASes need to be implemented in this DEFUN
- * "show ipv6 route vrf NAME <kernel|connected|static|ripng|ospf6|isis|bgp|table>",
+ * "show ipv6 route " VRF_CMD_STR " " QUAGGA_IP6_REDIST_STR_ZEBRA,
* SHOW_STR
* IP_STR
* "IP routing table\n"
@@ -5607,11 +2994,11 @@ DEFUN (show_ipv6_route_prefix_longer,
*/
DEFUN (show_ipv6_route_protocol,
show_ipv6_route_protocol_cmd,
- "show ipv6 route <kernel|connected|static|ripng|ospf6|isis|bgp|table>",
+ "show ipv6 route <kernel|connected|static|ripng|ospf6|isis|bgp|table>",
SHOW_STR
IP_STR
"IP routing table\n"
- QUAGGA_IP6_REDIST_HELP_STR_ZEBRA)
+ QUAGGA_IP6_REDIST_HELP_STR_ZEBRA)
{
int idx_protocol = 3;
int type;
@@ -6282,7 +3669,6 @@ static_config_ipv6 (struct vty *vty)
}
return write;
}
-#endif /* HAVE_IPV6 */
DEFUN (allow_external_route_update,
allow_external_route_update_cmd,
@@ -6339,9 +3725,7 @@ zebra_ip_config (struct vty *vty)
write += static_config_ipv4 (vty, SAFI_UNICAST, "ip route");
write += static_config_ipv4 (vty, SAFI_MULTICAST, "ip mroute");
-#ifdef HAVE_IPV6
write += static_config_ipv6 (vty);
-#endif /* HAVE_IPV6 */
write += zebra_import_table_config (vty);
return write;
@@ -6540,49 +3924,15 @@ zebra_vty_init (void)
install_element (CONFIG_NODE, &ip_multicast_mode_cmd);
install_element (CONFIG_NODE, &no_ip_multicast_mode_cmd);
install_element (CONFIG_NODE, &ip_route_cmd);
- install_element (CONFIG_NODE, &ip_route_tag_cmd);
install_element (CONFIG_NODE, &ip_route_flags_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_tag_cmd);
install_element (CONFIG_NODE, &ip_route_flags2_cmd);
- install_element (CONFIG_NODE, &ip_route_flags2_tag_cmd);
install_element (CONFIG_NODE, &ip_route_mask_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_tag_cmd);
install_element (CONFIG_NODE, &ip_route_mask_flags_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_tag_cmd);
install_element (CONFIG_NODE, &ip_route_mask_flags2_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags2_tag_cmd);
install_element (CONFIG_NODE, &no_ip_route_cmd);
- install_element (CONFIG_NODE, &no_ip_route_tag_cmd);
install_element (CONFIG_NODE, &no_ip_route_flags2_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags2_tag_cmd);
install_element (CONFIG_NODE, &no_ip_route_mask_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_tag_cmd);
install_element (CONFIG_NODE, &no_ip_route_mask_flags2_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags2_tag_cmd);
- install_element (CONFIG_NODE, &ip_route_distance_cmd);
- install_element (CONFIG_NODE, &ip_route_tag_distance_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_distance_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_tag_distance_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_distance2_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_tag_distance2_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_distance_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_tag_distance_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_distance_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_distance2_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance2_cmd);
- install_element (CONFIG_NODE, &no_ip_route_distance_cmd);
- install_element (CONFIG_NODE, &no_ip_route_tag_distance_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_distance_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_distance2_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance2_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_distance_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_tag_distance_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance2_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance2_cmd);
install_element (CONFIG_NODE, &ip_zebra_import_table_distance_cmd);
install_element (CONFIG_NODE, &ip_zebra_import_table_distance_routemap_cmd);
install_element (CONFIG_NODE, &no_ip_zebra_import_table_cmd);
@@ -6625,54 +3975,8 @@ zebra_vty_init (void)
/* Commands for VRF */
- install_element (CONFIG_NODE, &ip_route_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_flags2_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_flags2_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags2_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags2_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags2_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags2_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags2_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags2_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_distance_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_tag_distance_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_distance_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_tag_distance_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_distance2_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_flags_tag_distance2_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_distance_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_tag_distance_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_distance_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_distance2_vrf_cmd);
- install_element (CONFIG_NODE, &ip_route_mask_flags_tag_distance2_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_distance_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_tag_distance_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_distance_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_distance2_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_flags_tag_distance2_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_distance_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_tag_distance_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_distance2_vrf_cmd);
- install_element (CONFIG_NODE, &no_ip_route_mask_flags_tag_distance2_vrf_cmd);
+ install_element (CONFIG_NODE, &no_ip_route_flags_cmd);
+ install_element (CONFIG_NODE, &no_ip_route_mask_flags_cmd);
install_element (VIEW_NODE, &show_ip_route_vrf_cmd);
install_element (ENABLE_NODE, &show_ip_route_vrf_cmd);
@@ -6696,7 +4000,6 @@ zebra_vty_init (void)
install_element (ENABLE_NODE, &show_ip_route_vrf_all_summary_cmd);
install_element (ENABLE_NODE, &show_ip_route_vrf_all_summary_prefix_cmd);
-#ifdef HAVE_IPV6
install_element (CONFIG_NODE, &ipv6_route_cmd);
install_element (CONFIG_NODE, &ipv6_route_flags_cmd);
install_element (CONFIG_NODE, &ipv6_route_ifname_cmd);
@@ -6705,30 +4008,6 @@ zebra_vty_init (void)
install_element (CONFIG_NODE, &no_ipv6_route_flags_cmd);
install_element (CONFIG_NODE, &no_ipv6_route_ifname_cmd);
install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_cmd);
- install_element (CONFIG_NODE, &ipv6_route_pref_cmd);
- install_element (CONFIG_NODE, &ipv6_route_flags_pref_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_pref_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_pref_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_cmd);
- install_element (CONFIG_NODE, &ipv6_route_tag_cmd);
- install_element (CONFIG_NODE, &ipv6_route_flags_tag_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_tag_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_flags_tag_cmd);
- install_element (CONFIG_NODE, &ipv6_route_pref_tag_cmd);
- install_element (CONFIG_NODE, &ipv6_route_flags_pref_tag_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_pref_tag_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_tag_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_tag_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_flags_tag_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_tag_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_tag_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_pref_tag_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_tag_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_tag_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_tag_cmd);
install_element (CONFIG_NODE, &ip_nht_default_route_cmd);
install_element (CONFIG_NODE, &no_ip_nht_default_route_cmd);
install_element (CONFIG_NODE, &ipv6_nht_default_route_cmd);
@@ -6754,42 +4033,6 @@ zebra_vty_init (void)
install_element (ENABLE_NODE, &show_ipv6_mroute_cmd);
/* Commands for VRF */
-
- install_element (CONFIG_NODE, &ipv6_route_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_flags_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_flags_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_flags_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_pref_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_flags_pref_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_pref_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_pref_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_flags_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_flags_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_pref_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_flags_pref_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_pref_tag_vrf_cmd);
- install_element (CONFIG_NODE, &ipv6_route_ifname_flags_pref_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_flags_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_pref_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_flags_pref_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_pref_tag_vrf_cmd);
- install_element (CONFIG_NODE, &no_ipv6_route_ifname_flags_pref_tag_vrf_cmd);
-
-
-
install_element (VIEW_NODE, &show_ipv6_route_vrf_all_cmd);
install_element (VIEW_NODE, &show_ipv6_route_vrf_all_tag_cmd);
install_element (VIEW_NODE, &show_ipv6_route_vrf_all_summary_cmd);
@@ -6807,8 +4050,6 @@ zebra_vty_init (void)
install_element (ENABLE_NODE, &show_ipv6_route_vrf_all_summary_cmd);
install_element (ENABLE_NODE, &show_ipv6_route_vrf_all_summary_prefix_cmd);
-
install_element (VIEW_NODE, &show_ipv6_mroute_vrf_all_cmd);
install_element (ENABLE_NODE, &show_ipv6_mroute_vrf_all_cmd);
-#endif /* HAVE_IPV6 */
}