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 {
28 import vpp-classifier {
29 prefix "vpp-classifier";
32 typedef bridge-domain-ref {
34 path "/vpp/bridge-domains/bridge-domain/name";
37 "This type is used by to reference a bridge domain table";
40 typedef bridged-virtual-interface-ref {
42 path "/if:interfaces/if:interface/l2/bridged-virtual-interface";
45 "This type is used by to reference a bridged virtual interface";
48 identity vxlan-tunnel {
49 base if:interface-type;
53 base if:interface-type;
57 base if:interface-type;
61 base if:interface-type;
64 identity l2-fib-action {
65 description "Base identity for l2-fib actions";
68 identity l2-fib-forward {
71 "Forwards packet with configured mac address";
74 identity l2-fib-filter {
77 "Drops packet with configured mac address";
80 typedef l2-fib-action {
84 description "Identifies a specific L2 FIB action";
88 // FIXME: should be in a vxlan-specific model
89 description "VNI used in a VXLAN tunnel";
95 typedef vhost-user-role {
102 identity vxlan-gpe-tunnel {
103 base if:interface-type;
106 typedef vxlan-gpe-vni {
107 description "VNI used in a VXLAN-GPE tunnel";
113 typedef vxlan-gpe-next-protocol {
130 grouping bridge-domain-attributes {
135 "Enable/disable L2 flooding.";
141 "Enable/disable L2 forwarding.";
147 "Enable/disable L2 learning.";
149 leaf unknown-unicast-flood {
153 leaf arp-termination {
158 container arp-termination-table {
159 when "../v3po:arp-termination = 'true'";
161 // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done)
162 list arp-termination-table-entry {
163 key "ip-address phys-address";
165 // FIXME: change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved
166 type inet:ip-address;
169 type yang:phys-address;
175 // TODO express constraints for L2 FIB entries in YANG if possible
176 grouping l2-fib-attributes {
177 container l2-fib-table {
182 type yang:phys-address;
185 leaf outgoing-interface {
188 // mandatory for forward action
189 // FIXME VPP's CLI does not require to set iface id for filter action
190 // VPP's binary api in constrast to CLI does some checks on the iface id value,
191 // so currently it has to be set for all actions
193 "One of interfaces assigned to the FIB table's bridge-domain.";
199 "Static entries cannot be overridden by mac learning.";
205 "L2 FIB action. For filter action, entry must be configured as static.";
207 leaf bridged-virtual-interface {
208 when "../action = 'forward'";
210 config false; // FIXME setting bvi is currently not supported by VPP's binary api
216 grouping tap-interface-base-attributes {
219 pattern "[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*";
224 grouping tap-interface-config-attributes {
226 type yang:phys-address;
228 description "Mac address to be set for the tap interface. Random will be used if not configured";
231 leaf device-instance {
234 description "Custom device instance. Autogenerated will be used if not configured";
238 grouping ethernet-base-attributes {
246 "The size, in octets, of the largest packet that the
247 hardware interface will send and receive.";
251 grouping ethernet-state-attributes {
252 leaf manufacturer-description {
265 grouping vhost-user-interface-base-attributes {
272 type vhost-user-role;
275 description "vhost-user settings";
278 grouping vhost-user-interface-state-attributes {
283 leaf virtio-net-hdr-size {
287 leaf num-memory-regions {
297 grouping vxlan-base-attributes {
298 // FIXME: this should be in an vxlan-specific extension
301 type inet:ip-address;
305 type inet:ip-address;
316 grouping gre-base-attributes {
319 type inet:ip-address;
323 type inet:ip-address;
330 grouping vxlan-gpe-base-attributes {
333 type inet:ip-address;
337 type inet:ip-address;
344 type vxlan-gpe-next-protocol;
354 grouping l2-base-attributes {
356 "Parameters for configuring Layer2 features on interfaces.";
358 choice interconnection {
359 case xconnect-based {
360 leaf xconnect-outgoing-interface {
361 /* Don't allow selection of this interface */
362 must "../../if:name != current()";
363 type if:interface-ref; // todo use interface-state-ref for operational data?
370 type bridge-domain-ref;
373 "Interfaces in a bridge-domain forward packets to other
374 interfaces in the same bridge-domain based on
375 destination mac address.";
377 leaf split-horizon-group {
378 when "../bridge-domain";
382 default 0; //no split horizon group
384 "Interface's split-horizon group. Interfaces in the same
385 bridge-domain and split-horizon group can not forward
386 packets between each other. ";
388 leaf bridged-virtual-interface {
389 when "../bridge-domain";
393 "Interface forward packets in the bridge-domain
394 associated with the BVI.";
400 grouping acl-base-attributes {
402 "Defines references to classify tables.
403 At least one table reference should be specified.";
405 leaf classify-table {
406 type vpp-classifier:classify-table-ref;
412 leaf classify-table {
413 type vpp-classifier:classify-table-ref;
419 leaf classify-table {
420 type vpp-classifier:classify-table-ref;
427 augment /if:interfaces/if:interface {
428 ext:augment-identifier "vpp-interface-augmentation";
430 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
431 // 1. The link between interface type and this augmentation is unclear
432 // 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
433 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
436 when "../if:type = 'v3po:tap'";
437 uses tap-interface-base-attributes;
438 uses tap-interface-config-attributes;
442 when "../if:type = 'ianaift:ethernetCsmacd'";
443 uses ethernet-base-attributes;
447 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
453 container vhost-user {
454 when "../if:type = 'v3po:vhost-user'";
455 uses vhost-user-interface-base-attributes;
459 when "../if:type = 'v3po:vxlan-tunnel'";
460 uses vxlan-base-attributes;
464 when "../if:type = 'v3po:gre-tunnel'";
465 uses gre-base-attributes;
469 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
470 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
472 uses l2-base-attributes;
475 container vxlan-gpe {
476 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
478 uses vxlan-gpe-base-attributes;
482 uses acl-base-attributes;
490 container bridge-domains {
498 uses bridge-domain-attributes;
499 uses l2-fib-attributes;
502 "bridge-domain configuration";
507 augment /if:interfaces-state/if:interface {
508 ext:augment-identifier "vpp-interface-state-augmentation";
515 when "../if:type = 'v3po:tap'";
516 uses tap-interface-base-attributes;
520 when "../if:type = 'ianaift:ethernetCsmacd'";
521 uses ethernet-base-attributes;
522 uses ethernet-state-attributes;
525 container vhost-user {
526 when "../if:type = 'v3po:vhost-user'";
527 uses vhost-user-interface-base-attributes;
528 uses vhost-user-interface-state-attributes;
532 when "../if:type = 'v3po:vxlan-tunnel'";
533 uses vxlan-base-attributes;
535 container vxlan-gpe {
536 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
538 uses vxlan-gpe-base-attributes;
542 when "../if:type = 'gre-tunnel'";
543 uses gre-base-attributes;
547 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
548 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
550 uses l2-base-attributes;
554 uses acl-base-attributes;
558 augment /if:interfaces-state/if:interface/if:statistics {
559 ext:augment-identifier "vpp-interface-statistics-augmentation";
560 leaf in-errors-no-buf {
563 leaf in-errors-miss {
566 leaf out-discards-fifo-full {
571 container vpp-state {
575 "VPP operational data";
577 container bridge-domains {
578 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
586 uses bridge-domain-attributes;
587 uses l2-fib-attributes;
590 "bridge-domain operational data";
598 leaf build-directory {
614 typedef interface-status {
625 typedef interface-name-or-index {
632 notification interface-state-change {
634 type interface-name-or-index;
638 type interface-status;
642 type interface-status;
646 notification interface-deleted {
648 type interface-name-or-index;