Debian Codegraph @

ntc_templates/templates/cisco_ios_show_access-list.textfsm

raw
1 # IOS ACL structure is quite complex.
2 #
3 # Extended IP ACL:
4 # SEQUENCE_NUMBER ACTION PROTOCOL SOURCE [PORT id] [RANGE start finish] DESTINATION [MODIFIER]
5 #
6 # Standard ACL:
7 # SEQUENCE_NUMBER ACTION SOURCE DESTINATION [MODIFIER]
8 #
9 #
10 Value Filldown NAME (\S+)
11 Value Required SN (\d+)
12 Value ACTION (\w+)
13 Value PROTOCOL (\w+)
14 #
15 # SOURCE RegEx must be able to catch every possible source combination including masks. 'any' and 'host' and 'wildcard bits' are possible too.
16 #
17 Value SOURCE (host\s\d+\.\d+\.\d+\.\d+|any|\d+\.\d+\.\d+\.\d+\s\d+\.\d+\.\d+\.\d+|\d+\.\d+\.\d+\.\d+,\s+wildcard bits\s\d+\.\d+\.\d+\.\d+|\d+\.\d+\.\d+\.\d+)
18 #
19 # We can specify protocols to match. 'eq', 'gt', 'lt', 'range' and 'neq' are supported.
20 #
21 Value PORT (eq|gt|lt|neq|range)
22 #
23 # This can be either a single port or a list.
24 #
25 Value RANGE ([(\S+\s\S+)]+)
26 #
27 # DESTINATION RegEx must be able to catch every possible source combination including masks. 'any' and 'host' and 'wildcard bits' are possible too.
28 #
29 Value DESTINATION (host\s\d+\.\d+\.\d+\.\d+|any|\d+\.\d+\.\d+\.\d+\s\d+\.\d+\.\d+\.\d+|\d+\.\d+\.\d+\.\d+,\s+wildcard bits\s\d+\.\d+\.\d+\.\d+)
30 # MODIFIER "eq ftp" | "log" | "gt 1024"
31 Value MODIFIER ((\w+\s)?\w+)
32 Value MATCHES (\d+)
33
34 Start
35 ^.*list\s+${NAME}
36 ^\s+${SN}\s+${ACTION}\s+${PROTOCOL}\s+${SOURCE}(\s+${PORT})*(\s${RANGE})*\s+${DESTINATION}(\s+${MODIFIER})* -> Record
37 ^\s*${SN}\s+${ACTION}\s+${SOURCE}(\s+${MODIFIER}(\s\(${MATCHES} matches\))?)? -> Record
38 # Capture time-stamp if vty line has command time-stamping turned on
39 ^Load\s+for\s+
40 ^Time\s+source\s+is
41 ^\s*$$
42 ^. -> Error