Allow multiple NTS Manager instances to run on the same machine.
[sim/o1-interface.git] / ntsimulator / yang / 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-05-25" {
54     description
55       "version 1.1.0
56
57       1) backward compatible changes to introduce reporting of 3GPP
58       discovered MV-PnP information, including CA/RA Servers and SeGW ";
59
60     reference "ORAN-WG4.M.0-v01.00";
61   }
62
63   revision "2019-03-07" {
64     description
65       "version 1.0.1
66
67       1) backward compatible changes to introduce groupings.";
68
69     reference "ORAN-WG4.M.0-v01.00";
70   }
71
72   revision "2019-02-04" {
73     description
74       "version 1.0.0
75
76       1) imported model from xRAN
77       2) changed namespace and reference from xran to o-ran";
78
79     reference "ORAN-WG4.M.0-v01.00";
80   }
81
82   typedef netconf-client-id {
83     type union {
84       type inet:ip-address;
85       type inet:uri;
86     }
87     description "A NETCONF client identifier";
88   }
89
90   typedef ca-ra-server-id {
91     type union {
92       type inet:ip-address;
93       type inet:uri;
94     }
95     description "A CA/RA Server identifier";
96   }
97
98   typedef segw-id {
99     type union {
100       type inet:ip-address;
101       type inet:uri;
102     }
103     description "A SeGW identifier";
104   }
105
106   grouping ca-ra-servers {
107     description
108       "The CA/RA servers discovered using DHCP, discovered using the 3GPP
109       defined options in 3GPP 32.509 in vendor specific option 43/17";
110     list ca-ra-servers {
111       key servers;
112       description "A list of IP addresses or URIs for CA/RA Servers";
113
114       leaf servers{
115         type ca-ra-server-id;
116         description "the server identifier";
117       }
118       leaf port-number {
119         type inet:port-number;
120         description "an optional (non-default) port";
121       }
122       leaf ca-ra-path {
123         type string;
124         description
125           "ASCII string representing the path to the CMP server directory.
126           A CMP server may be located in an arbitrary path other than root.";
127       }
128       leaf subject-name {
129         type string;
130         description
131           "ASCII string representing the subject name of the CA/RA. ";
132       }
133       leaf protocol {
134         type enumeration {
135           enum HTTP;
136           enum HTTPS;
137         }
138       }
139     }
140   }
141
142   grouping security-gateways {
143     description
144       "The security gateways discovered using DHCP, discovered using the 3GPP
145       defined options in 3GPP 32.509 in vendor specific option 43/17";
146     list segw {
147       key gateways;
148       description "A list of IP addresses or URIs for SeGW";
149
150       leaf gateways{
151         type segw-id;
152         description "the SeGW identifier";
153       }
154     }
155
156   }
157
158   grouping netconf-clients {
159     description
160       "The netconf clients discovered using DHCP, discovered using the IANA
161       defined options or O-RAN defined syntax for encoding IP adresses or FQDNs
162       in vendor specific option 43/17";
163     list netconf-clients{
164       key client;
165       description "A list of IP addresses or URIs for NETCONF clients";
166       leaf client{
167         type netconf-client-id;
168         description "the client identifier";
169       }
170       leaf optional-port {
171         type inet:port-number;
172         description "an optional (non-default) port";
173       }
174     }
175   }
176
177   grouping dhcpv4-option {
178     description "DHCPv4 Configuration options";
179
180     leaf dhcp-server-identifier {
181       type  inet:ip-address;
182       description "DHCP server identifier";
183     }
184     leaf domain-name {
185       type  string;
186       description "Name of the domain";
187     }
188     leaf-list domain-name-servers {
189       type  inet:ip-address;
190       description "A list of DNS servers";
191     }
192     leaf interface-mtu {
193       type  uint32 {
194         range "0..65535";
195       }
196       description "Minimum Transmission Unit (MTU) of the interface";
197     }
198     leaf-list default-gateways{
199       type inet:ip-address;
200       description "the list of default gateways on the O-RUs subnet";
201     }
202     uses netconf-clients;
203     uses ca-ra-servers;
204     uses security-gateways;
205   }
206
207   grouping dhcpv6-option {
208     description "DHCPv6 Configuration options";
209
210     container dhcp-server-identifier{
211       description "dhcpv6 server identifief";
212       uses dhcpv6-type:duid;
213     }
214     leaf domain-name {
215       type  string;
216       description "Name of the domain";
217     }
218     leaf-list domain-name-servers {
219       type  inet:ip-address;
220       description "A list of DNS servers";
221     }
222     uses netconf-clients;
223     uses ca-ra-servers;
224     uses security-gateways;
225   }
226
227   grouping dhcp-group {
228     list interfaces {
229       key "interface";
230       description "Interface configuration";
231
232       leaf interface {
233         type if:interface-ref;
234         description "Name of the interface";
235       }
236
237       container dhcpv4 {
238         description "DHCPv4 information";
239         leaf client-id {
240           type string;
241           description "DHCP client identifier";
242         }
243         uses dhcpv4-option;
244       }
245       container dhcpv6 {
246         description "DHCPv6 information";
247         container dhcp-client-identifier{
248           description "dhcpv6 client identifief";
249           uses dhcpv6-type:duid;
250         }
251         uses dhcpv6-option;
252       }
253     }
254
255     container m-plane-dhcp {
256       description "leafs covering off DHCP aspects of m-plane operations";
257       leaf private-enterprise-number {
258         type uint16;
259         default 53148;
260         description "the private enteprise 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 }