-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yang]: SONiC Yang model for DHCP-Relay parameters (#8946)
SONiC Yang model for DHCP-Relay parameters What I did Added DHCPv6 Servers. Tables: VLAN, DHCP_RELAY. How I did it Defined Yang model for Relay based on Guideline doc: https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md How to verify it Added test cases to verify it. Signed-off-by: Akhilesh Samineni [email protected]
- Loading branch information
1 parent
fed19e3
commit 2c801ef
Showing
8 changed files
with
314 additions
and
1 deletion.
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
9 changes: 9 additions & 0 deletions
9
src/sonic-yang-models/tests/yang_model_tests/tests/dhcpv6_relay.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,9 @@ | ||
{ | ||
"DHCPV6_SERVER_INCORRECT_FORMAT": { | ||
"desc": "Add dhcpv6_server which is not in correct ipv6-address format.", | ||
"eStrKey" : "Pattern" | ||
}, | ||
"DHCPV6_SERVER_VALID_FORMAT": { | ||
"desc": "Add dhcpv6_server in correct format." | ||
} | ||
} |
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
86 changes: 86 additions & 0 deletions
86
src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcpv6_relay.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,86 @@ | ||
{ | ||
"DHCPV6_SERVER_INCORRECT_FORMAT": { | ||
"sonic-dhcpv6-relay:sonic-dhcpv6-relay": { | ||
"sonic-dhcpv6-relay:DHCP_RELAY": { | ||
"DHCP_RELAY_LIST": [ | ||
{ | ||
"dhcpv6_servers": [ | ||
"2001:1:2" | ||
], | ||
"name": "Vlan500" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"DHCPV6_SERVER_VALID_FORMAT": { | ||
"sonic-port:sonic-port": { | ||
"sonic-port:PORT": { | ||
"PORT_LIST": [ | ||
{ | ||
"admin_status": "up", | ||
"alias": "eth0", | ||
"description": "Ethernet0", | ||
"mtu": 9000, | ||
"lanes": "1", | ||
"name": "Ethernet0", | ||
"speed": 25000 | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-vlan:sonic-vlan": { | ||
"sonic-vlan:VLAN": { | ||
"VLAN_LIST": [ | ||
{ | ||
"admin_status": "up", | ||
"description": "v6server_vlan", | ||
"dhcpv6_servers": [ | ||
"2001:1::2" | ||
], | ||
"mtu": "9216", | ||
"name": "Vlan400" | ||
} | ||
] | ||
}, | ||
"sonic-vlan:VLAN_MEMBER": { | ||
"VLAN_MEMBER_LIST": [ | ||
{ | ||
"port": "Ethernet0", | ||
"tagging_mode": "tagged", | ||
"name": "Vlan400" | ||
} | ||
] | ||
}, | ||
"sonic-vlan:VLAN_INTERFACE": { | ||
"VLAN_INTERFACE_IPPREFIX_LIST": [ | ||
{ | ||
"family": "IPv6", | ||
"ip-prefix": "2002::1/64", | ||
"scope": "global", | ||
"name": "Vlan400" | ||
} | ||
], | ||
"VLAN_INTERFACE_LIST": [ | ||
{ | ||
"name": "Vlan400" | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-dhcpv6-relay:sonic-dhcpv6-relay": { | ||
"sonic-dhcpv6-relay:DHCP_RELAY": { | ||
"DHCP_RELAY_LIST": [ | ||
{ | ||
"dhcpv6_servers": [ | ||
"2001:1::2" | ||
], | ||
"rfc6939_support": "true", | ||
|
||
"name": "Vlan400" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
module sonic-dhcpv6-relay { | ||
|
||
namespace "http://github.com/Azure/sonic-dhcpv6-relay"; | ||
|
||
prefix sdhcpv6relay; | ||
|
||
yang-version 1.1; | ||
|
||
import ietf-inet-types { | ||
prefix inet; | ||
} | ||
|
||
organization "SONiC"; | ||
|
||
contact "SONiC"; | ||
|
||
description "DHCPv6 Relay yang Module for SONiC OS"; | ||
|
||
revision 2021-10-30 { | ||
description "First Revision"; | ||
} | ||
|
||
container sonic-dhcpv6-relay { | ||
|
||
container DHCP_RELAY { | ||
|
||
description "DHCP_RELAY part of config_db.json"; | ||
|
||
list DHCP_RELAY_LIST { | ||
|
||
key "name"; | ||
|
||
leaf name { | ||
type string; | ||
} | ||
|
||
leaf-list dhcpv6_servers { | ||
description "Configure the dhcp v6 servers"; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
type inet:ipv6-address; | ||
} | ||
|
||
leaf rfc6939_support { | ||
description "Set rfc6939 for the relay"; | ||
type boolean; | ||
} | ||
} | ||
/* end of VLAN_LIST */ | ||
This comment has been minimized.
Sorry, something went wrong. |
||
} | ||
/* end of container DHCP_RELAY */ | ||
} | ||
/* end of container sonic-dhcpv6-relay */ | ||
} | ||
/* end of module sonic-dhcpv6-relay */ |
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
TAB and SPACE is broken here.