3 namespace "urn:opendaylight:params:xml:ns:yang:v3po";
6 revision "2015-01-05" {
7 description "Initial revision of v3po model";
13 import ietf-interfaces {
16 import ietf-yang-types {
19 import ietf-inet-types {
29 typedef bridge-domain-ref {
31 path "/vpp/bridge-domains/bridge-domain/name";
34 "This type is used by to reference a bridge domain table";
37 typedef bridged-virtual-interface-ref {
39 path "/if:interfaces/if:interface/l2/bridged-virtual-interface";
42 "This type is used by to reference a bridged virtual interface";
45 identity vxlan-tunnel {
46 base if:interface-type;
50 base if:interface-type;
54 base if:interface-type;
58 // FIXME: should be in a vxlan-specific model
59 description "VNI used in a VXLAN tunnel";
65 typedef vhost-user-role {
72 identity vxlan-gpe-tunnel {
73 base if:interface-type;
76 typedef vxlan-gpe-vni {
77 description "VNI used in a VXLAN-GPE tunnel";
83 typedef vxlan-gpe-next-protocol {
92 grouping bridge-domain-attributes {
97 "Enable/disable L2 flooding.";
103 "Enable/disable L2 forwarding.";
109 "Enable/disable L2 learning.";
111 leaf unknown-unicast-flood {
115 leaf arp-termination {
121 grouping tap-interface-base-attributes {
127 grouping tap-interface-config-attributes {
129 type yang:phys-address;
131 description "Mac address to be set for the tap interface. Random will be used if not configured";
134 leaf device-instance {
137 description "Custom device instance. Autogenerated will be used if not configured";
141 grouping ethernet-base-attributes {
149 "The size, in octets, of the largest packet that the
150 hardware interface will send and receive.";
154 grouping ethernet-state-attributes {
155 leaf manufacturer-description {
168 grouping vhost-user-interface-base-attributes {
175 type vhost-user-role;
178 description "vhost-user settings";
181 grouping vhost-user-interface-state-attributes {
186 leaf virtio-net-hdr-size {
190 leaf num-memory-regions {
200 grouping vxlan-base-attributes {
201 // FIXME: this should be in an vxlan-specific extension
204 type inet:ip-address;
208 type inet:ip-address;
219 grouping vxlan-gpe-base-attributes {
222 type inet:ip-address;
226 type inet:ip-address;
233 type vxlan-gpe-next-protocol;
243 grouping l2-base-attributes {
245 "Parameters for configuring Layer2 features on interfaces.";
247 choice interconnection {
248 case xconnect-based {
249 leaf xconnect-outgoing-interface {
250 /* Don't allow selection of this interface */
251 must "../../if:name != current()";
252 type if:interface-ref; // todo use interface-state-ref for operational data?
259 type bridge-domain-ref;
261 "Interfaces in a bridge-domain forward packets to other
262 interfaces in the same bridge-domain based on
263 destination mac address.";
265 leaf split-horizon-group {
266 when "../bridge-domain";
272 "Interface's split-horizon group. Interfaces in the same
273 bridge-domain and split-horizon group can not forward
274 packets between each other. ";
276 leaf bridged-virtual-interface {
277 when "../bridge-domain";
281 "Interface forward packets in the bridge-domain
282 associated with the BVI.";
288 augment /if:interfaces/if:interface {
289 ext:augment-identifier "vpp-interface-augmentation";
291 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
292 // 1. The link between interface type and this augmentation is unclear
293 // 2. Only this augmentation with combination of ifc type is trigger to do something for vpp, what if user only configures base interface stuff ? + We need to get leaves defined by ietf-interfaces when we are processing this augment
294 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
297 when "../if:type = 'v3po:tap'";
298 uses tap-interface-base-attributes;
299 uses tap-interface-config-attributes;
303 when "../if:type = 'ianaift:ethernetCsmacd'";
304 uses ethernet-base-attributes;
308 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
314 container vhost-user {
315 when "../if:type = 'v3po:vhost-user'";
316 uses vhost-user-interface-base-attributes;
320 when "../if:type = 'v3po:vxlan-tunnel'";
321 uses vxlan-base-attributes;
325 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
326 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
328 uses l2-base-attributes;
331 container vxlan-gpe {
332 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
334 uses vxlan-gpe-base-attributes;
342 container bridge-domains {
350 uses bridge-domain-attributes;
356 type yang:phys-address;
365 leaf outgoing-interface {
366 type if:interface-ref;
373 augment /if:interfaces-state/if:interface {
374 ext:augment-identifier "vpp-interface-state-augmentation";
381 when "../if:type = 'v3po:tap'";
382 uses tap-interface-base-attributes;
386 when "../if:type = 'ianaift:ethernetCsmacd'";
387 uses ethernet-base-attributes;
388 uses ethernet-state-attributes;
391 container vhost-user {
392 when "../if:type = 'v3po:vhost-user'";
393 uses vhost-user-interface-base-attributes;
394 uses vhost-user-interface-state-attributes;
398 when "../if:type = 'v3po:vxlan-tunnel'";
399 uses vxlan-base-attributes;
401 container vxlan-gpe {
402 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
404 uses vxlan-gpe-base-attributes;
408 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
409 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
411 uses l2-base-attributes;
415 augment /if:interfaces-state/if:interface/if:statistics {
416 ext:augment-identifier "vpp-interface-statistics-augmentation";
417 leaf in-errors-no-buf {
420 leaf in-errors-miss {
423 leaf out-discards-fifo-full {
428 container vpp-state {
432 "VPP operational data";
434 container bridge-domains {
435 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
443 uses bridge-domain-attributes;
449 type if:interface-state-ref;
452 leaf split-horizon-group {
456 leaf bridged-virtual-interface {
465 type yang:phys-address;
470 leaf outgoing-interface {
471 when "../v3po:action = 'forward'";
472 type if:interface-state-ref;
481 leaf bridged-virtual-interface {
482 when "../v3po:action = 'forward'";
487 "bridge-domain operational data";
495 leaf build-directory {