Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipv6 support #1905

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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+)

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obsoleted by brunopeter/pull/1

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

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obsoleted by brunopeter/pull/1

^\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,9 @@
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

brunopeter marked this conversation as resolved.
Show resolved Hide resolved
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: ''

Check failure on line 3 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

3:10 [quoted-strings] string value is not quoted with double quotes
DESCRIPTION: ''

Check failure on line 4 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

4:18 [quoted-strings] string value is not quoted with double quotes
HOST: ''

Check failure on line 5 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

5:11 [quoted-strings] string value is not quoted with double quotes
HOST_RANGE_END: ''

Check failure on line 6 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

6:21 [quoted-strings] string value is not quoted with double quotes
HOST_RANGE_START: ''

Check failure on line 7 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

7:23 [quoted-strings] string value is not quoted with double quotes
ICMP6_TYPE: ''

Check failure on line 8 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

8:17 [quoted-strings] string value is not quoted with double quotes
ICMP_TYPE: ''

Check failure on line 9 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

9:16 [quoted-strings] string value is not quoted with double quotes
NAME: TEST-v6-icmp

Check failure on line 10 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

10:11 [quoted-strings] string value is not quoted with double quotes
NESTED_GROUPS: ''

Check failure on line 11 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

11:20 [quoted-strings] string value is not quoted with double quotes
NETMASK: ''

Check failure on line 12 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

12:14 [quoted-strings] string value is not quoted with double quotes
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
- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TYPE: V6-Network
TYPE: V6-Network

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the TYPE be a double quoted string too?

TYPE: "V6-Network"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be obsoleted by brunopeter/pull/1