Skip to content

Commit 440d1e2

Browse files
committed
Fix comments
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
1 parent 906ab3e commit 440d1e2

File tree

6 files changed

+59
-7
lines changed

6 files changed

+59
-7
lines changed

src/sonic-yang-models/doc/Configuration.md

+15
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Table of Contents
9191
* [XCVRD_LOG](#xcvrd_log)
9292
* [PASSWORD_HARDENING](#password_hardening)
9393
* [SSH_SERVER](#ssh_server)
94+
* [SUBNET_DECAP](#subnet_decap)
9495
* [SYSTEM_DEFAULTS table](#systemdefaults-table)
9596
* [RADIUS](#radius)
9697
* [Static DNS](#static-dns)
@@ -2814,6 +2815,20 @@ The method could be:
28142815
}
28152816
```
28162817
2818+
### SUBNET_DECAP
2819+
2820+
The **SUBNET_DECAP** table is used for subnet decap configuration.
2821+
2822+
```
2823+
"SUBNET_DECAP": {
2824+
"AZURE": {
2825+
"status": "enable",
2826+
"src_ip": "10.10.10.0/24",
2827+
"src_ip_v6": "20c1:ba8::/64"
2828+
}
2829+
}
2830+
```
2831+
28172832
### SYSTEM_DEFAULTS table
28182833
To have a better management of the features in SONiC, a new table `SYSTEM_DEFAULTS` is introduced.
28192834

src/sonic-yang-models/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def run(self):
167167
'./yang-models/sonic-system-tacacs.yang',
168168
'./yang-models/sonic-system-radius.yang',
169169
'./yang-models/sonic-system-ldap.yang',
170+
'./yang-models/sonic-subnet-decap.yang',
170171
'./yang-models/sonic-telemetry.yang',
171172
'./yang-models/sonic-telemetry_client.yang',
172173
'./yang-models/sonic-gnmi.yang',

src/sonic-yang-models/tests/files/sample_config_db.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
"vni" : "100"
66
}
77
},
8+
"SUBNET_DECAP": {
9+
"AZURE": {
10+
"status": "enable",
11+
"src_ip": "10.10.10.0/24",
12+
"src_ip_v6": "20c1:ba8::/64"
13+
}
14+
},
815
"DHCP_SERVER": {
916
"192.0.0.8": {},
1017
"192.0.0.8": {},
@@ -2762,13 +2769,6 @@
27622769
"log_verbosity": "notice"
27632770
}
27642771
},
2765-
"SUBNET_DECAP": {
2766-
"AZURE": {
2767-
"status": "enable",
2768-
"src_ip": "10.10.10.0/24",
2769-
"src_ip_v6": "20c1:ba8::/64"
2770-
}
2771-
},
27722772
"GRPCCLIENT": {
27732773
"config": {
27742774
"type": "secure",

src/sonic-yang-models/tests/yang_model_tests/tests/subnet_decap.json

+8
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,13 @@
1919
"SUBNET_DECAP_INVALID_IPV6": {
2020
"desc": "Configure SUBNET_DECAP table with invalid src ipv6 prefix.",
2121
"eStrKey": "Pattern"
22+
},
23+
"SUBNET_DECAP_NO_IPV4": {
24+
"desc": "Configure SUBNET_DECAP table without src ipv4 prefix.",
25+
"eStrKey": "Mandatory"
26+
},
27+
"SUBNET_DECAP_NO_IPV6": {
28+
"desc": "Configure SUBNET_DECAP table without src ipv6 prefix.",
29+
"eStrKey": "Mandatory"
2230
}
2331
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/subnet_decap.json

+26
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,31 @@
8181
]
8282
}
8383
}
84+
},
85+
"SUBNET_DECAP_NO_IPV4": {
86+
"sonic-subnet-decap:sonic-subnet-decap": {
87+
"sonic-subnet-decap:SUBNET_DECAP": {
88+
"SUBNET_DECAP_LIST": [
89+
{
90+
"name": "AZURE",
91+
"status": "enable",
92+
"src_ip_v6": "20c1:ba8::/64"
93+
}
94+
]
95+
}
96+
}
97+
},
98+
"SUBNET_DECAP_NO_IPV6": {
99+
"sonic-subnet-decap:sonic-subnet-decap": {
100+
"sonic-subnet-decap:SUBNET_DECAP": {
101+
"SUBNET_DECAP_LIST": [
102+
{
103+
"name": "AZURE",
104+
"status": "enable",
105+
"src_ip": "10.10.10.0/24"
106+
}
107+
]
108+
}
109+
}
84110
}
85111
}

src/sonic-yang-models/yang-models/sonic-subnet-decap.yang

+2
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ module sonic-subnet-decap {
4141
leaf src_ip {
4242
type inet:ipv4-prefix;
4343
description "Subnet decap term source IPv4 prefix.";
44+
mandatory true;
4445
}
4546

4647
leaf src_ip_v6 {
4748
type inet:ipv6-prefix;
4849
description "Subnet decap term source IPv6 prefix.";
50+
mandatory true;
4951
}
5052
}
5153
}

0 commit comments

Comments
 (0)