Refactor folder structure.
[sim/o1-interface.git] / ntsimulator / yang / x-ran / xran-dhcp.yang
1 module xran-dhcp {
2   yang-version 1.1;
3   namespace "urn:xran:dhcp:1.0";
4   prefix "xran-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 "xRAN Alliance";
20
21   contact
22     "www.xran.org";
23
24   description
25     "This module defines the YANG definitions for managng the DHCP client on
26     the xRAN Radio Unit.
27
28     Copyright 2018 Members of the xRAN alliance.
29
30     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
31     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
34     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40     POSSIBILITY OF SUCH DAMAGE.
41
42     Redistribution and use in source and binary forms, with or without
43     modification, are permitted provided that the following conditions are met:
44
45     * Redistributions of source code must retain the above copyright notice,
46     this list of conditions and the above disclaimer.
47     * Redistributions in binary form must reproduce the above copyright notice,
48     this list of conditions and the above disclaimer in the documentation
49     and/or other materials provided with the distribution.
50     * Neither the Members of the xRAN Forum nor the names of its
51     contributors may be used to endorse or promote products derived from
52     this software without specific prior written permission.";
53
54   revision "2018-07-20" {
55     description
56       "version 1.0.0 - First release of the xRAN YANG M-Plane models.
57
58       This version of the model supports v01.00 of the corrsponding xRAN
59       M-Plane Specification.";
60     reference "XRAN-FH.MP.0-v01.00";
61   }
62
63   typedef netconf-client-id {
64     type union {
65       type inet:ip-address;
66       type inet:uri;
67     }
68     description "A NETCONF client identifier";
69   }
70
71   grouping netconf-clients {
72     description "the netconf clients discovered using DHCP";
73     list netconf-clients{
74       key client;
75       description "A list of IP addresses or URIs for NETCONF clients";
76       leaf client{
77         type netconf-client-id;
78         description "the client identifier";
79       }
80       leaf optional-port {
81         type inet:port-number;
82         description "an optional (non-default) port";
83       }
84     }
85   }
86
87   grouping dhcpv4-option {
88     description "DHCPv4 Configuration options";
89
90     leaf dhcp-server-identifier {
91       type  inet:ip-address;
92       description "DHCP server identifier";
93     }
94     leaf domain-name {
95       type  string;
96       description "Name of the domain";
97     }
98     leaf-list domain-name-servers {
99       type  inet:ip-address;
100       description "A list of DNS servers";
101     }
102     leaf interface-mtu {
103       type  uint32 {
104         range "0..65535";
105       }
106       description "Minimum Transmission Unit (MTU) of the interface";
107     }
108     leaf-list default-gateways{
109       type inet:ip-address;
110       description "the list of default gateways on the RUs subnet";
111     }
112     leaf vendor-specific-option {
113       type string;
114       description "The vendor specific option #43";
115     }
116     uses netconf-clients;
117   }
118
119   grouping dhcpv6-option {
120     description "DHCPv6 Configuration options";
121
122     container dhcp-server-identifier{
123       description "dhcpv6 server identifief";
124       uses dhcpv6-type:duid;
125     }
126     leaf domain-name {
127       type  string;
128       description "Name of the domain";
129     }
130     leaf-list domain-name-servers {
131       type  inet:ip-address;
132       description "A list of DNS servers";
133     }
134     uses netconf-clients;
135   }
136
137   container dhcp {
138     config false;
139     description
140       "DHCP client configuration";
141
142     list interfaces {
143       key "interface";
144       description "Interface configuration";
145
146       leaf interface {
147         type if:interface-ref;
148         description "Name of the interface";
149       }
150
151       container dhcpv4 {
152         description "DHCPv4 information";
153         leaf client-id {
154           type string;
155           description "DHCP client identifier";
156         }
157         uses dhcpv4-option;
158       }
159       container dhcpv6 {
160         description "DHCPv6 information";
161         container dhcp-client-identifier{
162           description "dhcpv6 client identifief";
163           uses dhcpv6-type:duid;
164         }
165         uses dhcpv6-option;
166       }
167     }
168
169     container m-plane-dhcp {
170       description "leafs covering off DHCP aspects of m-plane operations";
171       leaf private-enterprise-number {
172         type uint16;
173         description "the private eneteprrise number allocated to xRAN";
174       }
175       leaf vendor-class-data {
176         type string;
177         description
178           "The string used in DHCPv4 option 60 or DHCPv4 option 124 and
179           DHCPv6 option 16";
180       }
181     }
182   }
183 }