Skip to content

Commit

Permalink
New Template - cisco_ios_show_object-group (networktocode#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkomissarov authored Mar 11, 2021
1 parent 12e58e4 commit c93de9c
Show file tree
Hide file tree
Showing 4 changed files with 561 additions and 0 deletions.
31 changes: 31 additions & 0 deletions templates/cisco_ios_show_object-group.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Value Required,Filldown TYPE (Service|Network)
Value Required,Filldown NAME (\S+)
Value DESCRIPTION (.+)
Value NESTED_GROUPS (\S+)
Value ANY (any)
Value HOST (\d+\.\d+\.\d+\.\d+)
Value HOST_RANGE_START (\d+\.\d+\.\d+\.\d+)
Value HOST_RANGE_END (\d+\.\d+\.\d+\.\d+)
Value NETWORK (\d+\.\d+\.\d+\.\d+)
Value NETMASK (\d+\.\d+\.\d+\.\d+)
Value PROTOCOL (\S+)
Value PORT_MATCH (eq|neq|range|lt|gt)
Value PORT ((?<!range\s)\S+)
Value PORT_RANGE_START ((?<=range\s)\S+)
Value PORT_RANGE_END (\S+)
Value ICMP_TYPE (echo|echo-reply|administratively-prohibited|unreachable|port-unreachable|redirect|router-advertisement|router-solicitation|packet-too-big|time-exceeded|ttl-exceeded|parameter-problem)

Start
^(Service|Network) -> Continue.Clearall
^${TYPE}\s+object\s+group\s+${NAME}\s*$$ -> Record
^\s+Description\s+${DESCRIPTION}$$ -> Record
^\s+group-object\s+${NESTED_GROUPS}\s*$$ -> Record
^\s+(host\s+${HOST}|range\s+${HOST_RANGE_START}\s+${HOST_RANGE_END}|${ANY}|${NETWORK}\s+${NETMASK})\s*$$ -> Record
^\s+icmp\s+${ICMP_TYPE}\s*$$ -> Record
^\s+${PROTOCOL}\s+${PORT_MATCH}\s+(${PORT_RANGE_START}\s+${PORT_RANGE_END}|${PORT})\s*$$ -> Record
^\s+${PROTOCOL}\s*$$ -> Record
^\s*$$
^. -> Error

EOF

1 change: 1 addition & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ cisco_ios_show_processes_cpu.textfsm, .*, cisco_ios, sh[[ow]] proc[[esses]] [[cp
cisco_ios_show_spanning-tree.textfsm, .*, cisco_ios, sh[[ow]] sp[[anning-tree]]
cisco_ios_show_standby_brief.textfsm, .*, cisco_ios, sh[[ow]] standby(?:\s+\S+)? br[[ief]]
cisco_ios_show_ip_interface.textfsm, .*, cisco_ios, sh[[ow]] ip int[[erface]]
cisco_ios_show_object-group.textfsm, .*, cisco_ios, sh[[ow]] ob[[ject-group]]
cisco_ios_show_power_status.textfsm, .*, cisco_ios, sh[[ow]] pow[[er]] st[[atus]]
cisco_ios_show_access-list.textfsm, .*, cisco_ios, sh[[ow]] acc[[ess-list]]
cisco_ios_show_isdn_status.textfsm, .*, cisco_ios, sh[[ow]] isd[[n]] st[[atus]]
Expand Down
31 changes: 31 additions & 0 deletions tests/cisco_ios/show_object-group/cisco_ios_show_object-group.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Network object group NNNN
Service object group SSSS
Service object group TEST-SVC-OGR
Description ! Test Service Group !
icmp echo-reply
tcp eq smtp
udp eq tacacs
udp range tacacs 50
tcp range 79 www
tcp eq www
tcp eq 81
udp lt 999
udp gt 97
tcp-udp range 12200 12700
icmp
tcp
udp
tcp-udp range 0 65535
group-object SSSS
ip
ipinip
99
Network object group TEST_NET_OGR
Description ###TEST NETWORK OGR###
any
host 1.1.1.1
range 2.2.2.2 3.3.3.3
group-object NNNN
1.1.1.0 255.255.255.0
Network object group XXXX
Network object group YYYY
Loading

0 comments on commit c93de9c

Please sign in to comment.