-
Notifications
You must be signed in to change notification settings - Fork 732
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
base: master
Are you sure you want to change the base?
Ipv6 support #1905
Conversation
brunopeter
commented
Nov 20, 2024
- added support for ipv6 network and service groups including ipv6 addresses and masks
@brunopeter |
added raw test data and parsed |
Thank you. Functionally, is there an advantage to separate ICMP and ICMPv6 types? |
@mjbear no functional reason beyond the number of types is large and separating them made some of protocol differences more clear. |
Makes sense. Thank you for replying. I may have to give that a try to see if it breaks anything, haha. |
If it's like the service objects, cisco will replace numbers with the name e.g. service 80 becomes service http. |
tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.raw
Outdated
Show resolved
Hide resolved
PORT_RANGE_END: '' | ||
PORT_RANGE_START: '' | ||
PROTOCOL: '' | ||
TYPE: V6-Network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TYPE: V6-Network | |
TYPE: V6-Network | |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @brunopeter just a couple of minor whitespace fixes, and will need to update the YAML file to pass linting. There are some helper scripts to fix it up for you: https://ntc-templates.readthedocs.io/en/latest/dev/dev_parser/#development-helper-scripts
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 |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brunopeter
I didn't realize this until now, but the keys in your YAML are in uppercase but they should be lowercase.
I'm going to work up a PR against your ipv6-support branch that you can easily merge in to fix this up.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Canceling/hiding this inline review as they're obsoleted by brunopeter/pull/1
Please review that PR and merge it in. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brunopeter I think the fixes in this PR should have the tests ready to go through CI
…v6.raw Co-authored-by: Jacob McGill <[email protected]>
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}))) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
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
^${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 |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
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
@brunopeter I've pulled together a PR against your fork of ntc-templates so you can merge some changes into your ipv6-support branch. Please review that PR and merge it into your ipv6-branch once you've read through it and follow the changes. Any questions or comments, put them on the discussion for the PR brunopeter/pull/1 over at your forked repo. |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brunopeter I think the fixes in this PR should have the tests ready to go through CI
@brunopeter |
Hi @brunopeter |