Skip to content

Commit 3b00557

Browse files
Added new dhcpv6-relay.yang for dhcpv6 servers
1 parent 1c73acc commit 3b00557

File tree

5 files changed

+160
-0
lines changed

5 files changed

+160
-0
lines changed

src/sonic-yang-models/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
'./yang-models/sonic-crm.yang',
5252
'./yang-models/sonic-device_metadata.yang',
5353
'./yang-models/sonic-device_neighbor.yang',
54+
'./yang-models/sonic-dhcpv6-relay.yang',
5455
'./yang-models/sonic-extension.yang',
5556
'./yang-models/sonic-flex_counter.yang',
5657
'./yang-models/sonic-feature.yang',

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,18 @@
11441144
"high_mem_alert": "disabled",
11451145
"state": "enabled"
11461146
}
1147+
},
1148+
"DHCP_RELAY": {
1149+
"Vlan111": {
1150+
"dhcpv6_servers": [
1151+
"2a04:5555:41::11"
1152+
]
1153+
},
1154+
"Vlan777": {
1155+
"dhcpv6_servers": [
1156+
"2a04:5555:41::11"
1157+
]
1158+
}
11471159
}
11481160
},
11491161

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"DHCPV6_SERVER_INCORRECT_FORMAT": {
3+
"desc": "Add dhcpv6_server which is not in correct ipv6-address format.",
4+
"eStrKey" : "Pattern"
5+
},
6+
"DHCPV6_SERVER_VALID_FORMAT": {
7+
"desc": "Add dhcpv6_server in correct format."
8+
}
9+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"DHCPV6_SERVER_INCORRECT_FORMAT": {
3+
"sonic-dhcpv6-relay:sonic-dhcpv6-relay": {
4+
"sonic-dhcpv6-relay:DHCP_RELAY": {
5+
"DHCP_RELAY_LIST": [
6+
{
7+
"dhcpv6_servers": [
8+
"2001:1:2"
9+
],
10+
"name": "Vlan500"
11+
}
12+
]
13+
}
14+
}
15+
},
16+
"DHCPV6_SERVER_VALID_FORMAT": {
17+
"sonic-port:sonic-port": {
18+
"sonic-port:PORT": {
19+
"PORT_LIST": [
20+
{
21+
"admin_status": "up",
22+
"alias": "eth0",
23+
"description": "Ethernet0",
24+
"mtu": 9000,
25+
"lanes": "1",
26+
"name": "Ethernet0",
27+
"speed": 25000
28+
}
29+
]
30+
}
31+
},
32+
"sonic-vlan:sonic-vlan": {
33+
"sonic-vlan:VLAN": {
34+
"VLAN_LIST": [
35+
{
36+
"admin_status": "up",
37+
"description": "v6server_vlan",
38+
"dhcpv6_servers": [
39+
"2001:1::2"
40+
],
41+
"mtu": "9216",
42+
"name": "Vlan400"
43+
}
44+
]
45+
},
46+
"sonic-vlan:VLAN_MEMBER": {
47+
"VLAN_MEMBER_LIST": [
48+
{
49+
"port": "Ethernet0",
50+
"tagging_mode": "tagged",
51+
"name": "Vlan400"
52+
}
53+
]
54+
},
55+
"sonic-vlan:VLAN_INTERFACE": {
56+
"VLAN_INTERFACE_IPPREFIX_LIST": [
57+
{
58+
"family": "IPv6",
59+
"ip-prefix": "2002::1/64",
60+
"scope": "global",
61+
"name": "Vlan400"
62+
}
63+
],
64+
"VLAN_INTERFACE_LIST": [
65+
{
66+
"name": "Vlan400"
67+
}
68+
]
69+
}
70+
},
71+
"sonic-dhcpv6-relay:sonic-dhcpv6-relay": {
72+
"sonic-dhcpv6-relay:DHCP_RELAY": {
73+
"DHCP_RELAY_LIST": [
74+
{
75+
"dhcpv6_servers": [
76+
"2001:1::2"
77+
],
78+
"name": "Vlan400"
79+
}
80+
]
81+
}
82+
}
83+
}
84+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
module sonic-dhcpv6-relay {
2+
3+
namespace "http://github.com/Azure/sonic-dhcpv6-relay";
4+
5+
prefix sdhcpv6relay;
6+
7+
yang-version 1.1;
8+
9+
import ietf-inet-types {
10+
prefix inet;
11+
}
12+
13+
import sonic-vlan {
14+
prefix vlan;
15+
}
16+
17+
organization "SONiC";
18+
19+
contact "SONiC";
20+
21+
description "DHCPv6 Relay yang Module for SONiC OS";
22+
23+
revision 2021-10-30 {
24+
description "First Revision";
25+
}
26+
27+
container sonic-dhcpv6-relay {
28+
29+
container DHCP_RELAY {
30+
31+
description "DHCP_RELAY part of config_db.json";
32+
33+
list DHCP_RELAY_LIST {
34+
35+
key "name";
36+
37+
leaf name {
38+
type leafref {
39+
path /vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name;
40+
}
41+
}
42+
43+
leaf-list dhcpv6_servers {
44+
description "Configure the dhcp v6 servers";
45+
type inet:ipv6-address;
46+
}
47+
}
48+
/* end of VLAN_LIST */
49+
}
50+
/* end of container DHCP_RELAY */
51+
}
52+
/* end of container sonic-dhcpv6-relay */
53+
}
54+
/* end of module sonic-dhcpv6-relay */

0 commit comments

Comments
 (0)