netconfcentral logo

ietf-dhcp

HTML

ietf-dhcp@2017-03-02



  module ietf-dhcp {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-dhcp";

    prefix dhcp;

    import ietf-inet-types {
      prefix inet;
    }
    import ietf-yang-types {
      prefix yang;
    }
    import ietf-interfaces {
      prefix if;
    }

    organization
      "IETF dhc (Dynamic Host Configuration Protocol)
                Working Group";

    contact
      "leo.liubing@huawei.com
                loukunkun@huawei.com
                chin.chen@ericsson.com";

    description
      "The module for implementing DHCP protocol";

    revision "2017-03-02" {
      description "initial draft revision";
      reference
        "rfc2131 rfc6020";

    }


    feature dhcp-server {
      description "Feature DHCP server";
    }

    feature dhcp-client {
      description "Feature DHCP client";
    }

    feature dhcp-relay {
      description "Feature DHCP relay";
    }

    typedef allocate-type {
      type enumeration {
        enum "automatic" {
          value 0;
          description
            "DHCP assigns a permanent IP address to a client";
        }
        enum "dynamic" {
          value 1;
          description
            "DHCP assigns an IP address to a client
         for a limited period of time";
        }
        enum "manual" {
          value 2;
          description
            "a client's IP address is assigned by the
                   network administrator, and DHCP is used
         simply to convey the assigned address to the client";
        }
      }
      description
        "Mechanisms for IP address allocation";
    }

    grouping server-packet {
      description
        "The packets are sent from server ";
      leaf offer-packet {
        type uint32;
        config false;
        description
          "Total number of DHCPOFFER packets";
      }

      leaf ack-packet {
        type uint32;
        config false;
        description
          "Total number of DHCPACK packets";
      }

      leaf nack-packet {
        type uint32;
        config false;
        description
          "Total number of DHCPNAK packets";
      }
    }  // grouping server-packet

    grouping client-packet {
      description
        "The packets are sent from client ";
      leaf decline-packet {
        type uint32;
        config false;
        description
          "Total number of DHCPDECLINE packets";
      }

      leaf discover-packet {
        type uint32;
        config false;
        description
          "Total number of DHCPDISCOVER packets";
      }

      leaf request-packet {
        type uint32;
        config false;
        description
          "Total number of DHCPREQUEST packets";
      }

      leaf release-packet {
        type uint32;
        config false;
        description
          "Total number of DHCPRELEASE packets";
      }

      leaf inform-packet {
        type uint32;
        config false;
        description
          "Total number of DHCPINFORM packets";
      }
    }  // grouping client-packet

    grouping sum-packet {
      description
        "All of commnicated packets between server and client";
      uses server-packet;

      uses client-packet;
    }  // grouping sum-packet

    grouping dhcp-option {
      description "Configuration option";
      leaf dhcp-server-identifier {
        type inet:ip-address;
        description "DHCP server identifier";
      }

      leaf domain-name {
        type string;
        description "Name of the domain";
      }

      leaf domain-name-server {
        type inet:ip-address;
        description
          "IPv4 address of the domain";
      }

      leaf interface-mtu {
        type uint32 {
          range "0..65535";
        }
        description
          "Minimum Transmission Unit (MTU) of the interface";
      }

      leaf netbios-name-server {
        type inet:ip-address;
        description "NETBIOS name server";
      }

      leaf netbios-node-type {
        type uint32 {
          range "0..65535";
        }
        description "NETBIOS node type";
      }

      leaf netbios-scope {
        type string;
        description "NETBIOS scope";
      }
    }  // grouping dhcp-option

    container dhcp {
      description "DHCP configuration";
      container server {
        if-feature dhcp-server;
        description
          "DHCP server configuration";
        leaf lease-time {
          type uint32 {
            range "180..31536000";
          }
          description
            "Default network address lease time assigned to DHCP clients";
        }

        leaf ping-packet-number {
          type uint8 {
            range "0..10";
          }
          default "0";
          description
            "Number of ping packets";
        }

        leaf ping-packet-timeout {
          type uint16 {
            range "0..10000";
          }
          default "500";
          description
            "Timeout of ping packet";
        }

        container option {
          description "Configuration option";
          uses dhcp-option;
        }  // container option

        list dhcp-ip-pool {
          key "ip-pool-name";
          description
            "Global IP pool configuration";
          leaf ip-pool-name {
            type string {
              length "1..64";
            }
            description
              "Name of the IP pool";
          }

          leaf interface {
            type if:interface-ref;
            description
              "Name of the interface";
          }

          leaf gateway-ip {
            type inet:ip-address;
            description
              "IPv4 address of the gateway";
          }

          leaf gateway-mask {
            type inet:ip-prefix;
            description
              "Network submask of the gateway";
          }

          leaf lease-time {
            type uint32 {
              range "180..31536000";
            }
            description
              "Default network address lease time assigned to DHCP clients";
          }

          list manual-allocation {
            key "mac-address ip-address";
            description
              "Mapping from MAC address to IP address";
            leaf mac-address {
              type yang:mac-address;
              description
                "MAC address of the host";
            }

            leaf ip-address {
              type inet:ip-address;
              description
                "IPv4 address of the host";
            }
          }  // list manual-allocation

          list section {
            key "section-index";
            description
              "IPv4 address for the range";
            leaf section-index {
              type uint16 {
                range "0..255";
              }
              description
                "Index of IPv4 address range";
            }

            leaf section-start-ip {
              type inet:ipv4-address;
              mandatory true;
              description
                "Starting IPv4 Address of a section";
            }

            leaf section-end-ip {
              type inet:ipv4-address;
              description
                "Last IPv4 Address of a section";
            }
          }  // list section

          container option {
            description
              "Configuration option";
            uses dhcp-option;
          }  // container option
        }  // list dhcp-ip-pool
      }  // container server

      container relay {
        if-feature dhcp-relay;
        description
          "DHCP relay agent configuration";
        list server-group {
          key "server-group-name";
          description
            "DHCP server group configuration that DHCP relays to";
          leaf server-group-name {
            type string;
            description
              "Name of a DHCP server group";
          }

          leaf interface {
            type if:interface-ref;
            description
              "Name of the interface";
          }

          leaf gateway-address {
            type inet:ipv4-address;
            description
              "IPv4 address of the gateway";
          }

          leaf-list server-address {
            type inet:ipv4-address;
            description
              "IPv4 address of the server";
          }
        }  // list server-group
      }  // container relay

      container client {
        if-feature dhcp-client;
        description
          "DHCP client configuration";
        list interfaces {
          key "interface";
          description
            "Interface configuration";
          leaf interface {
            type if:interface-ref;
            description
              "Name of the interface";
          }

          leaf client-id {
            type string;
            description
              "DHCP client identifier";
          }

          leaf lease {
            type uint32 {
              range "1..4294967295";
            }
            description
              "Default network address lease time assigned to DHCP clients";
          }
        }  // list interfaces
      }  // container client
    }  // container dhcp

    container dhcp-state {
      config false;
      description "DHCP state data";
      container server {
        if-feature dhcp-server;
        description "DHCP server state data";
        container packet-statistics {
          description "Packet statistics";
          leaf interface {
            type if:interface-state-ref;
            description
              "Name of the interface";
          }

          container receive {
            description
              "Number of  received packets";
            uses client-packet;
          }  // container receive

          container send {
            description
              "Number of sent packets";
            uses server-packet;
          }  // container send
        }  // container packet-statistics

        container host {
          description
            "Host status information";
          leaf interface {
            type string;
            config false;
            description
              "Name of the interface";
          }

          leaf host-ip {
            type string;
            config false;
            description
              "IPv4 address of the host";
          }

          leaf host-hardware-address {
            type string;
            config false;
            description
              "MAC address of the host";
          }

          leaf lease {
            type uint32;
            config false;
            description
              "Default network address lease
                      time assigned to DHCP clients";
          }

          leaf type {
            type allocate-type;
            config false;
            description
              "Mechanisms for IP address allocation";
          }
        }  // container host

        list ip-pool {
          key "ip-pool-name";
          description
            "Global IP pool configuration";
          leaf ip-pool-name {
            type string {
              length "1..64";
            }
            description "Name of an IP pool";
          }

          leaf gateway-ip {
            type inet:ip-address;
            description
              "IPv4 address of the gateway";
          }

          leaf gateway-mask {
            type inet:ip-prefix;
            description
              "Network submask of the gateway";
          }

          leaf used-ip-count {
            type uint32;
            config false;
            description
              "Total number of used IPv4 addresses";
          }

          leaf idle-ip-count {
            type uint32;
            config false;
            description
              "Total number of idle IPv4 addresses";
          }

          leaf conflict-ip-count {
            type uint32;
            config false;
            description
              "Total number of conflict IPv4 addresses";
          }

          leaf total-ip-count {
            type uint32;
            config false;
            description
              "Total number of IPv4 addresses";
          }
        }  // list ip-pool
      }  // container server

      container relay {
        if-feature dhcp-relay;
        description
          "DHCP reply agent state data";
        container packet-statistics {
          description "Packet statistics";
          leaf interface {
            type if:interface-state-ref;
            description
              "Name of the interface";
          }

          container receive {
            description
              "Number of  received packets";
            uses sum-packet;
          }  // container receive

          container send {
            description
              "Number of sent packets";
            uses sum-packet;
          }  // container send
        }  // container packet-statistics
      }  // container relay

      container client {
        if-feature dhcp-client;
        description "DHCP client state data";
        container packet-statistics {
          description "Packet statistics";
          leaf interface {
            type if:interface-state-ref;
            description
              "Name of the interface";
          }

          container receive {
            description
              "Number of  received packets";
            uses server-packet;
          }  // container receive

          container send {
            description
              "Number of sent packets";
            uses client-packet;
          }  // container send
        }  // container packet-statistics
      }  // container client
    }  // container dhcp-state

    rpc clean-server-statistics {
      if-feature dhcp-server;
      description
        "Clean server packet statistics";
      input {
        leaf interface {
          type leafref {
            path "/dhcp:dhcp-state/dhcp:server/dhcp:packet-statistics/dhcp:interface";
          }
          description
            "Name of the interface";
        }

        leaf clean-at {
          type yang:date-and-time;
          description
            "The start time to clean packet statistics";
        }
      }

      output {
        leaf clean-finished-at {
          type yang:date-and-time;
          description
            "The finish time to clean packet statistics";
        }
      }
    }  // rpc clean-server-statistics

    rpc clean-relay-statistics {
      if-feature dhcp-relay;
      description
        "Clean relay packet statistics";
      input {
        leaf interface {
          type leafref {
            path "/dhcp:dhcp-state/dhcp:relay/dhcp:packet-statistics/dhcp:interface";
          }
          description
            "Name of the interface";
        }

        leaf clean-at {
          type yang:date-and-time;
          description
            "The start time to clean packet statistics";
        }
      }

      output {
        leaf clean-finished-at {
          type yang:date-and-time;
          description
            "The finish time to clean packet statistics";
        }
      }
    }  // rpc clean-relay-statistics

    rpc clean-client-statistics {
      if-feature dhcp-client;
      description
        "Clean client packet statistics";
      input {
        leaf interface {
          type leafref {
            path "/dhcp:dhcp-state/dhcp:client/dhcp:packet-statistics/dhcp:interface";
          }
          description
            "Name of the interface";
        }

        leaf clean-at {
          type yang:date-and-time;
          description
            "The start time to clean packet statistics";
        }
      }

      output {
        leaf clean-finished-at {
          type yang:date-and-time;
          description
            "The finish time to clean packet statistics";
        }
      }
    }  // rpc clean-client-statistics
  }  // module ietf-dhcp

