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")
{
- return peer_maximum_prefix_unset_vty (vty, argv[0], bgp_node_afi (vty),
+ int idx_peer = 2;
+ return peer_maximum_prefix_unset_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty),
bgp_node_safi (vty));
}
-
-ALIAS (no_neighbor_maximum_prefix,
- no_neighbor_maximum_prefix_val_cmd,
- NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295>",
- NO_STR
+
+
+/* "neighbor allowas-in" */
+DEFUN (neighbor_allowas_in,
+ neighbor_allowas_in_cmd,
- "neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in [(1-10)]",
++ "neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in [<(1-10)|origin>]",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "Maximum number of prefix accept from this peer\n"
- "maximum no. of prefix limit\n")
-
-ALIAS (no_neighbor_maximum_prefix,
- no_neighbor_maximum_prefix_threshold_cmd,
- NO_NEIGHBOR_CMD2 "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")
-
-ALIAS (no_neighbor_maximum_prefix,
- no_neighbor_maximum_prefix_warning_cmd,
- NO_NEIGHBOR_CMD2 "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")
-
-ALIAS (no_neighbor_maximum_prefix,
- no_neighbor_maximum_prefix_threshold_warning_cmd,
- NO_NEIGHBOR_CMD2 "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")
-
-ALIAS (no_neighbor_maximum_prefix,
- no_neighbor_maximum_prefix_restart_cmd,
- NO_NEIGHBOR_CMD2 "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")
-
-ALIAS (no_neighbor_maximum_prefix,
- no_neighbor_maximum_prefix_threshold_restart_cmd,
- NO_NEIGHBOR_CMD2 "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")
-
-/* "neighbor allowas-in" */
-DEFUN (neighbor_allowas_in,
- neighbor_allowas_in_cmd,
- NEIGHBOR_CMD2 "allowas-in",
- 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")
++ "Number of occurances of AS number\n"
++ "Only accept my AS in the as-path if the route was originated in my AS\n")
{
- int idx_number = 3;
+ int idx_peer = 1;
++ int idx_number_origin = 3;
int ret;
+ int origin = 0;
struct peer *peer;
- unsigned int allow_num;
+ int allow_num = 0;
- peer = peer_and_group_lookup_vty (vty, argv[0]);
+ peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg);
if (! peer)
return CMD_WARNING;
- if (argc <= idx_number)
- if (argc == 1)
++ if (argc <= idx_number_origin)
allow_num = 3;
else
- VTY_GET_INTEGER_RANGE ("AS number", allow_num, argv[idx_number]->arg, 1, 10);
+ {
- if (strncmp (argv[1], "o", 1) == 0)
++ if (argv[idx_number_origin]->type == WORD_TKN)
+ origin = 1;
+ else
- VTY_GET_INTEGER_RANGE ("AS number", allow_num, argv[1], 1, 10);
++ allow_num = atoi (argv[idx_number_origin]->arg);
+ }
ret = peer_allowas_in_set (peer, bgp_node_afi (vty), bgp_node_safi (vty),
- allow_num);
+ allow_num, origin);
return bgp_vty_return (vty, ret);
}
-ALIAS (neighbor_allowas_in,
- neighbor_allowas_in_arg_cmd,
- NEIGHBOR_CMD2 "allowas-in (<1-10>|origin)",
- NEIGHBOR_STR
- NEIGHBOR_ADDR_STR2
- "Accept as-path with my AS present in it\n"
- "Number of occurances of AS number\n"
- "Only accept my AS in the as-path if the route was originated in my AS\n")
-
DEFUN (no_neighbor_allowas_in,
no_neighbor_allowas_in_cmd,
- "no neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in [(1-10)]",
- NO_NEIGHBOR_CMD2 "allowas-in",
++ "no neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in [<(1-10)|origin>]",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "allow local ASN appears in aspath attribute\n")
+ "allow local ASN appears in aspath attribute\n"
- "Number of occurances of AS number\n")
++ "Number of occurances of AS number\n"
++ "Only accept my AS in the as-path if the route was originated in my AS\n")
{
+ int idx_peer = 2;
int ret;
struct peer *peer;
return bgp_vty_return (vty, ret);
}
-ALIAS (no_neighbor_allowas_in,
- no_neighbor_allowas_in_val_cmd,
- NO_NEIGHBOR_CMD2 "allowas-in (<1-10>|origin)",
- NO_STR
- NEIGHBOR_STR
- NEIGHBOR_ADDR_STR2
- "allow local ASN appears in aspath attribute\n"
- "Number of occurances of AS number\n"
- "Only accept my AS in the as-path if the route was originated in my AS\n")
--
DEFUN (neighbor_ttl_security,
neighbor_ttl_security_cmd,
- NEIGHBOR_CMD2 "ttl-security hops <1-254>",
+ "neighbor <A.B.C.D|X:X::X:X|WORD> ttl-security hops (1-254)",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Specify the maximum number of hops to the BGP peer\n")