-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SONiC Yang model for DHCP-Relay parameters #8946
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a2b4009
SONiC Yang model for DHCP-Relay parameters
AkhileshSamineni 557cc73
Added test cases for dhcp-yang parameters.
AkhileshSamineni d466e17
Removed the fields which doesn't have backend support.
AkhileshSamineni b2c4f68
Removed unwanted sonic-types.
AkhileshSamineni 1c73acc
Corrected the test case.
AkhileshSamineni 3b00557
Added new dhcpv6-relay.yang for dhcpv6 servers
AkhileshSamineni 6885741
Merge branch 'master' into dhcp_relay_yang
AkhileshSamineni b025f5f
Removed leaf reference for VLAN
AkhileshSamineni 97b4896
Addded leaf 'rfc6939_support' to the dhcpv6-relay yang
AkhileshSamineni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"; | ||
type inet:ipv6-address; | ||
} | ||
|
||
leaf rfc6939_support { | ||
description "Set rfc6939 for the relay"; | ||
type boolean; | ||
} | ||
} | ||
/* end of VLAN_LIST */ | ||
} | ||
/* 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently store dhcpv6_servers in a separate table called DHCP_RELAY, and SONiC dhcp6relay fetches dhcpv6 server addresses from this table instead of VLAN. This is the draft sonic-dhcpv6-relay.yang
And config_db schema looks like this:
202106 version currently still uses ISC-DHCP which reads from VLAN table, so we need to have dhcpv6_servers in both VLAN and DHCP_RELAY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new 'dhcpv6-relay' yang file changes for DHCP_RELAY table.
@kellyyeh Seeing parsing issues with leaf "dhcpv6_option|rfc6939_support", as it has '|' character.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add it as just "rfc6939_support" please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, added leaf as 'rfc6939_support'.