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