Add supoprt for D release use-case.
[sim/o1-interface.git] / ntsimulator / deploy / o-ran-ru-fh / yang / o-ran-dhcp@2020-12-10.yang
1 module o-ran-dhcp {
2   yang-version 1.1;
3   namespace "urn:o-ran:dhcp:1.0";
4   prefix "o-ran-dhcp";
5
6   import ietf-interfaces {
7     prefix "if";
8   }
9
10   import ietf-inet-types {
11     prefix "inet";
12   }
13
14   import ietf-dhcpv6-types {
15     prefix dhcpv6-type;
16     // checkAS
17     // revision-date 2018-09-04;
18   }
19
20   import o-ran-wg4-features {
21     prefix or-feat;
22   }
23
24   organization "O-RAN Alliance";
25
26   contact
27     "www.o-ran.org";
28
29   description
30     "This module defines the YANG definitions for managng the DHCP client.
31
32     Copyright 2019 the O-RAN alliance.
33
34     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
35     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
38     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
39     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
42     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
43     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44     POSSIBILITY OF SUCH DAMAGE.
45
46     Redistribution and use in source and binary forms, with or without
47     modification, are permitted provided that the following conditions are met:
48
49     * Redistributions of source code must retain the above copyright notice,
50     this list of conditions and the above disclaimer.
51     * Redistributions in binary form must reproduce the above copyright notice,
52     this list of conditions and the above disclaimer in the documentation
53     and/or other materials provided with the distribution.
54     * Neither the Members of the O-RAN Alliance nor the names of its
55     contributors may be used to endorse or promote products derived from
56     this software without specific prior written permission.";
57
58   revision "2020-12-10" {
59    description
60      "version 5.0.0
61
62      1) added new leafs for reporting discovered event-collectors
63      used";
64
65    reference "ORAN-WG4.O1.0-v05.00";
66 //update reference
67   }
68
69   revision "2019-07-03" {
70     description
71       "version 1.1.0
72
73       1) backward compatible changes to fix pen number which always
74       should have been 32 bits
75       2) backward compatible changes to introduce reporting of 3GPP
76       discovered MV-PnP information, including CA/RA Servers and SeGW
77       3) backward compatible changes to introduce groupings";
78
79     reference "ORAN-WG4.M.0-v01.00";
80   }
81
82   revision "2019-02-04" {
83     description
84       "version 1.0.0
85
86       1) imported model from xRAN
87       2) changed namespace and reference from xran to o-ran";
88
89     reference "ORAN-WG4.M.0-v01.00";
90   }
91
92   typedef netconf-client-id {
93     type union {
94       type inet:ip-address;
95       type inet:uri;
96     }
97     description "A NETCONF client identifier";
98   }
99
100   typedef ca-ra-server-id {
101     type union {
102       type inet:ip-address;
103       type inet:uri;
104     }
105     description "A CA/RA Server identifier";
106   }
107
108   typedef segw-id {
109     type union {
110       type inet:ip-address;
111       type inet:uri;
112     }
113     description "A SeGW identifier";
114   }
115
116   typedef event-collector-id {
117     type union {
118       type inet:ip-address;
119       type inet:uri;
120     }
121     description "An event collector identifier";
122   }
123
124   grouping ca-ra-servers {
125     description
126       "The CA/RA servers discovered using DHCP, discovered using the 3GPP
127       defined options in 3GPP 32.509 in vendor specific option 43/17";
128     list ca-ra-servers {
129       key servers;
130       description "A list of IP addresses or URIs for CA/RA Servers";
131
132       leaf servers{
133         type ca-ra-server-id;
134         description "the server identifier";
135       }
136       leaf port-number {
137         type inet:port-number;
138         description "an optional (non-default) port";
139       }
140       leaf ca-ra-path {
141         type string;
142         description
143           "ASCII string representing the path to the CMP server directory.
144           A CMP server may be located in an arbitrary path other than root.";
145       }
146       leaf subject-name {
147         type string;
148         description
149           "ASCII string representing the subject name of the CA/RA. ";
150       }
151       leaf protocol {
152         type enumeration {
153           enum HTTP;
154           enum HTTPS;
155         }
156       }
157     }
158   }
159
160   grouping security-gateways {
161     description
162       "The security gateways discovered using DHCP, discovered using the 3GPP
163       defined options in 3GPP 32.509 in vendor specific option 43/17";
164     list segw {
165       key gateways;
166       description "A list of IP addresses or URIs for SeGW";
167
168       leaf gateways{
169         type segw-id;
170         description "the SeGW identifier";
171       }
172     }
173
174   }
175
176   grouping netconf-clients {
177     description
178       "The netconf clients discovered using DHCP, discovered using the IANA
179       defined options or O-RAN defined syntax for encoding IP adresses or FQDNs
180       in vendor specific option 43/17";
181     list netconf-clients{
182       key client;
183       description "A list of IP addresses or URIs for NETCONF clients";
184       leaf client{
185         type netconf-client-id;
186         description "the client identifier";
187       }
188       leaf optional-port {
189         type inet:port-number;
190         description "an optional (non-default) port";
191       }
192     }
193   }
194
195   grouping event-collectors {
196     description
197       "The event-collectors discovered using DHCP, discovered using the O-RAN
198       defined syntax for encoding IP adresses or FQDNs in vendor specific
199       option 43/17";
200     leaf-list event-collectors{
201       if-feature "or-feat:NON-PERSISTENT-MPLANE";
202       max-elements 1;
203       type event-collector-id;
204       description
205         "An event-collector discovered using DHCP that can be used by the O-RU to
206         send pnfRegistration notification messages.
207
208         The O-RU behaviour when discovering more than one event-collector is not defined.";
209     }
210     leaf event-collector-format{
211       if-feature "or-feat:NON-PERSISTENT-MPLANE";
212       type enumeration {
213         enum ONAP;
214       }
215       description "the event-collector notification format";
216     }
217   }
218
219   grouping dhcpv4-option {
220     description "DHCPv4 Configuration options";
221
222     leaf dhcp-server-identifier {
223       type  inet:ip-address;
224       description "DHCP server identifier";
225     }
226     leaf domain-name {
227       type  string;
228       description "Name of the domain";
229     }
230     leaf-list domain-name-servers {
231       type  inet:ip-address;
232       description "A list of DNS servers";
233     }
234     leaf interface-mtu {
235       type  uint32 {
236         range "0..65535";
237       }
238       description "Minimum Transmission Unit (MTU) of the interface";
239     }
240     leaf-list default-gateways{
241       type inet:ip-address;
242       description "the list of default gateways on the O-RUs subnet";
243     }
244     uses netconf-clients;
245     uses ca-ra-servers;
246     uses security-gateways;
247     uses event-collectors;
248   }
249
250   grouping dhcpv6-option {
251     description "DHCPv6 Configuration options";
252
253     container dhcp-server-identifier{
254       description "dhcpv6 server identifief";
255       uses dhcpv6-type:duid;
256     }
257     leaf domain-name {
258       type  string;
259       description "Name of the domain";
260     }
261     leaf-list domain-name-servers {
262       type  inet:ip-address;
263       description "A list of DNS servers";
264     }
265     uses netconf-clients;
266     uses ca-ra-servers;
267     uses security-gateways;
268     uses event-collectors;
269   }
270
271   grouping dhcp-group {
272     list interfaces {
273       key "interface";
274       description "Interface configuration";
275
276       leaf interface {
277         type if:interface-ref;
278         description "Name of the interface";
279       }
280
281       container dhcpv4 {
282         description "DHCPv4 information";
283         leaf client-id {
284           type string;
285           description "DHCP client identifier";
286         }
287         uses dhcpv4-option;
288       }
289       container dhcpv6 {
290         description "DHCPv6 information";
291         container dhcp-client-identifier{
292           description "dhcpv6 client identifief";
293           uses dhcpv6-type:duid;
294         }
295         uses dhcpv6-option;
296       }
297     }
298
299     container m-plane-dhcp {
300       description "leafs covering off DHCP aspects of m-plane operations";
301       leaf private-enterprise-number {
302         status deprecated;
303         type uint16;
304         default 53148;
305         description "the private enteprise number allocated to O-RAN Alliance";
306       }
307       leaf private-enterprise-num {
308         type uint32;
309         default 53148;
310         description "the private enterprise number allocated to O-RAN Alliance";
311       }
312       leaf vendor-class-data {
313         type string;
314         description
315           "The string used in DHCPv4 option 60 or DHCPv4 option 124 and
316           DHCPv6 option 16";
317       }
318     }
319   }
320
321
322   // Top Level Container
323
324   container dhcp {
325     config false;
326     description
327       "DHCP client configuration";
328
329     uses dhcp-group;
330   }
331 }