Debian Codegraph @

ntc_templates/templates/cisco_nxos_show_access-lists.textfsm

raw
1 # NX-OS ACL structure is quite complex and includes IP, IPv6 and MAC ACL types.
2 #
3 # IP/IPv6 ACL:
4 # SEQUENCE_NUMBER ACTION PROTOCOL SOURCE [PORT id] [RANGE start finish] DESTINATION [MODIFIER]
5 #
6 # MAC ACL:
7 # SEQUENCE_NUMBER ACTION SOURCE DESTINATION [MODIFIER]
8 #
9 Value Filldown NAME (.*)
10 Value Required SN (\d+)
11 Value ACTION (\w+)
12 Value PROTOCOL ([^any][\w+\d+]+)
13 # SOURCE RegEx must be able to catch both MAC and IP addresses including masks. 'any' and 'address group' are possible too.
14 Value SOURCE ([\w+\d+]+\.[\w+\d+]+\.[\w+\d+]+\s[\w+\d+]+\.[\w+\d+]+\.[\w+\d+]+|any|\d+\.\d+\.\d+\.\d+/\d+|addrgroup\s\S+|\S+)
15 # RANGE RegEx catches the first and last protocol to match in the interval range.
16 Value RANGE (\S+\s\S+)
17 # We can specify protocols to match. 'eq', 'gt', 'lt' and 'neq' are supported.
18 Value PORT (eq\s\S+|gt\s\S+|lt\s\S+|neq\s\S+)
19 # SOURCE RegEx must be able to catch both MAC and IP addresses including masks. 'any' and 'address group' are possible too.
20 Value DESTINATION ([\w+\d+]+\.[\w+\d+]+\.[\w+\d+]+\s[\w+\d+]+\.[\w+\d+]+\.[\w+\d+]+|any|\d+\.\d+\.\d+\.\d+/\d+|addrgroup\s\S+|\S+)
21 # What it remains is some ACL modifier used to do fancy stuff.
22 Value MODIFIER (.*)
23 Value REMARK (.*)
24
25 Start
26 # ACL name is matched not starting with space. FILLDOWN, other line's inherit last NAME
27 ^[^\s].*\slist\s+${NAME}$$
28 # Catch remarks as uniq type, capture Action first and then Action=remark
29 ^\s+${SN}\s+${ACTION}\s -> Continue
30 ^\s+${SN}\s+remark\s${REMARK}$$ -> Record
31 # This line matches all the possible combination of fields specifed above.
32 ^\s+${SN}\s+${ACTION}(\s+${PROTOCOL})*\s+${SOURCE}(\s+${PORT})*(\s+range\s${RANGE})*\s+${DESTINATION}(\s+${MODIFIER})* -> Record
33 # Drop lines we are not interested in
34 ^\s+statistics per-entry
35 ^\s*$$
36 ^. -> Error