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 // todo remove from v3po
53 typedef tag-rewrite-operation {
60 enum translate-1-to-1;
61 enum translate-1-to-2;
62 enum translate-2-to-1;
63 enum translate-2-to-2;
73 identity vxlan-tunnel {
74 base if:interface-type;
78 base if:interface-type;
82 base if:interface-type;
85 identity sub-interface {
86 base if:interface-type;
90 // FIXME: should be in a vxlan-specific model
91 description "VNI used in a VXLAN tunnel";
97 typedef vhost-user-role {
104 identity vxlan-gpe-tunnel {
105 base if:interface-type;
108 typedef vxlan-gpe-vni {
109 description "VNI used in a VXLAN-GPE tunnel";
115 typedef vxlan-gpe-next-protocol {
124 grouping bridge-domain-attributes {
129 "Enable/disable L2 flooding.";
135 "Enable/disable L2 forwarding.";
141 "Enable/disable L2 learning.";
143 leaf unknown-unicast-flood {
147 leaf arp-termination {
153 // todo remove from v3po
154 grouping sub-interface-base-attributes {
162 leaf number-of-tags {
174 leaf match-any-outer-id {
177 leaf match-any-inner-id {
188 grouping tap-interface-base-attributes {
194 grouping tap-interface-config-attributes {
196 type yang:phys-address;
198 description "Mac address to be set for the tap interface. Random will be used if not configured";
201 leaf device-instance {
204 description "Custom device instance. Autogenerated will be used if not configured";
208 grouping ethernet-base-attributes {
216 "The size, in octets, of the largest packet that the
217 hardware interface will send and receive.";
221 grouping ethernet-state-attributes {
222 leaf manufacturer-description {
235 grouping vhost-user-interface-base-attributes {
242 type vhost-user-role;
245 description "vhost-user settings";
248 grouping vhost-user-interface-state-attributes {
253 leaf virtio-net-hdr-size {
257 leaf num-memory-regions {
267 grouping vxlan-base-attributes {
268 // FIXME: this should be in an vxlan-specific extension
271 type inet:ip-address;
275 type inet:ip-address;
286 grouping vxlan-gpe-base-attributes {
289 type inet:ip-address;
293 type inet:ip-address;
300 type vxlan-gpe-next-protocol;
310 grouping vlan-tag-rewrite-attributes {
311 leaf rewrite-operation {
312 type tag-rewrite-operation;
327 grouping l2-base-attributes {
329 "Parameters for configuring Layer2 features on interfaces.";
331 choice interconnection {
332 case xconnect-based {
333 leaf xconnect-outgoing-interface {
334 /* Don't allow selection of this interface */
335 must "../../if:name != current()";
336 type if:interface-ref; // todo use interface-state-ref for operational data?
343 type bridge-domain-ref;
345 "Interfaces in a bridge-domain forward packets to other
346 interfaces in the same bridge-domain based on
347 destination mac address.";
349 leaf split-horizon-group {
350 when "../bridge-domain";
356 "Interface's split-horizon group. Interfaces in the same
357 bridge-domain and split-horizon group can not forward
358 packets between each other. ";
360 leaf bridged-virtual-interface {
361 when "../bridge-domain";
365 "Interface forward packets in the bridge-domain
366 associated with the BVI.";
372 augment /if:interfaces/if:interface {
373 ext:augment-identifier "vpp-interface-augmentation";
375 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
376 // 1. The link between interface type and this augmentation is unclear
377 // 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
378 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
380 container sub-interface {
381 when "../if:type = 'v3po:sub-interface'";
382 leaf super-interface {
383 type if:interface-ref;
385 uses sub-interface-base-attributes;
389 when "../if:type = 'v3po:tap'";
390 uses tap-interface-base-attributes;
391 uses tap-interface-config-attributes;
395 when "../if:type = 'ianaift:ethernetCsmacd'";
396 uses ethernet-base-attributes;
400 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
406 container vhost-user {
407 when "../if:type = 'v3po:vhost-user'";
408 uses vhost-user-interface-base-attributes;
412 when "../if:type = 'v3po:vxlan-tunnel'";
413 uses vxlan-base-attributes;
417 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
418 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
420 uses l2-base-attributes;
422 container vlan-tag-rewrite {
423 uses vlan-tag-rewrite-attributes;
427 container vxlan-gpe {
428 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
430 uses vxlan-gpe-base-attributes;
438 container bridge-domains {
441 // TODO: where does this come from?
448 uses bridge-domain-attributes;
454 type yang:phys-address;
463 leaf outgoing-interface {
464 type if:interface-ref;
471 augment /if:interfaces-state/if:interface {
472 ext:augment-identifier "vpp-interface-state-augmentation";
478 container sub-interface {
479 when "../if:type = 'v3po:sub-interface'";
480 leaf super-interface {
481 type if:interface-state-ref;
483 uses sub-interface-base-attributes;
487 when "../if:type = 'v3po:tap'";
488 uses tap-interface-base-attributes;
492 when "../if:type = 'ianaift:ethernetCsmacd'";
493 uses ethernet-base-attributes;
494 uses ethernet-state-attributes;
497 container vhost-user {
498 when "../if:type = 'v3po:vhost-user'";
499 uses vhost-user-interface-base-attributes;
500 uses vhost-user-interface-state-attributes;
504 when "../if:type = 'v3po:vxlan-tunnel'";
505 uses vxlan-base-attributes;
507 container vxlan-gpe {
508 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
510 uses vxlan-gpe-base-attributes;
514 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
515 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
517 uses l2-base-attributes;
519 container vlan-tag-rewrite {
520 uses vlan-tag-rewrite-attributes;
525 augment /if:interfaces-state/if:interface/if:statistics {
526 ext:augment-identifier "vpp-interface-statistics-augmentation";
527 leaf in-errors-no-buf {
530 leaf in-errors-miss {
533 leaf out-discards-fifo-full {
538 container vpp-state {
542 "VPP operational data";
544 container bridge-domains {
545 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
553 uses bridge-domain-attributes;
559 type if:interface-state-ref;
562 leaf split-horizon-group {
566 leaf bridged-virtual-interface {
575 type yang:phys-address;
580 leaf outgoing-interface {
581 when "../v3po:action = 'forward'";
582 type if:interface-state-ref;
591 leaf bridged-virtual-interface {
592 when "../v3po:action = 'forward'";
597 "bridge-domain operational data";
605 leaf build-directory {