Summary

  
  
Organization IETF dhc (Dynamic Host Configuration Protocol) Working Group
  
Module ietf-dhcp
Version 2017-03-02
File ietf-dhcp@2017-03-02.yang
  
Prefix dhcp
Namespace urn:ietf:params:xml:ns:yang:ietf-dhcp
  
Cooked /cookedmodules/ietf-dhcp/2017-03-02
YANG /src/ietf-dhcp@2017-03-02.yang
XSD /xsd/ietf-dhcp@2017-03-02.xsd
  
Abstract The module for implementing DHCP protocol
  
Contact
leo.liubing@huawei.com
loukunkun@huawei.com
chin.chen@ericsson.com

Description

 
The module for implementing DHCP protocol

Typedefs

Typedef Base type Abstract
allocate-type enumeration Mechanisms for IP address allocation

Groupings

Grouping Objects Abstract
client-packet decline-packet discover-packet request-packet release-packet inform-packet The packets are sent from client
dhcp-option dhcp-server-identifier domain-name domain-name-server interface-mtu netbios-name-server netbios-node-type netbios-scope Configuration option
server-packet offer-packet ack-packet nack-packet The packets are sent from server
sum-packet offer-packet ack-packet nack-packetdecline-packet discover-packet request-packet release-packet inform-packet All of commnicated packets between server and client

