Skip to content

Commit

Permalink
Fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqiangz committed Aug 17, 2023
1 parent 5a352cc commit 73238a4
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 20 deletions.
4 changes: 3 additions & 1 deletion src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,9 @@ IPV4 DHPC Server related configuration are defined in **DHCP_SERVER_IPV4**, **DH
},
"DHCP_SERVER_IPV4_PORT": {
"Vlan100|PortChannel0003": {
"ip": "100.1.1.10"
"ips": [
"100.1.1.10"
]
},
"Vlan100|PortChannel2": {
"ranges": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,28 @@
"eStrKey": "InvalidValue",
"eStr": ["type"]
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": {
"desc": "Add text type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS."
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_IPV4_ADDRESS": {
"desc": "Add ipv4-address type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS."
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT8": {
"desc": "Add uint8 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS."
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT16": {
"desc": "Add uint16 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS."
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT32": {
"desc": "Add uint32 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS."
},
"DHCP_SERVER_IPV4_RANGE_INVALID_END": {
"desc": "Configure wrong end ip of range.",
"eStrKey": "Pattern"
},
"DHCP_SERVER_IPV4_RANGE_RANGES_WITH_IP": {
"desc": "Configure both ip and ranges in DHCP_SERVER_IPV4_RANGE_RANGES",
"eStr": ["Statement of 'ip' and 'ranges' cannot both exist"]
"eStr": ["Statement of 'ips' and 'ranges' cannot both exist"]
},
"DHCP_SERVER_IPV4_GATEWAY_ABSENT": {
"desc": "Missing gateway in DHCP_SERVER_IPV4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,76 @@
}
}
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": {
"sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": {
"sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": {
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [
{
"name": "option60",
"id": 60,
"type": "text",
"value": "dummy_value"
}
]
}
}
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_IPV4_ADDRESS": {
"sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": {
"sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": {
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [
{
"name": "option60",
"id": 60,
"type": "ipv4-address",
"value": "dummy_value"
}
]
}
}
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT8": {
"sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": {
"sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": {
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [
{
"name": "option60",
"id": 60,
"type": "uint8",
"value": "dummy_value"
}
]
}
}
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT16": {
"sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": {
"sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": {
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [
{
"name": "option60",
"id": 60,
"type": "uint16",
"value": "dummy_value"
}
]
}
}
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT32": {
"sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": {
"sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": {
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [
{
"name": "option60",
"id": 60,
"type": "uint32",
"value": "dummy_value"
}
]
}
}
},
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_WRONG_VALUE": {
"sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": {
"sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": {
Expand Down
37 changes: 19 additions & 18 deletions src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ module sonic-dhcp-server-ipv4 {
prefix inet;
}

import sonic-types {
prefix stypes;
}

import sonic-vlan {
prefix vlan;
}
Expand Down Expand Up @@ -87,10 +91,7 @@ module sonic-dhcp-server-ipv4 {
leaf state {
description "State of DHCP server";
mandatory true;
type enumeration {
enum enabled;
enum disabled;
}
type stypes:admin_mode;
}
}
/* end of DHCP_SERVER_IPV4_LIST */
Expand Down Expand Up @@ -196,34 +197,34 @@ module sonic-dhcp-server-ipv4 {
leaf vlan {
description "Name of vlan";
type leafref {
path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name";
}
path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name";
}
}

leaf port {
description "Interface under vlan";
type union {
type leafref {
path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name";
}
type leafref {
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
}
}
}
type union {
type leafref {
path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name";
}
type leafref {
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
}
}
}

leaf-list ips {
description "Assigned IPs";
must "(not(boolean(../ranges)))"{
error-message "Statement of 'ip' and 'ranges' cannot both exist";
error-message "Statement of 'ips' and 'ranges' cannot both exist";
}
type inet:ipv4-address;
}

leaf-list ranges {
description "IP ranges";
must "(not(boolean(../ip)))"{
error-message "Statement of 'ip' and 'ranges' cannot both exist";
must "(not(boolean(../ips)))"{
error-message "Statement of 'ips' and 'ranges' cannot both exist";
}
type leafref {
path "/dhcp-server-ipv4:sonic-dhcp-server-ipv4/dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE/dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE_LIST/dhcp-server-ipv4:name";
Expand Down

0 comments on commit 73238a4

Please sign in to comment.