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)";
14 revision "2015-01-05" {
15 description "Initial revision of v3po model";
21 import ietf-interfaces {
24 import ietf-yang-types {
27 import ietf-inet-types {
40 typedef bridge-domain-ref {
42 path "/vpp/bridge-domains/bridge-domain/name";
45 "This type is used by to reference a bridge domain table";
48 typedef bridged-virtual-interface-ref {
50 path "/if:interfaces/if:interface/l2/bridged-virtual-interface";
53 "This type is used by to reference a bridged virtual interface";
56 identity vxlan-tunnel {
57 base if:interface-type;
61 base if:interface-type;
65 base if:interface-type;
69 base if:interface-type;
72 identity l2-fib-action {
73 description "Base identity for l2-fib actions";
76 identity l2-fib-forward {
79 "Forwards packet with configured mac address";
82 identity l2-fib-filter {
85 "Drops packet with configured mac address";
88 typedef l2-fib-action {
92 description "Identifies a specific L2 FIB action";
96 // FIXME: should be in a vxlan-specific model
97 description "VNI used in a VXLAN tunnel";
103 typedef vhost-user-role {
110 identity vxlan-gpe-tunnel {
111 base if:interface-type;
114 typedef vxlan-gpe-vni {
115 description "VNI used in a VXLAN-GPE tunnel";
121 typedef vxlan-gpe-next-protocol {
138 grouping bridge-domain-attributes {
143 "Enable/disable L2 flooding.";
149 "Enable/disable L2 forwarding.";
155 "Enable/disable L2 learning.";
157 leaf unknown-unicast-flood {
161 leaf arp-termination {
166 container arp-termination-table {
167 when "../v3po:arp-termination = 'true'";
169 // TODO(HONEYCOMB-133): add support for read (after VPP-230 is done)
170 list arp-termination-table-entry {
171 key "ip-address phys-address";
173 // FIXME: change to ip-address-no-zone after https://bugs.opendaylight.org/show_bug.cgi?id=6413 is resolved
174 type inet:ip-address;
177 type yang:phys-address;
183 // TODO express constraints for L2 FIB entries in YANG if possible
184 grouping l2-fib-attributes {
185 container l2-fib-table {
190 type yang:phys-address;
193 leaf outgoing-interface {
196 // mandatory for forward action
197 // FIXME VPP's CLI does not require to set iface id for filter action
198 // VPP's binary api in constrast to CLI does some checks on the iface id value,
199 // so currently it has to be set for all actions
201 "One of interfaces assigned to the FIB table's bridge-domain.";
207 "Static entries cannot be overridden by mac learning.";
213 "L2 FIB action. For filter action, entry must be configured as static.";
215 leaf bridged-virtual-interface {
216 when "../action = 'forward'";
218 config false; // FIXME setting bvi is currently not supported by VPP's binary api
224 grouping tap-interface-base-attributes {
227 pattern "[a-zA-Z0-9\-;.+@$#^&*!_()=\[\]]*";
232 grouping tap-interface-config-attributes {
234 type yang:phys-address;
236 description "Mac address to be set for the tap interface. Random will be used if not configured";
239 leaf device-instance {
242 description "Custom device instance. Autogenerated will be used if not configured";
246 grouping ethernet-base-attributes {
254 "The size, in octets, of the largest packet that the
255 hardware interface will send and receive.";
259 grouping ethernet-state-attributes {
260 leaf manufacturer-description {
273 grouping vhost-user-interface-base-attributes {
280 type vhost-user-role;
283 description "vhost-user settings";
286 grouping vhost-user-interface-state-attributes {
291 leaf virtio-net-hdr-size {
295 leaf num-memory-regions {
305 grouping vxlan-base-attributes {
306 // FIXME: this should be in an vxlan-specific extension
309 type inet:ip-address;
313 type inet:ip-address;
324 grouping gre-base-attributes {
327 type inet:ip-address;
331 type inet:ip-address;
338 grouping vxlan-gpe-base-attributes {
341 type inet:ip-address;
345 type inet:ip-address;
352 type vxlan-gpe-next-protocol;
362 grouping l2-base-attributes {
364 "Parameters for configuring Layer2 features on interfaces.";
366 choice interconnection {
367 case xconnect-based {
368 leaf xconnect-outgoing-interface {
369 /* Don't allow selection of this interface */
370 must "../../if:name != current()";
371 type if:interface-ref; // todo use interface-state-ref for operational data?
378 type bridge-domain-ref;
381 "Interfaces in a bridge-domain forward packets to other
382 interfaces in the same bridge-domain based on
383 destination mac address.";
385 leaf split-horizon-group {
386 when "../bridge-domain";
390 default 0; //no split horizon group
392 "Interface's split-horizon group. Interfaces in the same
393 bridge-domain and split-horizon group can not forward
394 packets between each other. ";
396 leaf bridged-virtual-interface {
397 when "../bridge-domain";
401 "Interface forward packets in the bridge-domain
402 associated with the BVI.";
408 grouping proxy-arp-attributes {
410 "Parameters for configuring Proxy ARP on interfaces.";
417 type inet:ipv4-address;
420 type inet:ipv4-address;
424 augment /if:interfaces/if:interface {
425 ext:augment-identifier "vpp-interface-augmentation";
427 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
428 // 1. The link between interface type and this augmentation is unclear
429 // 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
430 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
433 when "../if:type = 'v3po:tap'";
434 uses tap-interface-base-attributes;
435 uses tap-interface-config-attributes;
439 when "../if:type = 'ianaift:ethernetCsmacd'";
440 uses ethernet-base-attributes;
444 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
450 container vhost-user {
451 when "../if:type = 'v3po:vhost-user'";
452 uses vhost-user-interface-base-attributes;
456 when "../if:type = 'v3po:vxlan-tunnel'";
457 uses vxlan-base-attributes;
461 when "../if:type = 'v3po:gre-tunnel'";
462 uses gre-base-attributes;
466 must "bridged-virtual-interface = 'true' or " +
467 "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
468 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
470 uses l2-base-attributes;
473 container vxlan-gpe {
474 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
476 uses vxlan-gpe-base-attributes;
479 container proxy-arp {
480 uses proxy-arp-attributes;
485 uses vpp-acl:acl-base-attributes;
488 uses vpp-acl:acl-base-attributes;
494 uses vpp-acl:ietf-acl-base-attributes;
497 uses vpp-acl:ietf-acl-base-attributes;
506 container bridge-domains {
514 uses bridge-domain-attributes;
515 uses l2-fib-attributes;
518 "bridge-domain configuration";
523 augment /if:interfaces-state/if:interface {
524 ext:augment-identifier "vpp-interface-state-augmentation";
531 when "../if:type = 'v3po:tap'";
532 uses tap-interface-base-attributes;
536 when "../if:type = 'ianaift:ethernetCsmacd'";
537 uses ethernet-base-attributes;
538 uses ethernet-state-attributes;
541 container vhost-user {
542 when "../if:type = 'v3po:vhost-user'";
543 uses vhost-user-interface-base-attributes;
544 uses vhost-user-interface-state-attributes;
548 when "../if:type = 'v3po:vxlan-tunnel'";
549 uses vxlan-base-attributes;
551 container vxlan-gpe {
552 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
554 uses vxlan-gpe-base-attributes;
558 when "../if:type = 'gre-tunnel'";
559 uses gre-base-attributes;
563 must "bridged-virtual-interface = 'true' or " +
564 "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
565 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
567 uses l2-base-attributes;
570 container proxy-arp {
571 uses proxy-arp-attributes;
576 uses vpp-acl:acl-base-attributes;
579 uses vpp-acl:acl-base-attributes;
585 uses vpp-acl:ietf-acl-base-attributes;
588 uses vpp-acl:ietf-acl-base-attributes;
593 augment /if:interfaces-state/if:interface/if:statistics {
594 ext:augment-identifier "vpp-interface-statistics-augmentation";
595 leaf in-errors-no-buf {
598 leaf in-errors-miss {
601 leaf out-discards-fifo-full {
606 container vpp-state {
610 "VPP operational data";
612 container bridge-domains {
613 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
621 uses bridge-domain-attributes;
622 uses l2-fib-attributes;
625 "bridge-domain operational data";
633 leaf build-directory {
649 typedef interface-status {
660 typedef interface-name-or-index {
667 notification interface-state-change {
669 type interface-name-or-index;
673 type interface-status;
677 type interface-status;
681 notification interface-deleted {
683 type interface-name-or-index;