Skip to content

Commit 2194702

Browse files
committed
Fix comments
Fix comments Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
1 parent c77e210 commit 2194702

File tree

6 files changed

+169
-105
lines changed

6 files changed

+169
-105
lines changed

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

+118-93
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,109 @@
11
# SONiC Configuration Database Manual
22

3-
**Table of Contents**
4-
5-
* [Introduction](#introduction)
6-
* [Configuration](#configuration)
7-
* [<strong>Config Load and Save</strong>](#config-load-and-save)
8-
* [Incremental Configuration](#incremental-configuration)
9-
* [<strong>Redis and Json Schema</strong>](#redis-and-json-schema)
10-
* [ACL and Mirroring](#acl-and-mirroring)
11-
* [BGP BBR](#bgp-bbr)
12-
* [ASIC SDK health event](#asic-sdk-health-event)
13-
* [BGP Device Global](#bgp-device-global)
14-
* [BGP Sessions](#bgp-sessions)
15-
* [BUFFER_PG](#buffer_pg)
16-
* [Buffer pool](#buffer-pool)
17-
* [Buffer profile](#buffer-profile)
18-
* [Buffer queue](#buffer-queue)
19-
* [Buffer port ingress profile list](#buffer-port-ingress-profile-list)
20-
* [Buffer port egress profile list](#buffer-port-egress-profile-list)
21-
* [Cable length](#cable-length)
22-
* [Chassis module](#chassis-module)
23-
* [COPP_TABLE](#copp_table)
24-
* [Console](#console)
25-
* [CRM](#crm)
26-
* [CRM DASH](#crm-dash)
27-
* [Data Plane L3 Interfaces](#data-plane-l3-interfaces)
28-
* [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER)
29-
* [Device Metadata](#device-metadata)
30-
* [Device neighbor metada](#device-neighbor-metada)
31-
* [DHCP_RELAY](#dhcp_relay)
32-
* [DHCP Server IPV4](#dhcp_server_ipv4)
33-
* [BMP](#bmp)
34-
* [DSCP_TO_TC_MAP](#dscp_to_tc_map)
35-
* [FG_NHG](#fg_nhg)
36-
* [FG_NHG_MEMBER](#fg_nhg_member)
37-
* [FG_NHG_PREFIX](#fg_nhg_prefix)
38-
* [FABRIC_MONITOR](#fabric-monitor)
39-
* [FABRIC_PORT](#fabric-port)
40-
* [FLEX_COUNTER_TABLE](#flex_counter_table)
41-
* [GRPCCLIENT](#grpcclient)
42-
* [Hash](#hash)
43-
* [IPv6 Link-local] (#ipv6-link-local)
44-
* [KDUMP](#kdump)
45-
* [Kubernetes Master](#kubernetes-master)
46-
* [L2 Neighbors](#l2-neighbors)
47-
* [Loopback Interface](#loopback-interface)
48-
* [LOSSLESS_TRAFFIC_PATTERN](#LOSSLESS_TRAFFIC_PATTERN)
49-
* [Memory Statistics](#memory-statistics)
50-
* [Management Interface](#management-interface)
51-
* [Management port](#management-port)
52-
* [Management VRF](#management-vrf)
53-
* [MAP_PFC_PRIORITY_TO_QUEUE](#map_pfc_priority_to_queue)
54-
* [MUX_CABLE](#mux_cable)
55-
* [MUX_LINKMGR](#mux_linkmgr)
56-
* [NEIGH](#neigh)
57-
* [NTP Global Configuration](#ntp-global-configuration)
58-
* [NTP Servers](#ntp-servers)
59-
* [Peer Switch](#peer-switch)
60-
* [Policer](#policer)
61-
* [Port](#port)
62-
* [Port Channel](#port-channel)
63-
* [Portchannel member](#portchannel-member)
64-
* [Scheduler](#scheduler)
65-
* [Port QoS Map](#port-qos-map)
66-
* [Queue](#queue)
67-
* [Syslog Global Configuration](#syslog-global-configuration)
68-
* [Syslog Servers](#syslog-servers)
69-
* [Sflow](#sflow)
70-
* [Restapi](#restapi)
71-
* [System Port](#system-port)
72-
* [Tacplus Server](#tacplus-server)
73-
* [TC to Priority group map](#tc-to-priority-group-map)
74-
* [TC to Queue map](#tc-to-queue-map)
75-
* [Telemetry](#telemetry)
76-
* [Telemetry client](#telemetry-client)
77-
* [Tunnel](#tunnel)
78-
* [Versions](#versions)
79-
* [VLAN](#vlan)
80-
* [VLAN_MEMBER](#vlan_member)
81-
* [VNET](#vnet)
82-
* [VOQ Inband Interface](#voq-inband-interface)
83-
* [VXLAN](#vxlan)
84-
* [Virtual router](#virtual-router)
85-
* [LOGGER](#logger)
86-
* [WRED_PROFILE](#wred_profile)
87-
* [XCVRD_LOG](#xcvrd_log)
88-
* [PASSWORD_HARDENING](#password_hardening)
89-
* [SSH_SERVER](#ssh_server)
90-
* [SYSTEM_DEFAULTS table](#systemdefaults-table)
91-
* [RADIUS](#radius)
92-
* [Static DNS](#static-dns)
93-
* [For Developers](#for-developers)
94-
* [Generating Application Config by Jinja2 Template](#generating-application-config-by-jinja2-template)
95-
* [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb)
3+
Table of Contents
4+
=================
5+
6+
- [SONiC Configuration Database Manual](#sonic-configuration-database-manual)
7+
- [Table of Contents](#table-of-contents)
8+
- [Introduction](#introduction)
9+
- [Configuration](#configuration)
10+
- [**Config Load and Save**](#config-load-and-save)
11+
- [Incremental Configuration](#incremental-configuration)
12+
- [**Redis and Json Schema**](#redis-and-json-schema)
13+
- [ACL and Mirroring](#acl-and-mirroring)
14+
- [BGP BBR](#bgp-bbr)
15+
- [ASIC SDK health event](#asic-sdk-health-event)
16+
- [BGP Device Global](#bgp-device-global)
17+
- [BGP Sessions](#bgp-sessions)
18+
- [BUFFER\_PG](#buffer_pg)
19+
- [Buffer pool](#buffer-pool)
20+
- [Buffer profile](#buffer-profile)
21+
- [Buffer queue](#buffer-queue)
22+
- [Buffer port ingress profile list](#buffer-port-ingress-profile-list)
23+
- [Buffer port egress profile list](#buffer-port-egress-profile-list)
24+
- [Cable length](#cable-length)
25+
- [Chassis Module](#chassis-module)
26+
- [COPP\_TABLE](#copp_table)
27+
- [Console](#console)
28+
- [CRM](#crm)
29+
- [CRM DASH](#crm-dash)
30+
- [Data Plane L3 Interfaces](#data-plane-l3-interfaces)
31+
- [DEFAULT\_LOSSLESS\_BUFFER\_PARAMETER](#default_lossless_buffer_parameter)
32+
- [Device Metadata](#device-metadata)
33+
- [Device neighbor metada](#device-neighbor-metada)
34+
- [DHCP\_RELAY](#dhcp_relay)
35+
- [BMP](#bmp)
36+
- [DHCP\_SERVER\_IPV4](#dhcp_server_ipv4)
37+
- [DSCP\_TO\_TC\_MAP](#dscp_to_tc_map)
38+
- [FG\_NHG](#fg_nhg)
39+
- [FG\_NHG\_MEMBER](#fg_nhg_member)
40+
- [FG\_NHG\_PREFIX](#fg_nhg_prefix)
41+
- [FABRIC\_MONITOR](#fabric_monitor)
42+
- [FABRIC\_PORT](#fabric_port)
43+
- [MPLS\_TC\_TO\_TC\_MAP](#mpls_tc_to_tc_map)
44+
- [FLEX\_COUNTER\_TABLE](#flex_counter_table)
45+
- [Hash](#hash)
46+
- [IPv6 Link-local](#ipv6-link-local)
47+
- [KDUMP](#kdump)
48+
- [Kubernetes Master](#kubernetes-master)
49+
- [L2 Neighbors](#l2-neighbors)
50+
- [Loopback Interface](#loopback-interface)
51+
- [LOSSLESS\_TRAFFIC\_PATTERN](#lossless_traffic_pattern)
52+
- [Memory Statistics](#memory-statistics)
53+
- [Management Interface](#management-interface)
54+
- [Management port](#management-port)
55+
- [Management VRF](#management-vrf)
56+
- [MAP\_PFC\_PRIORITY\_TO\_QUEUE](#map_pfc_priority_to_queue)
57+
- [MUX\_CABLE](#mux_cable)
58+
- [MUX\_LINKMGR](#mux_linkmgr)
59+
- [NEIGH](#neigh)
60+
- [NTP Global Configuration](#ntp-global-configuration)
61+
- [NTP servers](#ntp-servers)
62+
- [Peer Switch](#peer-switch)
63+
- [Policer](#policer)
64+
- [Port](#port)
65+
- [Port Channel](#port-channel)
66+
- [Portchannel member](#portchannel-member)
67+
- [Scheduler](#scheduler)
68+
- [Port QoS Map](#port-qos-map)
69+
- [Queue](#queue)
70+
- [Restapi](#restapi)
71+
- [Sflow](#sflow)
72+
- [Storage Monitoring Daemon Interval Configuration](#storage-monitoring-daemon-interval-configuration)
73+
- [Syslog Global Configuration](#syslog-global-configuration)
74+
- [Syslog servers](#syslog-servers)
75+
- [System Port](#system-port)
76+
- [Tacplus Server](#tacplus-server)
77+
- [TC to Priority group map](#tc-to-priority-group-map)
78+
- [TC to Queue map](#tc-to-queue-map)
79+
- [Telemetry](#telemetry)
80+
- [Telemetry client](#telemetry-client)
81+
- [Tunnel](#tunnel)
82+
- [Versions](#versions)
83+
- [VLAN](#vlan)
84+
- [VLAN\_MEMBER](#vlan_member)
85+
- [VNET](#vnet)
86+
- [VOQ INBAND INTERFACE](#voq-inband-interface)
87+
- [VXLAN](#vxlan)
88+
- [Virtual router](#virtual-router)
89+
- [WRED\_PROFILE](#wred_profile)
90+
- [Logger](#logger)
91+
- [PASSWORD\_HARDENING](#password_hardening)
92+
- [SERIAL\_CONSOLE](#serial_console)
93+
- [SSH\_SERVER](#ssh_server)
94+
- [BREAKOUT\_CFG](#breakout_cfg)
95+
- [AAA](#aaa)
96+
- [SUBNET\_DECAP](#subnet_decap)
97+
- [SYSTEM\_DEFAULTS table](#system_defaults-table)
98+
- [RADIUS](#radius)
99+
- [Static DNS](#static-dns)
100+
- [FIPS](#fips)
101+
- [MID\_PLANE\_BRIDGE"](#mid_plane_bridge)
102+
- [DPUS](#dpus)
103+
- [For Developers](#for-developers)
104+
- [Generating Application Config by Jinja2 Template](#generating-application-config-by-jinja2-template)
105+
- [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb)
106+
96107

97108

98109
# Introduction
@@ -2809,6 +2820,20 @@ The method could be:
28092820
}
28102821
```
28112822
2823+
### SUBNET_DECAP
2824+
2825+
The **SUBNET_DECAP** table is used for subnet decap configuration.
2826+
2827+
```
2828+
"SUBNET_DECAP": {
2829+
"AZURE": {
2830+
"status": "enable",
2831+
"src_ip": "10.10.10.0/24",
2832+
"src_ip_v6": "20c1:ba8::/64"
2833+
}
2834+
}
2835+
```
2836+
28122837
### SYSTEM_DEFAULTS table
28132838
To have a better management of the features in SONiC, a new table `SYSTEM_DEFAULTS` is introduced.
28142839

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": {},
@@ -2765,13 +2772,6 @@
27652772
"log_verbosity": "notice"
27662773
}
27672774
},
2768-
"SUBNET_DECAP": {
2769-
"AZURE": {
2770-
"status": "enable",
2771-
"src_ip": "10.10.10.0/24",
2772-
"src_ip_v6": "20c1:ba8::/64"
2773-
}
2774-
},
27752775
"GRPCCLIENT": {
27762776
"config": {
27772777
"type": "secure",

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"SUBNET_DECAP_INVALID_STATUS_TEST": {
1212
"desc": "Configure SUBNET_DECAP table with invalid status.",
13-
"eStrKey": "Pattern"
13+
"eStrKey": "InvalidValue"
1414
},
1515
"SUBNET_DECAP_INVALID_IPV4": {
1616
"desc": "Configure SUBNET_DECAP table with invalid src ipv4 prefix.",
@@ -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

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ module sonic-subnet-decap {
1010
prefix inet;
1111
}
1212

13+
import sonic-types {
14+
prefix stypes;
15+
}
16+
1317
description "Subnet decap configuration for SONiC OS.";
1418

1519
revision 2024-12-19 {
@@ -31,21 +35,21 @@ module sonic-subnet-decap {
3135
}
3236

3337
leaf status {
34-
type string {
35-
pattern "enable|disable";
36-
}
37-
default "disable";
38+
type stypes:mode-status;
39+
default disable;
3840
description "Subnet Decap status.";
3941
}
4042

4143
leaf src_ip {
4244
type inet:ipv4-prefix;
4345
description "Subnet decap term source IPv4 prefix.";
46+
mandatory true;
4447
}
4548

4649
leaf src_ip_v6 {
4750
type inet:ipv6-prefix;
4851
description "Subnet decap term source IPv6 prefix.";
52+
mandatory true;
4953
}
5054
}
5155
}

0 commit comments

Comments
 (0)