Skip to content

Commit

Permalink
*: cleanup number-named access-lists in CLI
Browse files Browse the repository at this point in the history
There's no more difference between number-named and word-named access-lists.
This commit removes separate arguments for number-named ACLs from CLI.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
  • Loading branch information
idryzhov committed Oct 8, 2021
1 parent d0bf22a commit 7e86999
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 90 deletions.
12 changes: 4 additions & 8 deletions bgpd/bgp_routemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4576,13 +4576,11 @@ DEFUN_YANG (no_match_probability,

DEFPY_YANG (match_ip_route_source,
match_ip_route_source_cmd,
"match ip route-source <(1-199)|(1300-2699)|WORD>",
"match ip route-source WORD",
MATCH_STR
IP_STR
"Match advertising source address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP standard access-list name\n")
"IP Access-list name\n")
{
const char *xpath =
"./match-condition[condition='frr-bgp-route-map:ip-route-source']";
Expand All @@ -4602,14 +4600,12 @@ DEFPY_YANG (match_ip_route_source,

DEFUN_YANG (no_match_ip_route_source,
no_match_ip_route_source_cmd,
"no match ip route-source [<(1-199)|(1300-2699)|WORD>]",
"no match ip route-source [WORD]",
NO_STR
MATCH_STR
IP_STR
"Match advertising source address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP standard access-list name\n")
"IP Access-list name\n")
{
const char *xpath =
"./match-condition[condition='frr-bgp-route-map:ip-route-source']";
Expand Down
16 changes: 4 additions & 12 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -7018,12 +7018,10 @@ DEFUN (no_neighbor_interface,

DEFUN (neighbor_distribute_list,
neighbor_distribute_list_cmd,
"neighbor <A.B.C.D|X:X::X:X|WORD> distribute-list <(1-199)|(1300-2699)|WORD> <in|out>",
"neighbor <A.B.C.D|X:X::X:X|WORD> distribute-list WORD <in|out>",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Filter updates to/from this neighbor\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n"
"Filter incoming updates\n"
"Filter outgoing updates\n")
Expand Down Expand Up @@ -7051,24 +7049,20 @@ DEFUN (neighbor_distribute_list,

ALIAS_HIDDEN(
neighbor_distribute_list, neighbor_distribute_list_hidden_cmd,
"neighbor <A.B.C.D|X:X::X:X|WORD> distribute-list <(1-199)|(1300-2699)|WORD> <in|out>",
"neighbor <A.B.C.D|X:X::X:X|WORD> distribute-list WORD <in|out>",
NEIGHBOR_STR NEIGHBOR_ADDR_STR2
"Filter updates to/from this neighbor\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n"
"Filter incoming updates\n"
"Filter outgoing updates\n")

DEFUN (no_neighbor_distribute_list,
no_neighbor_distribute_list_cmd,
"no neighbor <A.B.C.D|X:X::X:X|WORD> distribute-list <(1-199)|(1300-2699)|WORD> <in|out>",
"no neighbor <A.B.C.D|X:X::X:X|WORD> distribute-list WORD <in|out>",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Filter updates to/from this neighbor\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n"
"Filter incoming updates\n"
"Filter outgoing updates\n")
Expand All @@ -7094,11 +7088,9 @@ DEFUN (no_neighbor_distribute_list,

ALIAS_HIDDEN(
no_neighbor_distribute_list, no_neighbor_distribute_list_hidden_cmd,
"no neighbor <A.B.C.D|X:X::X:X|WORD> distribute-list <(1-199)|(1300-2699)|WORD> <in|out>",
"no neighbor <A.B.C.D|X:X::X:X|WORD> distribute-list WORD <in|out>",
NO_STR NEIGHBOR_STR NEIGHBOR_ADDR_STR2
"Filter updates to/from this neighbor\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n"
"Filter incoming updates\n"
"Filter outgoing updates\n")
Expand Down
16 changes: 4 additions & 12 deletions eigrpd/eigrp_routemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,12 +858,10 @@ ALIAS(no_match_interface, no_match_interface_val_cmd, "no match interface WORD",

DEFUN (match_ip_next_hop,
match_ip_next_hop_cmd,
"match ip next-hop ((1-199)|(1300-2699)|WORD)",
"match ip next-hop WORD",
MATCH_STR
IP_STR
"Match next-hop address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
return eigrp_route_match_add(vty, vty->index, "ip next-hop", argv[0]);
Expand All @@ -886,10 +884,8 @@ DEFUN (no_match_ip_next_hop,
}

ALIAS(no_match_ip_next_hop, no_match_ip_next_hop_val_cmd,
"no match ip next-hop ((1-199)|(1300-2699)|WORD)", NO_STR MATCH_STR IP_STR
"no match ip next-hop WORD", NO_STR MATCH_STR IP_STR
"Match next-hop address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n")

DEFUN (match_ip_next_hop_prefix_list,
Expand Down Expand Up @@ -931,12 +927,10 @@ ALIAS(no_match_ip_next_hop_prefix_list,

DEFUN (match_ip_address,
match_ip_address_cmd,
"match ip address ((1-199)|(1300-2699)|WORD)",
"match ip address WORD",
MATCH_STR
IP_STR
"Match address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
return eigrp_route_match_add(vty, vty->index, "ip address", argv[0]);
Expand All @@ -958,10 +952,8 @@ DEFUN (no_match_ip_address,
}

ALIAS(no_match_ip_address, no_match_ip_address_val_cmd,
"no match ip address ((1-199)|(1300-2699)|WORD)", NO_STR MATCH_STR IP_STR
"no match ip address WORD", NO_STR MATCH_STR IP_STR
"Match address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n")

DEFUN (match_ip_address_prefix_list,
Expand Down
24 changes: 5 additions & 19 deletions ldpd/ldp_vty_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,12 @@ DEFPY (ldp_allow_broken_lsps,

DEFPY (ldp_discovery_targeted_hello_accept,
ldp_discovery_targeted_hello_accept_cmd,
"[no] discovery targeted-hello accept [from <(1-199)|(1300-2699)|WORD>$from_acl]",
"[no] discovery targeted-hello accept [from WORD$from_acl]",
NO_STR
"Configure discovery parameters\n"
"LDP Targeted Hellos\n"
"Accept and respond to targeted hellos\n"
"Access list to specify acceptable targeted hello source\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP access-list name\n")
{
return (ldp_vty_targeted_hello_accept(vty, no, from_acl));
Expand Down Expand Up @@ -290,69 +288,57 @@ DEFPY (ldp_discovery_transport_address_ipv6,

DEFPY (ldp_label_local_advertise,
ldp_label_local_advertise_cmd,
"[no] label local advertise [{to <(1-199)|(1300-2699)|WORD>$to_acl|for <(1-199)|(1300-2699)|WORD>$for_acl}]",
"[no] label local advertise [{to WORD$to_acl|for WORD$for_acl}]",
NO_STR
"Configure label control and policies\n"
"Configure local label control and policies\n"
"Configure outbound label advertisement control\n"
"IP Access-list specifying controls on LDP Peers\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP access-list name\n"
"IP access-list for destination prefixes\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP access-list name\n")
{
return (ldp_vty_label_advertise(vty, no, to_acl, for_acl));
}

DEFPY (ldp_label_local_advertise_explicit_null,
ldp_label_local_advertise_explicit_null_cmd,
"[no] label local advertise explicit-null [for <(1-199)|(1300-2699)|WORD>$for_acl]",
"[no] label local advertise explicit-null [for WORD$for_acl]",
NO_STR
"Configure label control and policies\n"
"Configure local label control and policies\n"
"Configure outbound label advertisement control\n"
"Configure explicit-null advertisement\n"
"IP access-list for destination prefixes\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP access-list name\n")
{
return (ldp_vty_label_expnull(vty, no, for_acl));
}

DEFPY (ldp_label_local_allocate,
ldp_label_local_allocate_cmd,
"[no] label local allocate <host-routes$host_routes|for <(1-199)|(1300-2699)|WORD>$for_acl>",
"[no] label local allocate <host-routes$host_routes|for WORD$for_acl>",
NO_STR
"Configure label control and policies\n"
"Configure local label control and policies\n"
"Configure label allocation control\n"
"allocate local label for host routes only\n"
"IP access-list\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP access-list name\n")
{
return (ldp_vty_label_allocate(vty, no, host_routes, for_acl));
}

DEFPY (ldp_label_remote_accept,
ldp_label_remote_accept_cmd,
"[no] label remote accept {from <(1-199)|(1300-2699)|WORD>$from_acl|for <(1-199)|(1300-2699)|WORD>$for_acl}",
"[no] label remote accept {from WORD$from_acl|for WORD$for_acl}",
NO_STR
"Configure label control and policies\n"
"Configure remote/peer label control and policies\n"
"Configure inbound label acceptance control\n"
"Neighbor from whom to accept label advertisement\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP access-list name\n"
"IP access-list for destination prefixes\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP access-list name\n")
{
return (ldp_vty_label_accept(vty, no, from_acl, for_acl));
Expand Down
10 changes: 3 additions & 7 deletions lib/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,15 +635,11 @@ DEFUN (show_ip_access_list,

DEFUN (show_ip_access_list_name,
show_ip_access_list_name_cmd,
"show ip access-list <(1-99)|(100-199)|(1300-1999)|(2000-2699)|WORD> [json]",
"show ip access-list WORD [json]",
SHOW_STR
IP_STR
"List IP access lists\n"
"IP standard access list\n"
"IP extended access list\n"
"IP standard access list (expanded range)\n"
"IP extended access list (expanded range)\n"
"IP zebra access-list\n"
"IP access-list name\n"
JSON_STR)
{
bool uj = use_json(argc, argv);
Expand All @@ -669,7 +665,7 @@ DEFUN (show_ipv6_access_list_name,
SHOW_STR
IPV6_STR
"List IPv6 access lists\n"
"IPv6 zebra access-list\n"
"IPv6 access-list name\n"
JSON_STR)
{
bool uj = use_json(argc, argv);
Expand Down
13 changes: 5 additions & 8 deletions lib/filter_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@
#endif /* VTYSH_EXTRACT_PL */

#define ACCESS_LIST_STR "Access list entry\n"
#define ACCESS_LIST_LEG_STR "IP standard access list\n"
#define ACCESS_LIST_ELEG_STR "IP extended access list\n"
#define ACCESS_LIST_ELEG_EXT_STR "IP extended access list (expanded range)\n"
#define ACCESS_LIST_ZEBRA_STR "Access list entry\n"
#define ACCESS_LIST_ZEBRA_STR "Access list name\n"
#define ACCESS_LIST_SEQ_STR \
"Sequence number of an entry\n" \
"Sequence number\n"
Expand Down Expand Up @@ -137,7 +134,7 @@ DEFPY_YANG(
access_list_std, access_list_std_cmd,
"access-list WORD$name [seq (1-4294967295)$seq] <deny|permit>$action <[host] A.B.C.D$host|A.B.C.D$host A.B.C.D$mask>",
ACCESS_LIST_STR
ACCESS_LIST_LEG_STR
ACCESS_LIST_ZEBRA_STR
ACCESS_LIST_SEQ_STR
ACCESS_LIST_ACTION_STR
"A single host address\n"
Expand Down Expand Up @@ -214,7 +211,7 @@ DEFPY_YANG(
"no access-list WORD$name [seq (1-4294967295)$seq] <deny|permit>$action <[host] A.B.C.D$host|A.B.C.D$host A.B.C.D$mask>",
NO_STR
ACCESS_LIST_STR
ACCESS_LIST_LEG_STR
ACCESS_LIST_ZEBRA_STR
ACCESS_LIST_SEQ_STR
ACCESS_LIST_ACTION_STR
"A single host address\n"
Expand Down Expand Up @@ -258,7 +255,7 @@ DEFPY_YANG(
access_list_ext, access_list_ext_cmd,
"access-list WORD$name [seq (1-4294967295)$seq] <deny|permit>$action ip <A.B.C.D$src A.B.C.D$src_mask|host A.B.C.D$src|any> <A.B.C.D$dst A.B.C.D$dst_mask|host A.B.C.D$dst|any>",
ACCESS_LIST_STR
ACCESS_LIST_ELEG_STR
ACCESS_LIST_ZEBRA_STR
ACCESS_LIST_SEQ_STR
ACCESS_LIST_ACTION_STR
"IPv4 address\n"
Expand Down Expand Up @@ -377,7 +374,7 @@ DEFPY_YANG(
"no access-list WORD$name [seq (1-4294967295)$seq] <deny|permit>$action ip <A.B.C.D$src A.B.C.D$src_mask|host A.B.C.D$src|any> <A.B.C.D$dst A.B.C.D$dst_mask|host A.B.C.D$dst|any>",
NO_STR
ACCESS_LIST_STR
ACCESS_LIST_ELEG_STR
ACCESS_LIST_ZEBRA_STR
ACCESS_LIST_SEQ_STR
ACCESS_LIST_ACTION_STR
"Any Internet Protocol\n"
Expand Down
16 changes: 4 additions & 12 deletions lib/routemap_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,10 @@ DEFPY_YANG(

DEFPY_YANG(
match_ip_address, match_ip_address_cmd,
"match ip address <(1-199)|(1300-2699)|WORD>$name",
"match ip address WORD$name",
MATCH_STR
IP_STR
"Match address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
const char *xpath =
Expand All @@ -187,13 +185,11 @@ DEFPY_YANG(

DEFPY_YANG(
no_match_ip_address, no_match_ip_address_cmd,
"no match ip address [<(1-199)|(1300-2699)|WORD>]",
"no match ip address [WORD]",
NO_STR
MATCH_STR
IP_STR
"Match address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
const char *xpath =
Expand Down Expand Up @@ -246,12 +242,10 @@ DEFPY_YANG(

DEFPY_YANG(
match_ip_next_hop, match_ip_next_hop_cmd,
"match ip next-hop <(1-199)|(1300-2699)|WORD>$name",
"match ip next-hop WORD$name",
MATCH_STR
IP_STR
"Match next-hop address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
const char *xpath =
Expand All @@ -268,13 +262,11 @@ DEFPY_YANG(

DEFPY_YANG(
no_match_ip_next_hop, no_match_ip_next_hop_cmd,
"no match ip next-hop [<(1-199)|(1300-2699)|WORD>]",
"no match ip next-hop [WORD]",
NO_STR
MATCH_STR
IP_STR
"Match address of route\n"
"IP access-list number\n"
"IP access-list number (expanded range)\n"
"IP Access-list name\n")
{
const char *xpath =
Expand Down
Loading

0 comments on commit 7e86999

Please sign in to comment.