Dynamic Host Configuration Protocol.
Version: 2020-04-10
module huawei-dhcp { yang-version 1; namespace "urn:huawei:yang:huawei-dhcp"; prefix dhcp; import huawei-ifm { prefix ifm; } import huawei-vlan { prefix vlan; } import huawei-bd { prefix bd; } import huawei-extension { prefix ext; } import huawei-pub-type { prefix pub-type; } import ietf-inet-types { prefix inet; } import ietf-yang-types { prefix yang; } import huawei-ethernet { prefix ethernet; } include huawei-dhcp-relay; include huawei-dhcp-server; include huawei-dhcp-snooping; include huawei-dhcp-client; organization "Huawei Technologies Co., Ltd."; contact "Huawei Industrial Base Bantian, Longgang Shenzhen 518129 People's Republic of China Website: http://www.huawei.com Email: support@huawei.com"; description "Dynamic Host Configuration Protocol."; revision "2020-04-10" { description "Add session-car."; reference "Huawei private."; } revision "2020-03-03" { description "Initial revision."; reference "Huawei private."; } ext:task-name "dhcp"; typedef option82-sub-option-type { type enumeration { enum "circuit-id" { value 1; description "DHCP option82 sub-option circuit-ID."; } enum "remote-id" { value 2; description "DHCP option82 sub-option remote-ID."; } enum "circuit-remote" { value 3; description "DHCP option82 sub-option circuit-ID and sub-option remote-ID."; } } description "The type of option82 sub-option."; } typedef option82-format { type enumeration { enum "common" { value 1; description "DHCP option82 common format."; } enum "extend" { value 2; description "DHCP option82 extend format."; } enum "user-defined" { value 3; description "DHCP option82 user-defined format."; } enum "default" { value 4; description "DHCP option82 default format."; } enum "type1" { value 5; description "DHCP option82 type1 format."; } enum "type2" { value 6; description "DHCP option82 type2 format."; } enum "self-define" { value 7; description "DHCP option82 self-define format."; } enum "default-extra" { value 8; description "DHCP option82 extra default format."; } enum "cn-telecom" { value 9; description "DHCP option82 cn-telecom format."; } enum "self-define-extra" { value 10; description "DHCP option82 extra self-define format."; } enum "intracom-vxlan" { value 11; description "DHCP option82 Intracom-VXLAN format."; } enum "cn-telecom-inherit" { value 12; description "DHCP option82 cn-telecom-inherit format."; } } description "The type of DHCP option82 format."; } typedef server-enable-state { type enumeration { enum "enable" { value 1; description "Enable the function of DHCP server on an interface."; } enum "disable" { value 2; description "Disable the function of DHCP server on an interface."; } } description "The state of DHCP server flag."; } typedef recycle-address-state { type enumeration { enum "used" { value 1; description "The IP address is in use."; } enum "conflicted" { value 2; description "The IP address is in conflict state."; } } description "Status of the DHCP address pool."; } container dhcp { description "Configure Dynamic Host Configuration Protocol."; container common { description "Configure basic DHCP."; container global { description "Configure globally configured attributes."; leaf enable { type boolean; default "false"; description "Enable/disable DHCP globally."; } leaf ignore-hostname { type boolean; default "false"; description "Enable/disable DHCP ignore hostname."; } leaf rate-limit-enable { type boolean; default "true"; description "Enable/disable DHCP packets rate limit."; } leaf rate-limit { type uint32 { range "1..4000"; } units "pps"; default "800"; description "DHCP packets rate limit value."; } leaf aging-time { type uint32 { range "1..1440"; } units "min"; default "30"; description "DHCP session CAR aging time."; } } // container global container session-car { must "pir-value >= cir-value and pbs-value >= cbs-value"; description "Configure session CAR."; leaf enable { type boolean; default "true"; description "Enable/disable session CAR."; } leaf cir-value { type uint32 { range "0..1000000"; } units "kbit/s"; default "512"; description "Specify the session CAR CIR value."; } leaf cbs-value { type uint32 { range "0..9000000"; } units "Byte"; default "64000"; description "Specify the session CAR CBS value."; } leaf pir-value { type uint32 { range "0..1000000"; } units "kbit/s"; default "1200"; description "Specify the session CAR PIR value."; } leaf pbs-value { type uint32 { range "0..9000000"; } units "Byte"; default "150000"; description "Specify the session CAR PBS value."; } } // container session-car container chasten { description "Configure DHCP user connection throttling."; leaf enable { type boolean; default "false"; description "Enable/disable DHCP user connection throttling."; } leaf request-packets { type uint32 { range "1..10000"; } default "10"; description "Request packets."; } leaf check-period { type uint32 { range "1..3600"; } units "s"; default "180"; description "Check period."; } leaf restrain-period { type uint32 { range "1..3600"; } units "s"; default "300"; description "Restrain period."; } } // container chasten container global-packet-statistics { config false; description "Statistics of DHCP global packets."; leaf total-packets-receive { type uint32; description "Total received count of packets."; } leaf discarded-packets-receive { type uint32; description "Total discarded count of received packets."; } leaf bootp-request-packets-receive { type uint32; description "Count of received bootp request packets."; } leaf bootp-reply-packets-receive { type uint32; description "Count of received bootp reply packets."; } leaf discover-packets-receive { type uint32; description "Count of received DHCP discover packets."; } leaf offer-packets-receive { type uint32; description "Count of received DHCP offer packets."; } leaf request-packets-receive { type uint32; description "Count of received DHCP request packets."; } leaf ack-packets-receive { type uint32; description "Count of received DHCP ACK packets."; } leaf release-packets-receive { type uint32; description "Count of received DHCP release packets."; } leaf nak-packets-receive { type uint32; description "Count of received DHCP NAK packets."; } leaf decline-packets-receive { type uint32; description "Count of received DHCP decline packets."; } leaf inform-packets-receive { type uint32; description "Count of received DHCP inform packets."; } leaf total-packets-send { type uint32; description "Total sent count of packets."; } leaf total-discarded-packets { type uint32; description "Total discarded count of sent packets."; } } // container global-packet-statistics } // container common container relay { description "Configure DHCP relay."; container global { description "Configure DHCP relay global attributes."; leaf user-detect-interval { type uint16 { range "0..60"; } units "min"; default "20"; description "DHCP relay ARP user-detect interval."; } leaf user-autosave-flag { type boolean; default "false"; description "Enable/disable a DHCP relay agent to store user entries."; } leaf user-store-interval { type uint32 { range "300..86400"; } units "s"; default "300"; description "DHCP relay unnumbered table write-delay."; } leaf distribute-flag { type boolean; default "false"; description "Enable/disable DHCP relay distribute flag."; } leaf opt82-inner-vlan-insert-flag { type boolean; default "false"; description "Enable/disable DHCP option82 inner-VLAN change flag."; } container option { description "Configure the information instance of DHCP packet option code."; leaf option-code { type uint8 { range "1..255"; } description "Option code."; } leaf sub-option { when "../option-code"; type uint8 { range "1..255"; } description "Sub-option code."; } } // container option container source-ip { description "Configure DHCP relay global source IP attributes."; leaf source-ip-address { type inet:ipv4-address-no-zone; description "Relay source address."; } leaf vpn-name { when "../source-ip-address"; type leafref { path "/ni:network-instance/ni:instances/ni:instance/ni:name"; } must "/ni:network-instance/ni:instances/ni:instance[ni:name=current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']"; default "_public_"; description "VPN name."; } } // container source-ip container route-isolation-vpns { config false; description "List of statistics of route isolation VPN instances."; list route-isolation-vpn { key "source-address vpn-name"; description "Statistics of a route isolation VPN instance."; leaf source-address { type inet:ipv4-address-no-zone; description "Route isolation VPN instance source address."; } leaf vpn-name { type leafref { path "/ni:network-instance/ni:instances/ni:instance/ni:name"; } must "/ni:network-instance/ni:instances/ni:instance[ni:name=current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']"; description "Route isolation VPN instance VRF name."; } leaf if-name { type leafref { path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name"; } description "Route isolation VPN instance interface name."; } } // list route-isolation-vpn } // container route-isolation-vpns container relay-packet-statistics { config false; description "Statistics of DHCP relay."; leaf packets-receive-from-client { type uint32; description "Number of packets received from clients."; } leaf discover-packets-receive { type uint32; description "Number of discover packets received."; } leaf request-packets-receive { type uint32; description "Number of request packets received."; } leaf release-packets-receive { type uint32; description "Number of release packets received."; } leaf inform-packets-receive { type uint32; description "Number of inform packets received."; } leaf decline-packets-receive { type uint32; description "Number of decline packets received."; } leaf init-request-packets-receive { type uint32; description "Number of init request packets received."; } leaf select-request-packets-receive { type uint32; description "Number of select request packets received."; } leaf renew-request-packets-receive { type uint32; description "Number of renew request packets received."; } leaf rebind-request-packets-receive { type uint32; description "Number of rebind request packets received."; } leaf packets-sent-to-clients { type uint32; description "Number of packets sent to clients."; } leaf unicast-packets-sent-to-clients { type uint32; description "Number of unicast packets sent to clients."; } leaf broadcast-packets-sent-to-clients { type uint32; description "Number of broadcast packets sent to clients."; } leaf offer-packets-sent-to-clients { type uint32; description "Number of offer packets sent to clients."; } leaf ack-packets-sent-to-clients { type uint32; description "Number of ACK packets sent to clients."; } leaf nak-packets-sent-to-clients { type uint32; description "Number of NAK packets sent to clients."; } leaf packets-receive-from-servers { type uint32; description "Number of packets received from servers."; } leaf offer-packets-receive { type uint32; description "Number of offer packets received."; } leaf ack-packets-receive { type uint32; description "Number of ACK packets received."; } leaf nak-packets-receive { type uint32; description "Number of NAK packets received."; } leaf packets-sent-to-servers { type uint32; description "Number of packets sent to servers."; } leaf discover-packets-sent { type uint32; description "Number of discover packets sent."; } leaf request-packets-sent { type uint32; description "Number of request packets sent."; } leaf release-packets-sent { type uint32; description "Number of release packets sent."; } leaf inform-packets-sent { type uint32; description "Number of inform packets sent."; } leaf decline-packets-sent { type uint32; description "Number of decline packets sent."; } leaf init-request-packets-sent { type uint32; description "Number of init request packets sent."; } leaf select-request-packets-sent { type uint32; description "Number of select request packets sent."; } leaf renew-request-packets-sent { type uint32; description "Number of renew request packets sent."; } leaf rebind-request-packets-sent { type uint32; description "Number of rebind request packets sent."; } leaf bad-packets-receive { type uint32; description "Number of error packets received."; } leaf release-packets-sent-to-servers { type uint32; description "Number of release packets sent to servers."; } } // container relay-packet-statistics } // container global } // container relay container server { description "Configure DHCP server."; container common { description "Configure DHCP server common attributes."; leaf ping-packet-nub { type uint32 { range "0..10"; } units "pps"; default "2"; description "Number of ping packets."; } leaf ping-packet-timeout { type uint32 { range "0..10000"; } units "ms"; default "500"; description "Timeout interval of ping reply."; } leaf database-enable { type boolean; default "false"; description "Enable/disable database."; } leaf database-recover { type boolean; default "false"; description "Enable/disable database recover."; } leaf write-delay-interval { type uint32 { range "300..86400"; } units "s"; default "300"; description "Write delay interval, in the range of 300 to 86400, in seconds."; } leaf option60-enable { type boolean; default "false"; description "Enable/disable to allocate IP address by option60."; } leaf dest-ip-enable { type boolean; default "false"; description "Enable/disable to use destination IP address of the request packet as server identifier option."; } leaf lease-items-path { type string { length "1..64"; } config false; description "Lease items path."; } leaf conflict-items-path { type string { length "1..64"; } config false; description "Conflict items path."; } leaf link-selection-enable { type boolean; default "false"; description "Enable/disable DHCP server to assign IP addresses based on the link-selection value in option82."; } leaf server-id-override-enable { type boolean; default "false"; description "Enable/disable DHCP server to encapsulate option54 into packet based on the server-id-override value in option82."; } leaf request-packet-all-interface-enable { type boolean; default "false"; description "Enable/disable the function of DHCP server on all interfaces."; } leaf file-authentication-mode { type server-file-authentication-mode; default "check"; description "Set file authentication mode."; } } // container common container global-ip-pools { description "List of global ip pools."; list global-ip-pool { key "ip-pool-name"; description "Configure a global ip pool."; leaf ip-pool-name { ext:case-sensitivity "upper2lower"; type string { length "1..128"; } description "Pool name."; } leaf vpn-instance { type leafref { path "/ni:network-instance/ni:instances/ni:instance/ni:name"; } must "/ni:network-instance/ni:instances/ni:instance[ni:name=current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']"; default "_public_"; description "VPN instance."; } leaf locked-flag { type boolean; default "false"; description "Enable/disable to lock."; } leaf option-router-disable { type boolean; default "false"; description "Enable/disable reply router option."; } leaf client-option60-string { type string { length "1..255"; } description "The value of client option60 in the pool."; } leaf warning-exhaust-enable { type boolean; default "false"; description "Enable/disable the warning-exhaust of the pool."; } leaf warning-threshold { type uint8 { range "0..100"; } default "80"; description "The warning threshold of the pool."; } leaf domain-name { type string { length "1..63"; } description "Configure a DNS domain name assigned to a DHCP client."; } leaf network-bios-type { type network-bios-type; description "NetBIOS type."; } leaf reply-packet-policy { type reply-type; description "Reply packets policy."; } leaf profile-name { type string { length "1..128"; } description "Remote backup profile."; } leaf identifier-ip { type inet:ipv4-address-no-zone; description "Server identify IP."; } container gateway { must "../gateway or (not(../gateway) and not(../sections))"; must "(../gateway/ip-address and ../gateway/mask) or (not(../gateway/ip-address) and not(../gateway/mask))"; description "Configure the gateway information of the pool."; leaf ip-address { type inet:ipv4-address-no-zone; description "The gateway address of the pool."; } leaf mask { type inet:ipv4-address-no-zone; description "The gateway mask of the pool."; } } // container gateway container conflict-recycle { description "Configure the conflict address auto recycle."; leaf auto-recycle-enable { type boolean; default "true"; description "Enable/disable auto recycle of the conflict address."; } leaf conflict-recycle-interval { when "../auto-recycle-enable='true'"; type uint16 { range "30..1440"; } units "min"; default "30"; description "The interval of the conflict address auto recycle."; } } // container conflict-recycle container lease-time { must "(day=0 and hour=0 and minute=0) or (not (../rebind-time/day)) or (day>../rebind-time/day) or (day=../rebind-time/day and hour>../rebind-time/hour) or (day=../rebind-time/day and hour=../rebind-time/hour and minute>../rebind-time/minute)"; description "Configure lease time."; leaf day { type uint16 { range "0..999"; } units "d"; default "3"; description "The lease time day."; } leaf hour { type uint16 { range "0..23"; } units "h"; default "0"; description "The lease time hour."; } leaf minute { type uint16 { range "0..59"; } units "min"; default "0"; description "The lease time minute."; } } // container lease-time container rebind-time { must "(day=0 and hour=0 and minute=0) or (../renew-time/day=0 and ../renew-time/hour=0 and ../renew-time/minute=0) or (day>../renew-time/day) or (day=../renew-time/day and hour>../renew-time/hour) or (day=../renew-time/day and hour=../renew-time/hour and minute>../renew-time/minute)"; must "(../lease-time/day=0 and ../lease-time/hour=0 and ../lease-time/minute=0) or (day<../lease-time/day) or (day=../lease-time/day and hour<../lease-time/hour) or (day=../lease-time/day and hour=../lease-time/hour and minute<../lease-time/minute)"; description "Configure the rebind time of the pool."; leaf day { type uint16 { range "0..999"; } units "d"; default "0"; description "The rebinding time day."; } leaf hour { type uint8 { range "0..23"; } units "h"; default "0"; description "The rebinding time hour."; } leaf minute { type uint8 { range "0..59"; } units "min"; default "0"; description "The rebinding time minute."; } } // container rebind-time container renew-time { must "(day=0 and hour=0 and minute=0) or (../rebind-time/day=0 and ../rebind-time/hour=0 and ../rebind-time/minute=0) or (day < ../rebind-time/day) or (day = ../rebind-time/day and hour < ../rebind-time/hour) or (day = ../rebind-time/day and hour = ../rebind-time/hour and minute < ../rebind-time/minute)"; must "(../lease-time/day=0 and ../lease-time/hour=0 and ../lease-time/minute=0) or (day<../lease-time/day) or (day=../lease-time/day and hour<../lease-time/hour) or (day=../lease-time/day and hour=../lease-time/hour and minute<../lease-time/minute)"; description "Configure the renew time of the pool."; leaf day { type uint16 { range "0..999"; } units "d"; default "0"; description "The renew time day."; } leaf hour { type uint8 { range "0..23"; } units "h"; default "0"; description "The renew time hour."; } leaf minute { type uint8 { range "0..59"; } units "min"; default "0"; description "The renew time minute."; } } // container renew-time container option125 { description "Configure an option125 of the pool."; leaf enterprise-code { when "../option-string"; type uint32 { range "0..4294967295"; } default "2011"; description "The enterprise information option code."; } leaf option-string { type string { length "1..32"; } description "The enterprise information option value."; } } // container option125 container sip-server { description "Configure the SIP server of the pool."; leaf sip-server-mode { type sip-mode; must "((../sip-server-mode = 'ip-mode') and (../sip-server-ip1)) or ((../sip-server-mode = 'list-mode') and (../sip-server-name1)) or (not(../sip-server-mode))"; description "The mode of SIP server."; } choice sip-server-format { description "The format of SIP server."; case ip-format { description "The IP of SIP server."; leaf sip-server-ip1 { when "../sip-server-mode='ip-mode'"; type inet:ipv4-address-no-zone; mandatory true; description "The first IP of SIP server."; } leaf sip-server-ip2 { when "../sip-server-mode='ip-mode'"; type inet:ipv4-address-no-zone; description "The second IP of SIP server."; } } // case ip-format case string-format { description "The name of SIP server."; leaf sip-server-name1 { when "../sip-server-mode='list-mode'"; type string { length "1..63"; } mandatory true; description "The first name of SIP server."; } leaf sip-server-name2 { when "../sip-server-mode='list-mode'"; type string { length "1..63"; } description "The second name of SIP server."; } } // case string-format } // choice sip-server-format } // container sip-server container sections { description "List of the sections of the pool."; list section { must "(../../gateway and ../section) or (not(../section))"; key "section-index"; max-elements 256; description "Configure the section of the pool."; leaf section-index { type uint32 { range "0..255"; } description "The section index."; } leaf start-ip { type inet:ipv4-address-no-zone; mandatory true; description "The start IP address of the section."; } leaf end-ip { type inet:ipv4-address-no-zone; mandatory true; description "The end IP address of the section."; } } // list section } // container sections container dns-lists { description "List of DNS IPs."; list dns-list { key "dns-ip"; max-elements 8; description "Configure a DNS IP instance."; leaf dns-ip { type inet:ipv4-address-no-zone; description "DNS IP."; } } // list dns-list } // container dns-lists container network-bios-ip-addresses { description "List of NetBIOS IPs."; list network-bios-ip-address { key "network-bios-ip"; max-elements 8; description "Configure a NetBIOS IP instance."; leaf network-bios-ip { type inet:ipv4-address-no-zone; description "NetBIOS IP address."; } } // list network-bios-ip-address } // container network-bios-ip-addresses container excluded-ip-addresses { description "List of excluded IP addresses."; list excluded-ip-address { key "start-ip-address end-ip-address"; description "Configure an excluded IP instance."; leaf start-ip-address { type inet:ipv4-address-no-zone; description "Excluded start IP address."; } leaf end-ip-address { type inet:ipv4-address-no-zone; description "Excluded end IP address."; } } // list excluded-ip-address } // container excluded-ip-addresses container static-binds { description "List of static bind IPs."; list static-bind { key "static-bind-ip"; unique "static-bind-mac"; max-elements 4096; description "Configure a static bind IP instance."; leaf static-bind-ip { type inet:ipv4-address-no-zone; description "Specify the IP address to be bound."; } leaf static-bind-mac { type pub-type:mac-address { length "0..255"; } mandatory true; description "Specify the user MAC address."; } } // list static-bind } // container static-binds container client-options { description "List of the specified client options of the pool."; list client-option { key "option-code cilent-string reply-code"; unique "cilent-string"; max-elements 16; description "Configure the specified client option of the pool."; leaf option-code { type uint8 { range "60"; } description "The client option code."; } leaf cilent-string { type string { length "3..66"; } description "The client option value, the field must begin and end with double quotation marks."; } leaf reply-code { type uint8 { range "2 | 4..5 | 7..14 | 16..43 | 45 | 47..49 | 56 | 60 | 62..81 | 83..118 | 120..254"; } description "The specified reply option code."; } container client-sub-options { description "List of specified reply suboptions."; list client-sub-option { key "sub-option-code"; min-elements 1; max-elements 16; description "Configure the specified reply suboption."; leaf sub-option-code { type uint32 { range "1..254"; } description "The specified reply suboption code."; } choice option-format { mandatory true; description "The format of server suboption."; case sub-ip-format { description "IP format."; leaf sub-option-ip { type inet:ipv4-address-no-zone; description "Suboption IP."; } } // case sub-ip-format case sub-ascii-format { description "ASCII string format."; leaf ascii-string { type string { length "1..128"; } description "ASCII string."; } } // case sub-ascii-format case sub-hex-format { description "Hex string format."; leaf hex-string { type string { length "2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 44 | 46 | 48 | 50 | 52 | 54 | 56 | 58 | 60 | 62 | 64 | 66 | 68 | 70 | 72 | 74 | 76 | 78 | 80 | 82 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100 | 102 | 104 | 106 | 108 | 110 | 112 | 114 | 116 | 118 | 120 | 122 | 124 | 126 | 128"; } description "Hex string."; } } // case sub-hex-format } // choice option-format } // list client-sub-option } // container client-sub-options } // list client-option } // container client-options container option121s { description "List of the option121 attributes."; list option121 { key "destination-ip mask gateway"; max-elements 8; description "Configure the option121 attributes."; leaf destination-ip { type inet:ipv4-address-no-zone; description "Destination IP address."; } leaf mask { type uint32 { range "0..32"; } description "IP mask."; } leaf gateway { type inet:ipv4-address-no-zone; description "Gateway address."; } } // list option121 } // container option121s container option33s { description "List of the option33 attributes."; list option33 { key "destination-ip gateway"; max-elements 8; description "Configure the option33 attributes."; leaf destination-ip { type inet:ipv4-address-no-zone; description "Destionnation IP address."; } leaf gateway { type inet:ipv4-address-no-zone; description "Gateway IP address."; } } // list option33 } // container option33s container domain-lists { description "List of the domain lists of the pool."; list domain-list { key "domain-name"; max-elements 4; description "Configure the domain list of the pool."; leaf domain-name { type string { length "1..32"; } description "Domain name."; } } // list domain-list } // container domain-lists container user-options { description "List of configuring the user define options of the pool."; list user-option { key "option-code"; max-elements 16; description "Configure a user define option of the pool."; leaf option-code { type uint32 { range "2 | 4..5 | 7..14 | 16..43 | 45 | 47..49 | 56 | 60 | 62..81 | 83..118 | 120..254"; } description "The user define option code."; } choice option-format { mandatory true; description "The format of server option."; case ip-format { description "IP format."; leaf option-ip1 { type inet:ipv4-address-no-zone; description "The first IP of option."; } leaf option-ip2 { type inet:ipv4-address-no-zone; must "../option-ip1"; description "The second IP of option."; } } // case ip-format case ascii-format { description "ASCII string format."; leaf ascii-string { type string { length "1..255"; } description "The ASCII string of the option."; } } // case ascii-format case hex-format { description "Hex string format."; leaf hex-string { type string { length "2..479"; pattern '([0-9A-F]{2}( [0-9A-F]{2}){0,159})'; } description "Hex string."; } } // case hex-format case cipher-format { description "Cipher string format."; leaf cipher-string { type pub-type:password-extend { length "1..432"; } description "The cipher string of the option."; } } // case cipher-format case sub-option-format { description "Suboptions format."; container sub-user-options { description "List of the user define suboptions."; list sub-user-option { key "sub-option-code"; max-elements 16; description "Configure the user define suboption."; leaf sub-option-code { type uint32 { range "1..254"; } description "The user define suboption code."; } choice option-format { mandatory true; description "The format of server suboption."; case sub-ip-format { description "IP format."; leaf sub-option-ip { type inet:ipv4-address-no-zone; description "The IP address."; } } // case sub-ip-format case sub-ascii-format { description "ASCII string format."; leaf ascii-string { type string { length "1..64"; } description "ASCII string."; } } // case sub-ascii-format } // choice option-format } // list sub-user-option } // container sub-user-options } // case sub-option-format } // choice option-format } // list user-option } // container user-options container option-force-replys { description "List of the force reply options of the pool."; list option-force-reply { key "option-code"; max-elements 16; description "Configure the force reply option of the pool."; leaf option-code { type uint8 { range "2..254"; } description "The force reply option code."; } } // list option-force-reply } // container option-force-replys container ip-pool-usage { config false; description "Statistics of the usage of the pool."; leaf pool-length { type uint32; description "The length of the pool."; } leaf used-ip-count { type uint32; description "The count of used IP address."; } leaf ratio { type uint32; description "The ratio of the used IP address."; } leaf last-time { type yang:date-and-time; description "The last time of allocating IP address."; } } // container ip-pool-usage container ip-pool-max-usage { config false; description "Statistics of the maximum use of IP pool in history."; leaf pool-length { type uint32; description "The length of the pool."; } leaf used-ip-count { type uint32; description "The count of used IP address."; } leaf last-time { type yang:date-and-time; description "The last time of allocating IP address."; } } // container ip-pool-max-usage } // list global-ip-pool } // container global-ip-pools } // container server container snooping { description "Configure DHCP snooping."; container global { must "(not (user-bind-auto-save-enable='true') and not (user-bind-file-name)) or (user-bind-auto-save-enable='true' and user-bind-file-name)"; description "Configure global attributes of DHCP snooping."; leaf enable { type boolean; default "false"; description "Enable/disable DHCP snooping globally."; } leaf server-detect-enable { when "../enable='true'"; type boolean; default "false"; description "Enable/disable the check on bogus DHCP servers."; } leaf user-bind-auto-save-enable { when "../enable='true'"; type boolean; default "false"; description "Enable/disable automatic saving of DHCP snooping binding entries."; } leaf user-bind-file-name { when "../enable='true' and ../user-bind-auto-save-enable='true'"; type string { length "1..56"; pattern '(\S+:\S+\.tbl)'; } description "File name of saving the snooping binding table."; } leaf alarm-threshold { when "../enable='true'"; type uint16 { range "1..1000"; } default "100"; description "Global alarm threshold for DHCP packets."; } leaf arp-detect-enable { type boolean; default "false"; description "Enable/disable ARP detection for DHCP users based on DHCP snooping binding entries."; } leaf mac-strict-check-enable { when "../enable='true'"; type boolean; default "false"; description "Enable/disable MAC strict check."; } leaf unicast-cpu-forward-disable { when "../enable='true'"; type boolean; default "false"; description "Enable/disable CPU forwarding for DHCP snooping unicast packets."; } leaf file-authentication-mode { when "../enable='true'"; type snooping-file-authentication-mode; default "check"; description "Set file authentication mode."; } } // container global container white-lists { description "List of whitelists."; list white-list { key "white-list-name"; max-elements 8; description "Configure a whitelist."; leaf white-list-name { type string { length "1..31"; } description "Whitelist name."; } leaf apply-flag { type boolean; default "false"; description "Enable/disable to determine whether to use whitelists."; } container white-rules { description "List of whitelist rules."; list white-rule { must "(source-ip and source-mask and destination-address and destination-mask) or (not (source-ip) and not (source-mask) and destination-address and destination-mask) or (source-ip and source-mask and not (destination-address) and not (destination-mask))"; key "rule-id"; unique "source-ip source-mask destination-address destination-mask source-port destination-port"; max-elements 1023; description "Configure a whitelist rule."; leaf rule-id { type uint16 { range "1..1023"; } description "Whitelist rule ID."; } leaf source-ip { type inet:ipv4-address-no-zone; description "Source address."; } leaf source-mask { type inet:ipv4-address-no-zone; description "Source address mask."; } leaf destination-address { type inet:ipv4-address-no-zone; description "Destination address."; } leaf destination-mask { type inet:ipv4-address-no-zone; description "Destination address mask."; } leaf source-port { type dhcp-snooping-port; description "Source port."; } leaf destination-port { type dhcp-snooping-port; description "Destination port."; } } // list white-rule } // container white-rules } // list white-list } // container white-lists } // container snooping container client { description "Configure DHCP client."; container global { description "Configure DHCP client global attributes."; leaf option60 { type string { length "1..128"; pattern '([^\t]{1,})'; } description "The value of DHCP client global option60."; } leaf unicast-flag { type empty; description "DHCP client unicast flag."; } } // container global } // container client } // container dhcp rpc reset-address-state { ext:node-ref "/dhcp:dhcp/dhcp:server/dhcp:global-ip-pools/dhcp:global-ip-pool"; description "Reset address state."; input { leaf pool-name { type leafref { path "/dhcp:dhcp/dhcp:server/dhcp:global-ip-pools/dhcp:global-ip-pool/dhcp:ip-pool-name"; } mandatory true; description "Pool name."; } leaf start-ip-address { type inet:ipv4-address-no-zone; mandatory true; description "Start IP address."; } leaf end-ip-address { type inet:ipv4-address-no-zone; description "End IP address."; } leaf reset-flag { type recycle-address-state; mandatory true; description "Address Status."; } } } // rpc reset-address-state rpc reset-pool-maxusage { ext:node-ref "/dhcp:dhcp/dhcp:server/dhcp:global-ip-pools/dhcp:global-ip-pool/dhcp:ip-pool-max-usage"; description "Reset pool maxusage."; input { leaf pool-name { type leafref { path "/dhcp:dhcp/dhcp:server/dhcp:global-ip-pools/dhcp:global-ip-pool/dhcp:ip-pool-name"; } description "Pool name."; } } } // rpc reset-pool-maxusage rpc reset-client-ip { ext:node-ref "/dhcp:dhcp/dhcp:client"; description "The DHCP client releases the IP address."; input { leaf if-name { type leafref { path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name"; } description "Interface name."; } } } // rpc reset-client-ip rpc reset-if-dynamic-bind-table { ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/dhcp:dhcp-snooping-if"; description "Reset the dynamic binding table on an interface."; input { leaf if-name { type leafref { path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name"; } mandatory true; description "Interface name."; } leaf ip-address { type inet:ipv4-address-no-zone; mandatory true; description "IP address."; } leaf mac-address { type pub-type:mac-address; description "MAC address."; } leaf vlan-id { type uint16 { range "1..4094"; } description "VLAN ID."; } leaf cevlan-id { type uint16 { range "1..4094"; } description "CE VLAN ID."; } leaf lease-day { type uint16 { range "0..999"; } units "d"; default "7"; description "The lease time day."; } leaf lease-hour { type uint16 { range "0..23"; } units "h"; default "0"; description "The lease time hour."; } leaf lease-minute { type uint16 { range "0..59"; } units "min"; default "0"; description "The lease time minute."; } } } // rpc reset-if-dynamic-bind-table rpc reset-vlan-dynamic-bind-table { ext:node-ref "/vlan:vlan/vlan:vlans/vlan:vlan/dhcp:dhcp-snooping-vlan"; description "Reset the dynamic binding table in a VLAN."; input { leaf vlan-id { type uint16 { range "1..4094"; } mandatory true; description "VLAN ID."; } leaf ip-address { type inet:ipv4-address-no-zone; mandatory true; description "IP address."; } leaf mac-address { type pub-type:mac-address; description "MAC address."; } leaf if-name { type leafref { path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name"; } mandatory true; description "Interface name."; } leaf cevlan-id { type uint16 { range "1..4094"; } description "CE VLAN ID."; } leaf lease-day { type uint16 { range "0..999"; } units "d"; default "7"; description "The lease time day."; } leaf lease-hour { type uint16 { range "0..23"; } units "h"; default "0"; description "The lease time hour."; } leaf lease-minute { type uint16 { range "0..59"; } units "min"; default "0"; description "The lease time minute."; } } } // rpc reset-vlan-dynamic-bind-table } // module huawei-dhcp
© 2023 YumaWorks, Inc. All rights reserved.