3 namespace "urn:opendaylight:params:xml:ns:yang:v3po";
6 revision "2016-12-14" {
8 "This revision adds the following new features:
9 - ingress/egress ACLs support
10 - moved ACL definitions to vpp-acl module
11 - updated l2 container constraint (permit IP address on BVI interface)
12 - added PID of vpp process to vpp-state";
15 revision "2015-01-05" {
16 description "Initial revision of v3po model";
22 import ietf-interfaces {
25 import ietf-yang-types {
28 import ietf-inet-types {
41 typedef bridge-domain-ref {
43 path "/vpp/bridge-domains/bridge-domain/name";
46 "This type is used by to reference a bridge domain table";
49 typedef bridged-virtual-interface-ref {
51 path "/if:interfaces/if:interface/l2/bridged-virtual-interface";
54 "This type is used by to reference a bridged virtual interface";
57 identity vxlan-tunnel {
58 base if:interface-type;
62 base if:interface-type;
66 base if:interface-type;
70 base if:interface-type;
73 identity l2-fib-action {
74 description "Base identity for l2-fib actions";
77 identity l2-fib-forward {
80 "Forwards packet with configured mac address";
83 identity l2-fib-filter {
86 "Drops packet with configured mac address";
89 typedef l2-fib-action {
93 description "Identifies a specific L2 FIB action";
97 // FIXME: should be in a vxlan-specific model
98 description "VNI used in a VXLAN tunnel";
104 typedef vhost-user-role {
111 identity vxlan-gpe-tunnel {
112 base if:interface-type;
115 typedef vxlan-gpe-vni {
116 description "VNI used in a VXLAN-GPE tunnel";
122 typedef vxlan-gpe-next-protocol {
139 grouping bridge-domain-attributes {
144 "Enable/disable L2 flooding.";
150 "Enable/disable L2 forwarding.";
156 "Enable/disable L2 learning.";
158 leaf unknown-unicast-flood {
162 leaf arp-termination {
167 container arp-termination-table {
168 when "../v3po:arp-termination = 'true'";
170 // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done)
171 list arp-termination-table-entry {
172 key "ip-address phys-address";
174 // FIXME: change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved
175 type inet:ip-address;
178 type yang:phys-address;
184 // TODO express constraints for L2 FIB entries in YANG if possible
185 grouping l2-fib-attributes {
186 container l2-fib-table {
191 type yang:phys-address;
194 leaf outgoing-interface {
197 // mandatory for forward action
198 // FIXME VPP's CLI does not require to set iface id for filter action
199 // VPP's binary api in constrast to CLI does some checks on the iface id value,
200 // so currently it has to be set for all actions
202 "One of interfaces assigned to the FIB table's bridge-domain.";
208 "Static entries cannot be overridden by mac learning.";
214 "L2 FIB action. For filter action, entry must be configured as static.";
216 leaf bridged-virtual-interface {
217 when "../action = 'forward'";
219 config false; // FIXME setting bvi is currently not supported by VPP's binary api
225 grouping tap-interface-base-attributes {
228 pattern "[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*";
233 grouping tap-interface-config-attributes {
235 type yang:phys-address;
237 description "Mac address to be set for the tap interface. Random will be used if not configured";
240 leaf device-instance {
243 description "Custom device instance. Autogenerated will be used if not configured";
247 grouping ethernet-base-attributes {
255 "The size, in octets, of the largest packet that the
256 hardware interface will send and receive.";
260 grouping ethernet-state-attributes {
261 leaf manufacturer-description {
274 grouping vhost-user-interface-base-attributes {
281 type vhost-user-role;
284 description "vhost-user settings";
287 grouping vhost-user-interface-state-attributes {
292 leaf virtio-net-hdr-size {
296 leaf num-memory-regions {
306 grouping vxlan-base-attributes {
307 // FIXME: this should be in an vxlan-specific extension
310 type inet:ip-address;
314 type inet:ip-address;
325 grouping gre-base-attributes {
328 type inet:ip-address;
332 type inet:ip-address;
339 grouping vxlan-gpe-base-attributes {
342 type inet:ip-address;
346 type inet:ip-address;
353 type vxlan-gpe-next-protocol;
363 grouping l2-base-attributes {
365 "Parameters for configuring Layer2 features on interfaces.";
367 choice interconnection {
368 case xconnect-based {
369 leaf xconnect-outgoing-interface {
370 /* Don't allow selection of this interface */
371 must "../../if:name != current()";
372 type if:interface-ref; // todo use interface-state-ref for operational data?
379 type bridge-domain-ref;
382 "Interfaces in a bridge-domain forward packets to other
383 interfaces in the same bridge-domain based on
384 destination mac address.";
386 leaf split-horizon-group {
387 when "../bridge-domain";
391 default 0; //no split horizon group
393 "Interface's split-horizon group. Interfaces in the same
394 bridge-domain and split-horizon group can not forward
395 packets between each other. ";
397 leaf bridged-virtual-interface {
398 when "../bridge-domain";
402 "Interface forward packets in the bridge-domain
403 associated with the BVI.";
409 grouping proxy-arp-attributes {
411 "Parameters for configuring Proxy ARP on interfaces.";
418 type inet:ipv4-address;
421 type inet:ipv4-address;
425 augment /if:interfaces/if:interface {
426 ext:augment-identifier "vpp-interface-augmentation";
428 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
429 // 1. The link between interface type and this augmentation is unclear
430 // 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
431 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
434 when "../if:type = 'v3po:tap'";
435 uses tap-interface-base-attributes;
436 uses tap-interface-config-attributes;
440 when "../if:type = 'ianaift:ethernetCsmacd'";
441 uses ethernet-base-attributes;
445 // TODO (HONEYCOMB-127): add routing info for oper
453 "Defines VRF tables used for ipv4 and ipv6 traffic";
456 container vhost-user {
457 when "../if:type = 'v3po:vhost-user'";
458 uses vhost-user-interface-base-attributes;
462 when "../if:type = 'v3po:vxlan-tunnel'";
463 uses vxlan-base-attributes;
467 when "../if:type = 'v3po:gre-tunnel'";
468 uses gre-base-attributes;
472 must "bridged-virtual-interface = 'true' or " +
473 "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
474 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
476 uses l2-base-attributes;
479 container vxlan-gpe {
480 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
482 uses vxlan-gpe-base-attributes;
485 container proxy-arp {
486 uses proxy-arp-attributes;
491 uses vpp-acl:acl-base-attributes;
494 uses vpp-acl:acl-base-attributes;
500 uses vpp-acl:ietf-acl-base-attributes;
503 uses vpp-acl:ietf-acl-base-attributes;
512 container bridge-domains {
520 uses bridge-domain-attributes;
521 uses l2-fib-attributes;
524 "bridge-domain configuration";
529 augment /if:interfaces-state/if:interface {
530 ext:augment-identifier "vpp-interface-state-augmentation";
537 when "../if:type = 'v3po:tap'";
538 uses tap-interface-base-attributes;
542 when "../if:type = 'ianaift:ethernetCsmacd'";
543 uses ethernet-base-attributes;
544 uses ethernet-state-attributes;
547 container vhost-user {
548 when "../if:type = 'v3po:vhost-user'";
549 uses vhost-user-interface-base-attributes;
550 uses vhost-user-interface-state-attributes;
554 when "../if:type = 'v3po:vxlan-tunnel'";
555 uses vxlan-base-attributes;
557 container vxlan-gpe {
558 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
560 uses vxlan-gpe-base-attributes;
564 when "../if:type = 'gre-tunnel'";
565 uses gre-base-attributes;
569 must "bridged-virtual-interface = 'true' or " +
570 "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
571 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
573 uses l2-base-attributes;
576 container proxy-arp {
577 uses proxy-arp-attributes;
582 uses vpp-acl:acl-base-attributes;
585 uses vpp-acl:acl-base-attributes;
591 uses vpp-acl:ietf-acl-base-attributes;
594 uses vpp-acl:ietf-acl-base-attributes;
599 augment /if:interfaces-state/if:interface/if:statistics {
600 ext:augment-identifier "vpp-interface-statistics-augmentation";
601 leaf in-errors-no-buf {
604 leaf in-errors-miss {
607 leaf out-discards-fifo-full {
612 container vpp-state {
616 "VPP operational data";
618 container bridge-domains {
619 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
627 uses bridge-domain-attributes;
628 uses l2-fib-attributes;
631 "bridge-domain operational data";
639 leaf build-directory {
651 "PID of the vpp process";
660 typedef interface-status {
671 typedef interface-name-or-index {
678 notification interface-state-change {
680 type interface-name-or-index;
684 type interface-status;
688 type interface-status;
692 notification interface-deleted {
694 type interface-name-or-index;