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";
31 import ietf-access-control-list {
35 typedef bridge-domain-ref {
37 path "/vpp/bridge-domains/bridge-domain/name";
40 "This type is used by to reference a bridge domain table";
43 typedef bridged-virtual-interface-ref {
45 path "/if:interfaces/if:interface/l2/bridged-virtual-interface";
48 "This type is used by to reference a bridged virtual interface";
51 identity vxlan-tunnel {
52 base if:interface-type;
56 base if:interface-type;
60 base if:interface-type;
64 base if:interface-type;
67 identity l2-fib-action {
68 description "Base identity for l2-fib actions";
71 identity l2-fib-forward {
74 "Forwards packet with configured mac address";
77 identity l2-fib-filter {
80 "Drops packet with configured mac address";
83 typedef l2-fib-action {
87 description "Identifies a specific L2 FIB action";
91 // FIXME: should be in a vxlan-specific model
92 description "VNI used in a VXLAN tunnel";
98 typedef vhost-user-role {
105 identity vxlan-gpe-tunnel {
106 base if:interface-type;
109 typedef vxlan-gpe-vni {
110 description "VNI used in a VXLAN-GPE tunnel";
116 typedef vxlan-gpe-next-protocol {
133 grouping bridge-domain-attributes {
138 "Enable/disable L2 flooding.";
144 "Enable/disable L2 forwarding.";
150 "Enable/disable L2 learning.";
152 leaf unknown-unicast-flood {
156 leaf arp-termination {
161 container arp-termination-table {
162 when "../v3po:arp-termination = 'true'";
164 // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done)
165 list arp-termination-table-entry {
166 key "ip-address phys-address";
168 // FIXME: change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved
169 type inet:ip-address;
172 type yang:phys-address;
178 // TODO express constraints for L2 FIB entries in YANG if possible
179 grouping l2-fib-attributes {
180 container l2-fib-table {
185 type yang:phys-address;
188 leaf outgoing-interface {
191 // mandatory for forward action
192 // FIXME VPP's CLI does not require to set iface id for filter action
193 // VPP's binary api in constrast to CLI does some checks on the iface id value,
194 // so currently it has to be set for all actions
196 "One of interfaces assigned to the FIB table's bridge-domain.";
202 "Static entries cannot be overridden by mac learning.";
208 "L2 FIB action. For filter action, entry must be configured as static.";
210 leaf bridged-virtual-interface {
211 when "../action = 'forward'";
213 config false; // FIXME setting bvi is currently not supported by VPP's binary api
219 grouping tap-interface-base-attributes {
222 pattern "[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*";
227 grouping tap-interface-config-attributes {
229 type yang:phys-address;
231 description "Mac address to be set for the tap interface. Random will be used if not configured";
234 leaf device-instance {
237 description "Custom device instance. Autogenerated will be used if not configured";
241 grouping ethernet-base-attributes {
249 "The size, in octets, of the largest packet that the
250 hardware interface will send and receive.";
254 grouping ethernet-state-attributes {
255 leaf manufacturer-description {
268 grouping vhost-user-interface-base-attributes {
275 type vhost-user-role;
278 description "vhost-user settings";
281 grouping vhost-user-interface-state-attributes {
286 leaf virtio-net-hdr-size {
290 leaf num-memory-regions {
300 grouping vxlan-base-attributes {
301 // FIXME: this should be in an vxlan-specific extension
304 type inet:ip-address;
308 type inet:ip-address;
319 grouping gre-base-attributes {
322 type inet:ip-address;
326 type inet:ip-address;
333 grouping vxlan-gpe-base-attributes {
336 type inet:ip-address;
340 type inet:ip-address;
347 type vxlan-gpe-next-protocol;
357 grouping l2-base-attributes {
359 "Parameters for configuring Layer2 features on interfaces.";
361 choice interconnection {
362 case xconnect-based {
363 leaf xconnect-outgoing-interface {
364 /* Don't allow selection of this interface */
365 must "../../if:name != current()";
366 type if:interface-ref; // todo use interface-state-ref for operational data?
373 type bridge-domain-ref;
376 "Interfaces in a bridge-domain forward packets to other
377 interfaces in the same bridge-domain based on
378 destination mac address.";
380 leaf split-horizon-group {
381 when "../bridge-domain";
385 default 0; //no split horizon group
387 "Interface's split-horizon group. Interfaces in the same
388 bridge-domain and split-horizon group can not forward
389 packets between each other. ";
391 leaf bridged-virtual-interface {
392 when "../bridge-domain";
396 "Interface forward packets in the bridge-domain
397 associated with the BVI.";
403 grouping proxy-arp-attributes {
405 "Parameters for configuring Proxy ARP on interfaces.";
412 type inet:ipv4-address;
415 type inet:ipv4-address;
419 grouping acl-base-attributes {
421 "Defines references to classify tables.
422 At least one table reference should be specified.";
424 leaf classify-table {
425 type vpp-classifier:classify-table-ref;
431 leaf classify-table {
432 type vpp-classifier:classify-table-ref;
438 leaf classify-table {
439 type vpp-classifier:classify-table-ref;
446 grouping ietf-acl-base-attributes {
448 "Provides limited support for ietf-acl model.";
450 container access-lists {
452 "Defines references to ietf-acl lists. Before assignment to interface,
453 ACL lists are merged into 3 type of acls (eth0, ip4 and ip6) that are supported by vpp.
454 Then corresponding tables and sessions are created and assigned to the interface.
456 Assignment update/delete removes all created tables and sessions and repeats process described above.
457 Update/delete of ACL lists referenced here is not permitted (assignment needs to be removed first).
459 Read is supported only for acls that were created and assigned by Honeycomb agent
460 (corresponding metadata are present).";
469 type acl:access-control-list-ref;
475 augment /if:interfaces/if:interface {
476 ext:augment-identifier "vpp-interface-augmentation";
478 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
479 // 1. The link between interface type and this augmentation is unclear
480 // 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
481 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
484 when "../if:type = 'v3po:tap'";
485 uses tap-interface-base-attributes;
486 uses tap-interface-config-attributes;
490 when "../if:type = 'ianaift:ethernetCsmacd'";
491 uses ethernet-base-attributes;
495 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
501 container vhost-user {
502 when "../if:type = 'v3po:vhost-user'";
503 uses vhost-user-interface-base-attributes;
507 when "../if:type = 'v3po:vxlan-tunnel'";
508 uses vxlan-base-attributes;
512 when "../if:type = 'v3po:gre-tunnel'";
513 uses gre-base-attributes;
517 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
518 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
520 uses l2-base-attributes;
523 container vxlan-gpe {
524 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
526 uses vxlan-gpe-base-attributes;
529 container proxy-arp {
530 uses proxy-arp-attributes;
535 uses acl-base-attributes;
538 uses acl-base-attributes;
544 uses ietf-acl-base-attributes;
547 uses ietf-acl-base-attributes;
556 container bridge-domains {
564 uses bridge-domain-attributes;
565 uses l2-fib-attributes;
568 "bridge-domain configuration";
573 augment /if:interfaces-state/if:interface {
574 ext:augment-identifier "vpp-interface-state-augmentation";
581 when "../if:type = 'v3po:tap'";
582 uses tap-interface-base-attributes;
586 when "../if:type = 'ianaift:ethernetCsmacd'";
587 uses ethernet-base-attributes;
588 uses ethernet-state-attributes;
591 container vhost-user {
592 when "../if:type = 'v3po:vhost-user'";
593 uses vhost-user-interface-base-attributes;
594 uses vhost-user-interface-state-attributes;
598 when "../if:type = 'v3po:vxlan-tunnel'";
599 uses vxlan-base-attributes;
601 container vxlan-gpe {
602 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
604 uses vxlan-gpe-base-attributes;
608 when "../if:type = 'gre-tunnel'";
609 uses gre-base-attributes;
613 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
614 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
616 uses l2-base-attributes;
619 container proxy-arp {
620 uses proxy-arp-attributes;
625 uses acl-base-attributes;
628 uses acl-base-attributes;
634 uses ietf-acl-base-attributes;
637 uses ietf-acl-base-attributes;
642 augment /if:interfaces-state/if:interface/if:statistics {
643 ext:augment-identifier "vpp-interface-statistics-augmentation";
644 leaf in-errors-no-buf {
647 leaf in-errors-miss {
650 leaf out-discards-fifo-full {
655 container vpp-state {
659 "VPP operational data";
661 container bridge-domains {
662 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
670 uses bridge-domain-attributes;
671 uses l2-fib-attributes;
674 "bridge-domain operational data";
682 leaf build-directory {
698 typedef interface-status {
709 typedef interface-name-or-index {
716 notification interface-state-change {
718 type interface-name-or-index;
722 type interface-status;
726 type interface-status;
730 notification interface-deleted {
732 type interface-name-or-index;