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";
52 typedef tag-rewrite-operation {
59 enum translate-1-to-1;
60 enum translate-1-to-2;
61 enum translate-2-to-1;
62 enum translate-2-to-2;
72 identity vxlan-tunnel {
73 base if:interface-type;
77 base if:interface-type;
81 base if:interface-type;
84 identity sub-interface {
85 base if:interface-type;
89 // FIXME: should be in a vxlan-specific model
90 description "VNI used in a VXLAN tunnel";
96 typedef vhost-user-role {
103 identity vxlan-gpe-tunnel {
104 base if:interface-type;
107 typedef vxlan-gpe-vni {
108 description "VNI used in a VXLAN-GPE tunnel";
114 typedef vxlan-gpe-next-protocol {
123 grouping bridge-domain-attributes {
128 "Enable/disable L2 flooding.";
134 "Enable/disable L2 forwarding.";
140 "Enable/disable L2 learning.";
142 leaf unknown-unicast-flood {
146 leaf arp-termination {
152 grouping sub-interface-base-attributes {
160 leaf number-of-tags {
172 leaf match-any-outer-id {
175 leaf match-any-inner-id {
186 grouping tap-interface-base-attributes {
192 grouping tap-interface-config-attributes {
194 type yang:phys-address;
196 description "Mac address to be set for the tap interface. Random will be used if not configured";
199 leaf device-instance {
202 description "Custom device instance. Autogenerated will be used if not configured";
206 grouping ethernet-base-attributes {
214 "The size, in octets, of the largest packet that the
215 hardware interface will send and receive.";
219 grouping ethernet-state-attributes {
220 leaf manufacturer-description {
233 grouping vhost-user-interface-base-attributes {
240 type vhost-user-role;
243 description "vhost-user settings";
246 grouping vhost-user-interface-state-attributes {
251 leaf virtio-net-hdr-size {
255 leaf num-memory-regions {
265 grouping vxlan-base-attributes {
266 // FIXME: this should be in an vxlan-specific extension
269 type inet:ip-address;
273 type inet:ip-address;
284 grouping vxlan-gpe-base-attributes {
287 type inet:ip-address;
291 type inet:ip-address;
298 type vxlan-gpe-next-protocol;
308 grouping vlan-tag-rewrite-attributes {
309 leaf rewrite-operation {
310 type tag-rewrite-operation;
325 grouping l2-attributes {
327 "Parameters for configuring Layer2 features on interfaces.";
329 choice interconnection {
330 case xconnect-based {
331 leaf xconnect-outgoing-interface {
332 /* Don't allow selection of this interface */
333 must "../../if:name != current()";
334 type if:interface-ref; // todo use interface-state-ref for operational data?
341 type bridge-domain-ref;
343 "Interfaces in a bridge-domain forward packets to other
344 interfaces in the same bridge-domain based on
345 destination mac address.";
347 leaf split-horizon-group {
348 when "../bridge-domain";
354 "Interface's split-horizon group. Interfaces in the same
355 bridge-domain and split-horizon group can not forward
356 packets between each other. ";
358 leaf bridged-virtual-interface {
359 when "../bridge-domain";
363 "Interface forward packets in the bridge-domain
364 associated with the BVI.";
368 container vlan-tag-rewrite { // todo valid only for sub-interfaces
369 uses vlan-tag-rewrite-attributes;
373 augment /if:interfaces/if:interface {
374 ext:augment-identifier "vpp-interface-augmentation";
376 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
377 // 1. The link between interface type and this augmentation is unclear
378 // 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
379 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
381 container sub-interface {
382 when "../if:type = 'v3po:sub-interface'";
383 leaf super-interface {
384 type if:interface-ref;
386 uses sub-interface-base-attributes;
390 when "../if:type = 'v3po:tap'";
391 uses tap-interface-base-attributes;
392 uses tap-interface-config-attributes;
396 when "../if:type = 'ianaift:ethernetCsmacd'";
397 uses ethernet-base-attributes;
401 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
407 container vhost-user {
408 when "../if:type = 'v3po:vhost-user'";
409 uses vhost-user-interface-base-attributes;
413 when "../if:type = 'v3po:vxlan-tunnel'";
414 uses vxlan-base-attributes;
418 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
419 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
424 container vxlan-gpe {
425 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
427 uses vxlan-gpe-base-attributes;
435 container bridge-domains {
438 // TODO: where does this come from?
445 uses bridge-domain-attributes;
451 type yang:phys-address;
460 leaf outgoing-interface {
461 type if:interface-ref;
468 augment /if:interfaces-state/if:interface {
469 ext:augment-identifier "vpp-interface-state-augmentation";
475 container sub-interface {
476 when "../if:type = 'v3po:sub-interface'";
477 leaf super-interface {
478 type if:interface-state-ref;
480 uses sub-interface-base-attributes;
484 when "../if:type = 'v3po:tap'";
485 uses tap-interface-base-attributes;
489 when "../if:type = 'ianaift:ethernetCsmacd'";
490 uses ethernet-base-attributes;
491 uses ethernet-state-attributes;
494 container vhost-user {
495 when "../if:type = 'v3po:vhost-user'";
496 uses vhost-user-interface-base-attributes;
497 uses vhost-user-interface-state-attributes;
501 when "../if:type = 'v3po:vxlan-tunnel'";
502 uses vxlan-base-attributes;
504 container vxlan-gpe {
505 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
507 uses vxlan-gpe-base-attributes;
511 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
512 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
518 augment /if:interfaces-state/if:interface/if:statistics {
519 ext:augment-identifier "vpp-interface-statistics-augmentation";
520 leaf in-errors-no-buf {
523 leaf in-errors-miss {
526 leaf out-discards-fifo-full {
531 container vpp-state {
535 "VPP operational data";
537 container bridge-domains {
538 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
546 uses bridge-domain-attributes;
552 type if:interface-state-ref;
555 leaf split-horizon-group {
559 leaf bridged-virtual-interface {
568 type yang:phys-address;
573 leaf outgoing-interface {
574 when "../v3po:action = 'forward'";
575 type if:interface-state-ref;
584 leaf bridged-virtual-interface {
585 when "../v3po:action = 'forward'";
590 "bridge-domain operational data";
598 leaf build-directory {