Working with OVS
[vpnservice.git] / interfacemgr / interfacemgr-api / src / main / yang / odl-interface.yang
1 module odl-interface {
2     namespace "urn:opendaylight:vpnservice:interfacemgr";
3
4     prefix "odlif";
5
6     import ietf-interfaces {
7         prefix if;
8     }
9
10     import yang-ext {
11         prefix ext;
12     }
13
14     import iana-if-type {
15         prefix ianaift;
16     }
17
18     import ietf-inet-types {
19         prefix inet;
20     }
21
22     import opendaylight-inventory {
23         prefix inv; revision-date 2013-08-19;
24     }
25
26     import opendaylight-l2-types { prefix ethertype; revision-date "2013-08-27";}
27
28     import config {
29         prefix config; revision-date 2013-04-05;
30     }
31
32     revision "2015-03-31" {
33         description "ODL Interface Manager Module";
34     }
35
36     identity odl-interface {
37         status deprecated;
38         base "config:service-type";
39         config:java-class "org.opendaylight.vpnservice.interfacemgr.interfaces.IInterfaceManager";
40     }
41
42     identity stacked-vlan {
43         base if:interface-type;
44         reference "Q-in-Q interface";
45     }
46
47     identity mpls {
48         base if:interface-type;
49         reference "MPLS interface";
50     }
51
52     /* Tunnel (GRE, VxLAN) logical port */
53     identity l3tunnel {
54         status deprecated;
55         base if:interface-type;
56         reference "l3 tunnel interface";
57     }
58
59     identity tunnel-type-base {
60         description "Base identity for all tunnel-types";
61     }
62
63     identity tunnel-type-vxlan {
64         description "Tunnel type for vxlan tunnels";
65         base tunnel-type-base;
66     }
67
68     identity tunnel-type-gre {
69         description "Tunnel type for gre tunnels";
70         base tunnel-type-base;
71     }
72
73     /* base/common properties */
74     augment "/if:interfaces/if:interface" {
75         status deprecated;
76         ext:augment-identifier "base-ids";
77         leaf of-port-id {
78             type inv:node-connector-id;
79             description "can be a physical switch port or virtual switch port e.g. neutron port";
80         }
81     }
82
83     augment "/if:interfaces/if:interface" {
84         ext:augment-identifier "parent-refs";
85         leaf datapath-node-identifier {
86             type uint64;
87             description "can be a physical switch identifier (optional)";
88         }
89
90         leaf parent-interface {
91             type string;
92             description "can be a physical switch port or virtual switch port e.g. neutron port";
93         }
94     }
95
96     /* interface type specific properties */
97
98     /* VLAN logical port */
99     augment "/if:interfaces/if:interface" {
100         ext:augment-identifier "if-l2vlan";
101         when "if:type = 'ianaift:l2vlan'";
102         leaf vlan-id {
103             type ethertype:vlan-id;
104         }
105
106         leaf l2vlan-mode {
107             description "The VLAN mode of the L2Vlan Interface.";
108             type enumeration {
109                 enum "access" {
110                     value 1;
111                     description
112                         "The VLAN mode access.";
113                 }
114                 enum "native-tagged" {
115                     value 2;
116                     description
117                         "The VLAN mode native-tagged.";
118                 }
119                 enum "native-untagged" {
120                     value 3;
121                     description
122                         "The VLAN mode native-untagged.";
123                 }
124                 enum "trunk" {
125                     value 4;
126                     description
127                         "The VLAN mode trunk.";
128                 }
129                 enum "trunk-member" {
130                     value 5;
131                     description
132                         "The VLAN mode trunk-member.";
133                 }
134                 enum "transparent" {
135                     value 6;
136                     description
137                         "The VLAN mode transparent.";
138                 }
139             }
140         }
141     }
142
143     /* Q-in-Q logical port */
144     augment "/if:interfaces/if:interface" {
145         ext:augment-identifier "if-stacked-vlan";
146         when "if:type = 'stacked-vlan'";
147         leaf stacked_vlan-id {
148             type uint16 {
149                 range "1..4094";
150             }
151         }
152     }
153
154     augment "/if:interfaces/if:interface" {
155         ext:augment-identifier "if-tunnel";
156         when "if:type = 'ianaift:tunnel'";
157
158         leaf tunnel-interface-type {
159             type identityref {
160                 base tunnel-type-base;
161             }
162         }
163
164         leaf tunnel-source {
165             type inet:ip-address;
166             description "Local Endpoint IP address";
167         }
168
169         leaf tunnel-destination {
170             type inet:ip-address;
171             description "Remote Endpoint IP address";
172         }
173
174         leaf tunnel-gateway {
175             type inet:ip-address;
176             description "gateway IP address";
177         }
178     }
179
180     augment "/if:interfaces/if:interface" {
181         status deprecated;
182         ext:augment-identifier "if-l3tunnel";
183         when "if:type = 'ianaift:l3tunnel'";
184
185         leaf tunnel-type {
186             type identityref {
187                 base tunnel-type-base;
188             }
189         }
190
191         leaf local-ip {
192             type inet:ip-address;
193             description "Local Endpoint IP address";
194         }
195
196         leaf remote-ip {
197             type inet:ip-address;
198             description "Remote Endpoint IP address";
199         }
200
201         leaf gateway-ip {
202             type inet:ip-address;
203             description "gateway IP address";
204         }
205     }
206     /* MPLS logical port */
207     augment "/if:interfaces/if:interface" {
208         ext:augment-identifier "if-mpls";
209         when "if:type = 'mpls'";
210         leaf-list labelStack {
211             type uint32 {
212                 range "15..1048575";
213             }
214         }
215         leaf numLabels{
216             type uint8 {
217                 range "1..7";
218             }
219         }
220     }
221 }