Objects

Type Key
Mandatory config
Optional config
Not config
Object Type Abstract
dhcp container DHCP configuration
dhcp-state container DHCP state data
   client container DHCP client state data
      packet-statistics container Packet statistics
         interface leaf Name of the interface
         receive container Number of received packets
            ack-packet leaf Total number of DHCPACK packets
            nack-packet leaf Total number of DHCPNAK packets
            offer-packet leaf Total number of DHCPOFFER packets
         send container Number of sent packets
            decline-packet leaf Total number of DHCPDECLINE packets
            discover-packet leaf Total number of DHCPDISCOVER packets
            inform-packet leaf Total number of DHCPINFORM packets
            release-packet leaf Total number of DHCPRELEASE packets
            request-packet leaf Total number of DHCPREQUEST packets
   relay container DHCP reply agent state data
      packet-statistics container Packet statistics
         interface leaf Name of the interface
         receive container Number of received packets
            ack-packet leaf Total number of DHCPACK packets
            decline-packet leaf Total number of DHCPDECLINE packets
            discover-packet leaf Total number of DHCPDISCOVER packets
            inform-packet leaf Total number of DHCPINFORM packets
            nack-packet leaf Total number of DHCPNAK packets
            offer-packet leaf Total number of DHCPOFFER packets
            release-packet leaf Total number of DHCPRELEASE packets
            request-packet leaf Total number of DHCPREQUEST packets
         send container Number of sent packets
            ack-packet leaf Total number of DHCPACK packets
            decline-packet leaf Total number of DHCPDECLINE packets
            discover-packet leaf Total number of DHCPDISCOVER packets
            inform-packet leaf Total number of DHCPINFORM packets
            nack-packet leaf Total number of DHCPNAK packets
            offer-packet leaf Total number of DHCPOFFER packets
            release-packet leaf Total number of DHCPRELEASE packets
            request-packet leaf Total number of DHCPREQUEST packets
   server container DHCP server state data
      host container Host status information
         host-hardware-address leaf MAC address of the host
         host-ip leaf IPv4 address of the host
         interface leaf Name of the interface
         lease leaf Default network address lease time assigned to DHCP clients
         type leaf Mechanisms for IP address allocation
      ip-pool list Global IP pool configuration
         conflict-ip-count leaf Total number of conflict IPv4 addresses
         gateway-ip leaf IPv4 address of the gateway
         gateway-mask leaf Network submask of the gateway
         idle-ip-count leaf Total number of idle IPv4 addresses
         ip-pool-name leaf Name of an IP pool
         total-ip-count leaf Total number of IPv4 addresses
         used-ip-count leaf Total number of used IPv4 addresses
      packet-statistics container Packet statistics
         interface leaf Name of the interface
         receive container Number of received packets
            decline-packet leaf Total number of DHCPDECLINE packets
            discover-packet leaf Total number of DHCPDISCOVER packets
            inform-packet leaf Total number of DHCPINFORM packets
            release-packet leaf Total number of DHCPRELEASE packets
            request-packet leaf Total number of DHCPREQUEST packets
         send container Number of sent packets
            ack-packet leaf Total number of DHCPACK packets
            nack-packet leaf Total number of DHCPNAK packets
            offer-packet leaf Total number of DHCPOFFER packets
   client container DHCP client configuration
      interfaces list Interface configuration
         client-id leaf DHCP client identifier
         interface leaf Name of the interface
         lease leaf Default network address lease time assigned to DHCP clients
   relay container DHCP relay agent configuration
      server-group list DHCP server group configuration that DHCP relays to
         gateway-address leaf IPv4 address of the gateway
         interface leaf Name of the interface
         server-address leaf-list IPv4 address of the server
         server-group-name leaf Name of a DHCP server group
   server container DHCP server configuration
      dhcp-ip-pool list Global IP pool configuration
         gateway-ip leaf IPv4 address of the gateway
         gateway-mask leaf Network submask of the gateway
         interface leaf Name of the interface
         ip-pool-name leaf Name of the IP pool
         lease-time leaf Default network address lease time assigned to DHCP clients
         manual-allocation list Mapping from MAC address to IP address
            ip-address leaf IPv4 address of the host
            mac-address leaf MAC address of the host
         option container Configuration option
            dhcp-server-identifier leaf DHCP server identifier
            domain-name leaf Name of the domain
            domain-name-server leaf IPv4 address of the domain
            interface-mtu leaf Minimum Transmission Unit (MTU) of the interface
            netbios-name-server leaf NETBIOS name server
            netbios-node-type leaf NETBIOS node type
            netbios-scope leaf NETBIOS scope
         section list IPv4 address for the range
            section-end-ip leaf Last IPv4 Address of a section
            section-index leaf Index of IPv4 address range
            section-start-ip leaf Starting IPv4 Address of a section
      lease-time leaf Default network address lease time assigned to DHCP clients
      option container Configuration option
         dhcp-server-identifier leaf DHCP server identifier
         domain-name leaf Name of the domain
         domain-name-server leaf IPv4 address of the domain
         interface-mtu leaf Minimum Transmission Unit (MTU) of the interface
         netbios-name-server leaf NETBIOS name server
         netbios-node-type leaf NETBIOS node type
         netbios-scope leaf NETBIOS scope
      ping-packet-number leaf Number of ping packets
      ping-packet-timeout leaf Timeout of ping packet

RPC Methods

RPC Abstract
clean-client-statistics Clean client packet statistics
clean-relay-statistics Clean relay packet statistics
clean-server-statistics Clean server packet statistics