Skip to content

Commit

Permalink
Update dhcpv6-relay yang model (#14144)
Browse files Browse the repository at this point in the history
Why I did it
Add interface-id in dhcpv6-relay yang model

How I did it
Add interface-id option and corresponding UT. Updated configuration.md

How to verify it
kellyyeh@kellyyeh:~/sonic-buildimage/src/sonic-yang-models$ pyang -Vf tree -p /usr/local/share/yang/modules/ietf ./yang-models/sonic-dhcpv6-relay.yang
  • Loading branch information
kellyyeh authored Mar 15, 2023
1 parent d3e3565 commit 7d585dc
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 13 deletions.
19 changes: 18 additions & 1 deletion src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Table of Contents
* [Data Plane L3 Interfaces](#data-plane-l3-interfaces)
* [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER)
* [Device Metadata](#device-metadata)
* [Device neighbor metada](#device-neighbor-metada)
* [Device neighbor metada](#device-neighbor-metada)
* [DHCP_RELAY](#dhcp_relay)
* [DSCP_TO_TC_MAP](#dscp_to_tc_map)
* [FG_NHG](#fg_nhg)
* [FG_NHG_MEMBER](#fg_nhg_member)
Expand Down Expand Up @@ -894,6 +895,22 @@ instance is supported in SONiC.
```

### DHCP_RELAY

```
{
"DHCP_RELAY": {
"dhcpv6_servers": [
"fc02:2000::1",
"fc02:2000::2",
"fc02:2000::3",
"fc02:2000::4"
],
"rfc6939_support": "true",
"interface_id": "true"
}
```

### DSCP_TO_TC_MAP
```
Expand Down
6 changes: 4 additions & 2 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1814,13 +1814,15 @@
"dhcpv6_servers": [
"2a04:5555:41::11"
],
"rfc6939_support": "true"
"rfc6939_support": "true",
"interface_id": "true"
},
"Vlan777": {
"dhcpv6_servers": [
"2a04:5555:41::11"
],
"rfc6939_support": "true"
"rfc6939_support": "true",
"interface_id": "true"
}
},
"SCHEDULER": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
},
"DHCPV6_SERVER_VALID_FORMAT": {
"desc": "Add dhcpv6_server in correct format."
},
"DHCPv6_OPTION_WITH_INVALID_BOOLEAN_TYPE": {
"desc": "Add dhcpv6 option with invalid option boolean types.",
"eStrKey": "Pattern"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,25 @@
"2001:1::2"
],
"rfc6939_support": "true",

"name": "Vlan400",
"interface_id": "true",
"name": "Vlan400"
}
]
}
}
},
"DHCPv6_OPTION_WITH_INVALID_BOOLEAN_TYPE": {
"sonic-dhcpv6-relay:sonic-dhcpv6-relay": {
"sonic-dhcpv6-relay:DHCP_RELAY": {
"DHCP_RELAY_LIST": [
{
"name": "Vlan500",
"rfc6939_support": "False",
"interface_id": "False"
}
]
}
}
}
}
27 changes: 18 additions & 9 deletions src/sonic-yang-models/yang-models/sonic-dhcpv6-relay.yang
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,24 @@ module sonic-dhcpv6-relay {
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;
}
leaf-list dhcpv6_servers {
description "Configure the dhcp v6 servers";
type inet:ipv6-address;
}

leaf rfc6939_support {
description "Set rfc6939 for the relay";
type string {
pattern "false|true";
}
}

leaf interface_id {
description "Enable interface ID insertion in relayed messages";
type string {
pattern "false|true";
}
}
}
/* end of VLAN_LIST */
}
Expand Down

0 comments on commit 7d585dc

Please sign in to comment.