Skip to content
New issue

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

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

Already on GitHub? # to your account

[action] [PR:21466] [YANG] SRv6 yang model followup fix #543

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,17 @@
"desc": "A SID configured with invalid locator identifier",
"eStrKey" : "LeafRef"
},
"SRV6_MY_SID_INVALID_IP_ADDR": {
"SRV6_MY_SID_INVALID_IP_PREFIX": {
"desc": "A SID configured with invalid IPv6 address",
"eStrKey" : "Pattern"
},
"SRV6_MY_SID_UNMATCHED_IP_ADDR": {
"SRV6_MY_SID_UNMATCHED_IP_PREFIX": {
"desc": "A SID configured with an IPv6 Address that does not match with the prefix of the locator",
"eStrKey" : "Must"
},
"SRV6_MY_SID_INVALID_ACTION": {
"desc": "A SID configured with invalid action",
"eStrKey" : "InvalidValue",
"eStr": ["action"]
},
"SRV6_MY_SID_DSCP_MODE_WITH_UN": {
"desc": "A SID configured with dscp_mode and uN action",
"eStrKey" : "When",
"eStr": ["action"]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"sonic-srv6:SRV6_MY_SIDS": {
"SRV6_MY_SIDS_LIST": [
{
"ip_address": "FCBB:BBBB:20::",
"ip_prefix": "FCBB:BBBB:20::/48",
"locator": "MAIN",
"action": "uN"
},
{
"ip_address": "FCBB:BBBB:20:F1::",
"ip_prefix": "FCBB:BBBB:20:F1::/64",
"locator": "MAIN",
"action": "uDT46"
}
Expand All @@ -39,12 +39,12 @@
"sonic-srv6:SRV6_MY_SIDS": {
"SRV6_MY_SIDS_LIST": [
{
"ip_address": "FCBB:BBBB:20::",
"ip_prefix": "FCBB:BBBB:20::/48",
"locator": "MAIN",
"action": "uN"
},
{
"ip_address": "FCBB:BBBB:20:F1::",
"ip_prefix": "FCBB:BBBB:20:F1::/64",
"locator": "MAIN",
"action": "uDT46"
}
Expand All @@ -66,12 +66,12 @@
"sonic-srv6:SRV6_MY_SIDS": {
"SRV6_MY_SIDS_LIST": [
{
"ip_address": "FCBB:BBBB:20::",
"ip_prefix": "FCBB:BBBB:20::/48",
"locator": "MAIN",
"action": "uN"
},
{
"ip_address": "FCBB:BBBB:20:F1::",
"ip_prefix": "FCBB:BBBB:20:F1::/64",
"locator": "MAIN",
"action": "uDT46"
}
Expand All @@ -92,20 +92,20 @@
"sonic-srv6:SRV6_MY_SIDS": {
"SRV6_MY_SIDS_LIST": [
{
"ip_address": "FCBB:BBBB:20::",
"ip_prefix": "FCBB:BBBB:20::/48",
"locator": "None",
"action": "uN"
},
{
"ip_address": "FCBB:BBBB:20:F1::",
"ip_prefix": "FCBB:BBBB:20:F1::/64",
"locator": "MAIN",
"action": "uDT46"
}
]
}
}
},
"SRV6_MY_SID_INVALID_IP_ADDR": {
"SRV6_MY_SID_INVALID_IP_PREFIX": {
"sonic-srv6:sonic-srv6": {
"sonic-srv6:SRV6_MY_LOCATORS": {
"SRV6_MY_LOCATORS_LIST": [
Expand All @@ -118,20 +118,20 @@
"sonic-srv6:SRV6_MY_SIDS": {
"SRV6_MY_SIDS_LIST": [
{
"ip_address": "FCBB:BBBB:200001::",
"ip_prefix": "FCBB:BBBB:21::",
"locator": "MAIN",
"action": "uN"
},
{
"ip_address": "FCBB:BBBB:20:F1::",
"ip_prefix": "FCBB:BBBB:20:F1::/64",
"locator": "MAIN",
"action": "uDT46"
}
]
}
}
},
"SRV6_MY_SID_UNMATCHED_IP_ADDR": {
"SRV6_MY_SID_UNMATCHED_IP_PREFIX": {
"sonic-srv6:sonic-srv6": {
"sonic-srv6:SRV6_MY_LOCATORS": {
"SRV6_MY_LOCATORS_LIST": [
Expand All @@ -144,12 +144,12 @@
"sonic-srv6:SRV6_MY_SIDS": {
"SRV6_MY_SIDS_LIST": [
{
"ip_address": "FCBB:BBBB:21::",
"ip_prefix": "FCBB:BBBB:21::/48",
"locator": "MAIN",
"action": "uN"
},
{
"ip_address": "FCBB:BBBB:20:F1::",
"ip_prefix": "FCBB:BBBB:20:F1::/64",
"locator": "MAIN",
"action": "uDT46"
}
Expand All @@ -170,39 +170,12 @@
"sonic-srv6:SRV6_MY_SIDS": {
"SRV6_MY_SIDS_LIST": [
{
"ip_address": "FCBB:BBBB:20::",
"ip_prefix": "FCBB:BBBB:20::/48",
"locator": "MAIN",
"action": "uA"
},
{
"ip_address": "FCBB:BBBB:20:F1::",
"locator": "MAIN",
"action": "uDT46"
}
]
}
}
},
"SRV6_MY_SID_DSCP_MODE_WITH_UN": {
"sonic-srv6:sonic-srv6": {
"sonic-srv6:SRV6_MY_LOCATORS": {
"SRV6_MY_LOCATORS_LIST": [
{
"locator_name": "MAIN",
"prefix": "FCBB:BBBB:20::"
}
]
},
"sonic-srv6:SRV6_MY_SIDS": {
"SRV6_MY_SIDS_LIST": [
{
"ip_address": "FCBB:BBBB:20::",
"locator": "MAIN",
"action": "uN",
"decap_dscp_mode": "uniform"
},
{
"ip_address": "FCBB:BBBB:20:F1::",
"ip_prefix": "FCBB:BBBB:20:F1::/64",
"locator": "MAIN",
"action": "uDT46"
}
Expand Down
15 changes: 4 additions & 11 deletions src/sonic-yang-models/yang-models/sonic-srv6.yang
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ module sonic-srv6 {
prefix srv6;
yang-version 1.1;

import ietf-yang-types {
prefix yang;
}

import ietf-inet-types {
prefix inet;
}
Expand Down Expand Up @@ -87,10 +83,10 @@ module sonic-srv6 {

container SRV6_MY_SIDS {
list SRV6_MY_SIDS_LIST {
key "locator ip_address";
key "locator ip_prefix";

leaf ip_address {
type inet:ipv6-address;
leaf ip_prefix {
type inet:ipv6-prefix;
}

leaf locator {
Expand Down Expand Up @@ -125,12 +121,9 @@ module sonic-srv6 {
enum uniform;
enum pipe;
}
when "../action = 'uDT46'";

default "uniform";
}

must 'starts-with(./ip_address,
must 'starts-with(substring-before(./ip_prefix, "::"),
substring-before(/srv6:sonic-srv6/SRV6_MY_LOCATORS/SRV6_MY_LOCATORS_LIST[current()/locator]/prefix, "::"))';
}
}
Expand Down
Loading