-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[YANG] Add yang model to
SUBNET_DECAP
table (#21118)
* [YANG] Add yang model to `SUBNET_DECAP` table Signed-off-by: Longxiang Lyu <[email protected]>
- Loading branch information
Showing
6 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/sonic-yang-models/tests/yang_model_tests/tests/subnet_decap.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"SUBNET_DECAP_DEFAULT_TEST": { | ||
"desc": "Configure SUBNET_DECAP table." | ||
}, | ||
"SUBNET_DECAP_ENABLE_TEST": { | ||
"desc": "Configure SUBNET_DECAP table with status as enable." | ||
}, | ||
"SUBNET_DECAP_DISABLE_TEST": { | ||
"desc": "Configure SUBNET_DECAP table with status as disable." | ||
}, | ||
"SUBNET_DECAP_INVALID_STATUS_TEST": { | ||
"desc": "Configure SUBNET_DECAP table with invalid status.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"SUBNET_DECAP_INVALID_IPV4": { | ||
"desc": "Configure SUBNET_DECAP table with invalid src ipv4 prefix.", | ||
"eStrKey": "Pattern" | ||
}, | ||
"SUBNET_DECAP_INVALID_IPV6": { | ||
"desc": "Configure SUBNET_DECAP table with invalid src ipv6 prefix.", | ||
"eStrKey": "Pattern" | ||
}, | ||
"SUBNET_DECAP_NO_IPV4": { | ||
"desc": "Configure SUBNET_DECAP table without src ipv4 prefix.", | ||
"eStrKey": "Mandatory" | ||
}, | ||
"SUBNET_DECAP_NO_IPV6": { | ||
"desc": "Configure SUBNET_DECAP table without src ipv6 prefix.", | ||
"eStrKey": "Mandatory" | ||
} | ||
} |
111 changes: 111 additions & 0 deletions
111
src/sonic-yang-models/tests/yang_model_tests/tests_config/subnet_decap.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{ | ||
"SUBNET_DECAP_DEFAULT_TEST": { | ||
"sonic-subnet-decap:sonic-subnet-decap": { | ||
"sonic-subnet-decap:SUBNET_DECAP": { | ||
"SUBNET_DECAP_LIST": [ | ||
{ | ||
"name": "AZURE", | ||
"src_ip": "10.10.10.0/24", | ||
"src_ip_v6": "20c1:ba8::/64" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"SUBNET_DECAP_ENABLE_TEST": { | ||
"sonic-subnet-decap:sonic-subnet-decap": { | ||
"sonic-subnet-decap:SUBNET_DECAP": { | ||
"SUBNET_DECAP_LIST": [ | ||
{ | ||
"name": "AZURE", | ||
"status": "enable", | ||
"src_ip": "10.10.10.0/24", | ||
"src_ip_v6": "20c1:ba8::/64" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"SUBNET_DECAP_DISABLE_TEST": { | ||
"sonic-subnet-decap:sonic-subnet-decap": { | ||
"sonic-subnet-decap:SUBNET_DECAP": { | ||
"SUBNET_DECAP_LIST": [ | ||
{ | ||
"name": "AZURE", | ||
"status": "disable", | ||
"src_ip": "10.10.10.0/24", | ||
"src_ip_v6": "20c1:ba8::/64" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"SUBNET_DECAP_INVALID_STATUS_TEST": { | ||
"sonic-subnet-decap:sonic-subnet-decap": { | ||
"sonic-subnet-decap:SUBNET_DECAP": { | ||
"SUBNET_DECAP_LIST": [ | ||
{ | ||
"name": "AZURE", | ||
"status": "enabled", | ||
"src_ip": "10.10.10.0/24", | ||
"src_ip_v6": "20c1:ba8::/64" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"SUBNET_DECAP_INVALID_IPV4": { | ||
"sonic-subnet-decap:sonic-subnet-decap": { | ||
"sonic-subnet-decap:SUBNET_DECAP": { | ||
"SUBNET_DECAP_LIST": [ | ||
{ | ||
"name": "AZURE", | ||
"status": "enable", | ||
"src_ip": "10.10.10.01111/24", | ||
"src_ip_v6": "20c1:ba8::/64" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"SUBNET_DECAP_INVALID_IPV6": { | ||
"sonic-subnet-decap:sonic-subnet-decap": { | ||
"sonic-subnet-decap:SUBNET_DECAP": { | ||
"SUBNET_DECAP_LIST": [ | ||
{ | ||
"name": "AZURE", | ||
"status": "enable", | ||
"src_ip": "10.10.10.0/24", | ||
"src_ip_v6": "20c1:ba8::01111/64" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"SUBNET_DECAP_NO_IPV4": { | ||
"sonic-subnet-decap:sonic-subnet-decap": { | ||
"sonic-subnet-decap:SUBNET_DECAP": { | ||
"SUBNET_DECAP_LIST": [ | ||
{ | ||
"name": "AZURE", | ||
"status": "enable", | ||
"src_ip_v6": "20c1:ba8::/64" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"SUBNET_DECAP_NO_IPV6": { | ||
"sonic-subnet-decap:sonic-subnet-decap": { | ||
"sonic-subnet-decap:SUBNET_DECAP": { | ||
"SUBNET_DECAP_LIST": [ | ||
{ | ||
"name": "AZURE", | ||
"status": "enable", | ||
"src_ip": "10.10.10.0/24" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module sonic-subnet-decap { | ||
|
||
yang-version 1.1; | ||
|
||
namespace "http://github.com/sonic-net/sonic-subnet-decap"; | ||
|
||
prefix subnet-decap; | ||
|
||
import ietf-inet-types { | ||
prefix inet; | ||
} | ||
|
||
import sonic-types { | ||
prefix stypes; | ||
} | ||
|
||
description "Subnet decap configuration for SONiC OS."; | ||
|
||
revision 2024-12-19 { | ||
description "Initial version"; | ||
} | ||
|
||
container sonic-subnet-decap { | ||
container SUBNET_DECAP { | ||
|
||
description "CONFIG_DB subnet decap configuration."; | ||
|
||
list SUBNET_DECAP_LIST { | ||
|
||
key "name"; | ||
|
||
leaf name { | ||
type string; | ||
description "Subnet Decap config name."; | ||
} | ||
|
||
leaf status { | ||
type stypes:mode-status; | ||
default disable; | ||
description "Subnet Decap status."; | ||
} | ||
|
||
leaf src_ip { | ||
type inet:ipv4-prefix; | ||
description "Subnet decap term source IPv4 prefix."; | ||
mandatory true; | ||
} | ||
|
||
leaf src_ip_v6 { | ||
type inet:ipv6-prefix; | ||
description "Subnet decap term source IPv6 prefix."; | ||
mandatory true; | ||
} | ||
} | ||
} | ||
} | ||
} |