From: Quentin Young Date: Fri, 21 Oct 2016 19:49:16 +0000 (+0000) Subject: Merge branch 'cmaster-next' into vtysh-grammar X-Git-Tag: frr-3.0-branchpoint~129^2~68 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=fd8503f557b27c44abee4e7d0c3256d44d82be4c;p=mirror%2Ffrr.git Merge branch 'cmaster-next' into vtysh-grammar Signed-off-by: Quentin Young Conflicts: bgpd/bgp_vty.c --- fd8503f557b27c44abee4e7d0c3256d44d82be4c diff --cc bgpd/bgp_vty.c index b22dcfac1e,7884d2d503..9589cde841 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@@ -5484,59 -5785,125 +5484,67 @@@ DEFUN (no_neighbor_maximum_prefix 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 allowas-in [(1-10)]", ++ "neighbor 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_peer = 1; - int idx_number = 3; ++ 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 allowas-in [(1-10)]", - NO_NEIGHBOR_CMD2 "allowas-in", ++ "no neighbor 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; @@@ -5549,10 -5916,19 +5557,9 @@@ 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 ttl-security hops (1-254)", NEIGHBOR_STR NEIGHBOR_ADDR_STR2 "Specify the maximum number of hops to the BGP peer\n")