Skip to content

Commit

Permalink
Add IPv6 network and service group support to IOS show object-group (#…
Browse files Browse the repository at this point in the history
…1951)

Co-authored-by: Peter Bruno <[email protected]>
  • Loading branch information
mjbear and brunopeter authored Jan 7, 2025
1 parent 9a3e8d2 commit 6363392
Show file tree
Hide file tree
Showing 4 changed files with 495 additions and 318 deletions.
16 changes: 8 additions & 8 deletions ntc_templates/templates/cisco_ios_show_object-group.textfsm
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
Value Required,Filldown TYPE (Service|Network)
Value Required,Filldown TYPE (Service|Network|V6-Service|V6-Network)
Value Required,Filldown NAME (\S+)
Value DESCRIPTION (.+)
Value NESTED_GROUPS (\S+)
Value ANY (any)
Value HOST (\d+\.\d+\.\d+\.\d+)
Value HOST (((\d+\.\d+\.\d+\.\d+)|([A-Fa-f0-9:]+:+)+[A-Fa-f0-9]+))
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 NETWORK ((\d+\.\d+\.\d+\.\d+)|([A-Fa-f0-9:]+:+[A-Fa-f0-9:]+))
Value NETMASK ((\d+\.\d+\.\d+\.\d+)|((?:\d{1,3})))
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)
Value ICMP6_TYPE (dhaad-reply|dhaad-request|echo-reply|echo-request|mld-query|mld-reduction|mld-report|mld-v2-report|mpd-advertisement|mpd-solicitation|nd-na|nd-ns|packet-too-big|parameter-problem|redirect|router-advertisement|router-renumbering|router-solicitation|time-exceeded|unreachable)

Start
^(Service|Network) -> Continue.Clearall
^(Service|Network|V6-Service|V6-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+(host\s+${HOST}|range\s+${HOST_RANGE_START}\s+${HOST_RANGE_END}|${ANY}|${NETWORK}\s*/?${NETMASK})\s*$$ -> Record
^\s+icmp\s+(${ICMP_TYPE}|${ICMP6_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

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
V6-Network object group TEST-v6-obj
host 2001:db8::1:1111
host 2001:db8::2:2222
2001:db8:111:1::/48
2001:db8:222:2::/48
V6-Service object group TEST-v6-icmp
icmp echo-request
icmp echo-reply
138 changes: 138 additions & 0 deletions tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
parsed_sample:
- any: ""
description: ""
host: ""
host_range_end: ""
host_range_start: ""
icmp6_type: ""
icmp_type: ""
name: "TEST-v6-obj"
nested_groups: ""
netmask: ""
network: ""
port: ""
port_match: ""
port_range_end: ""
port_range_start: ""
protocol: ""
type: "V6-Network"
- any: ""
description: ""
host: "2001:db8::1:1111"
host_range_end: ""
host_range_start: ""
icmp6_type: ""
icmp_type: ""
name: "TEST-v6-obj"
nested_groups: ""
netmask: ""
network: ""
port: ""
port_match: ""
port_range_end: ""
port_range_start: ""
protocol: ""
type: "V6-Network"
- any: ""
description: ""
host: "2001:db8::2:2222"
host_range_end: ""
host_range_start: ""
icmp6_type: ""
icmp_type: ""
name: "TEST-v6-obj"
nested_groups: ""
netmask: ""
network: ""
port: ""
port_match: ""
port_range_end: ""
port_range_start: ""
protocol: ""
type: "V6-Network"
- any: ""
description: ""
host: ""
host_range_end: ""
host_range_start: ""
icmp6_type: ""
icmp_type: ""
name: "TEST-v6-obj"
nested_groups: ""
netmask: "48"
network: "2001:db8:111:1::"
port: ""
port_match: ""
port_range_end: ""
port_range_start: ""
protocol: ""
type: "V6-Network"
- any: ""
description: ""
host: ""
host_range_end: ""
host_range_start: ""
icmp6_type: ""
icmp_type: ""
name: "TEST-v6-obj"
nested_groups: ""
netmask: "48"
network: "2001:db8:222:2::"
port: ""
port_match: ""
port_range_end: ""
port_range_start: ""
protocol: ""
type: "V6-Network"
- any: ""
description: ""
host: ""
host_range_end: ""
host_range_start: ""
icmp6_type: ""
icmp_type: ""
name: "TEST-v6-icmp"
nested_groups: ""
netmask: ""
network: ""
port: ""
port_match: ""
port_range_end: ""
port_range_start: ""
protocol: ""
type: "V6-Service"
- any: ""
description: ""
host: ""
host_range_end: ""
host_range_start: ""
icmp6_type: "echo-request"
icmp_type: ""
name: "TEST-v6-icmp"
nested_groups: ""
netmask: ""
network: ""
port: ""
port_match: ""
port_range_end: ""
port_range_start: ""
protocol: ""
type: "V6-Service"
- any: ""
description: ""
host: ""
host_range_end: ""
host_range_start: ""
icmp6_type: ""
icmp_type: "echo-reply"
name: "TEST-v6-icmp"
nested_groups: ""
netmask: ""
network: ""
port: ""
port_match: ""
port_range_end: ""
port_range_start: ""
protocol: ""
type: "V6-Service"
Loading

0 comments on commit 6363392

Please sign in to comment.