Update YANG models for OpenFronthaul M-Plane.
[sim/o1-interface.git] / ntsimulator / deploy / o-ran-ru-fh / yang / o-ran-dhcp.yang
@@ -13,8 +13,11 @@ module o-ran-dhcp {
 
   import ietf-dhcpv6-types {
     prefix dhcpv6-type;
-    // checkAS
-    // revision-date 2018-09-04;
+    revision-date 2018-09-04;
+  }
+
+  import ietf-dhcpv6-common {
+    prefix dhcpv6-type2;
   }
 
   import o-ran-wg4-features {
@@ -27,9 +30,9 @@ module o-ran-dhcp {
     "www.o-ran.org";
 
   description
-    "This module defines the YANG definitions for managng the DHCP client.
+    "This module defines the YANG definitions for managing the DHCP client.
 
-    Copyright 2019 the O-RAN alliance.
+    Copyright 2021 the O-RAN alliance.
 
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -55,6 +58,34 @@ module o-ran-dhcp {
     contributors may be used to endorse or promote products derived from
     this software without specific prior written permission.";
 
+  revision "2022-08-15" {
+    description
+      "version 10.0.0
+
+      1) added DUID/IAID support for IPv4.
+      2) switched import FROM ietf-dhcpv6-types TO ietf-dhcpv6-common";
+
+    reference "ORAN-WG4.M.0-v10.00";
+  }
+
+  revision "2021-12-01" {
+    description
+      "version 5.2.0
+
+      1) Typographical corrections for british english.";
+
+    reference "ORAN-WG4.M.0-v05.00";
+  }
+
+  revision "2021-03-22" {
+    description
+      "version 5.1.0
+
+      1) typographical corrections in descriptions.";
+
+    reference "ORAN-WG4.M.0-v05.00";
+  }
+
   revision "2020-12-10" {
    description
      "version 5.0.0
@@ -62,8 +93,7 @@ module o-ran-dhcp {
      1) added new leafs for reporting discovered event-collectors
      used";
 
-   reference "ORAN-WG4.O1.0-v05.00";
-//update reference
+   reference "ORAN-WG4.M.0-v05.00";
   }
 
   revision "2019-07-03" {
@@ -150,9 +180,16 @@ module o-ran-dhcp {
       }
       leaf protocol {
         type enumeration {
-          enum HTTP;
-          enum HTTPS;
+          enum HTTP {
+            description
+                "HTTP used to communicate with CA/RA server";
+          }
+          enum HTTPS{
+            description
+                "HTTPS used to communicate with CA/RA server";
+          }
         }
+        description "the protocol used to communicate with a CA/RA server";
       }
     }
   }
@@ -175,8 +212,8 @@ module o-ran-dhcp {
 
   grouping netconf-clients {
     description
-      "The netconf clients discovered using DHCP, discovered using the IANA
-      defined options or O-RAN defined syntax for encoding IP adresses or FQDNs
+      "The NETCONF clients discovered using DHCP, discovered using the IANA
+      defined options or O-RAN defined syntax for encoding IP addresses or FQDNs
       in vendor specific option 43/17";
     list netconf-clients{
       key client;
@@ -195,12 +232,12 @@ module o-ran-dhcp {
   grouping event-collectors {
     description
       "The event-collectors discovered using DHCP, discovered using the O-RAN
-      defined syntax for encoding IP adresses or FQDNs in vendor specific
+      defined syntax for encoding IP addresses or FQDNs in vendor specific
       option 43/17";
     leaf-list event-collectors{
       if-feature "or-feat:NON-PERSISTENT-MPLANE";
-      max-elements 1;
       type event-collector-id;
+      max-elements 1;
       description
         "An event-collector discovered using DHCP that can be used by the O-RU to
         send pnfRegistration notification messages.
@@ -210,7 +247,9 @@ module o-ran-dhcp {
     leaf event-collector-format{
       if-feature "or-feat:NON-PERSISTENT-MPLANE";
       type enumeration {
-        enum ONAP;
+        enum ONAP {
+          description "ONAP format is used to signal the event-collector";
+        }
       }
       description "the event-collector notification format";
     }
@@ -251,9 +290,14 @@ module o-ran-dhcp {
     description "DHCPv6 Configuration options";
 
     container dhcp-server-identifier{
-      description "dhcpv6 server identifief";
+      status deprecated;
+      description "dhcpv6 server identifier - deprecated as this uses import from ietf-dhcpv6-types and not ietf-dhcpv6-common";
       uses dhcpv6-type:duid;
     }
+    container dhcpv6-server-identifier{
+      description "dhcpv6 server identifier - replaces container dhcp-server-identifier and uses import from ietf-dhcpv6-common";
+      uses dhcpv6-type2:duid;
+    }
     leaf domain-name {
       type  string;
       description "Name of the domain";
@@ -269,6 +313,7 @@ module o-ran-dhcp {
   }
 
   grouping dhcp-group {
+    description "a dhcp grouping";
     list interfaces {
       key "interface";
       description "Interface configuration";
@@ -282,16 +327,48 @@ module o-ran-dhcp {
         description "DHCPv4 information";
         leaf client-id {
           type string;
-          description "DHCP client identifier";
+          description "DHCP client identifier - used when the DHCPv4 client in the O-RU does not use DUID/IAID";
+        }
+        uses dhcpv6-type2:duid;
+
+        container identity-association {
+          description "an optional container - used when DHCPv4 client uses DUID/IAID as identifier";
+
+          leaf iaid {
+            type uint32;
+            description "IAID";
+          }
+          leaf ia-type {
+            type string;
+            description "IA type";
+          }
         }
         uses dhcpv4-option;
       }
       container dhcpv6 {
         description "DHCPv6 information";
         container dhcp-client-identifier{
-          description "dhcpv6 client identifief";
+          status deprecated;
+          description "dhcpv6 client identifier - deprecated as this uses import from ietf-dhcpv6-types and not ietf-dhcpv6-common";
           uses dhcpv6-type:duid;
         }
+        container dhcpv6-client-identifier{
+          description "dhcpv6 client identifier using ietf-dhcpv6-common import";
+          uses dhcpv6-type2:duid;
+          container identity-association {
+            description "a container describing IAID information";
+
+            leaf iaid {
+              type uint32;
+              description "IAID";
+            }
+            leaf ia-type {
+              type string;
+              mandatory true;
+              description "IA type";
+            }
+          }
+        }
         uses dhcpv6-option;
       }
     }
@@ -299,10 +376,10 @@ module o-ran-dhcp {
     container m-plane-dhcp {
       description "leafs covering off DHCP aspects of m-plane operations";
       leaf private-enterprise-number {
-        status deprecated;
         type uint16;
         default 53148;
-        description "the private enteprise number allocated to O-RAN Alliance";
+        status deprecated;
+        description "the private enterprise number allocated to O-RAN Alliance";
       }
       leaf private-enterprise-num {
         type uint32;