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 {
159 // TODO express constraints for L2 FIB entries in YANG if possible
160 grouping l2-fib-attributes {
161 container l2-fib-table {
166 type yang:phys-address;
169 leaf outgoing-interface {
172 // mandatory for forward action
173 // FIXME VPP's CLI does not require to set iface id for filter action
174 // VPP's binary api in constrast to CLI does some checks on the iface id value,
175 // so currently it has to be set for all actions
177 "One of interfaces assigned to the FIB table's bridge-domain.";
183 "Static entries cannot be overridden by mac learning.";
189 "L2 FIB action. For filter action, entry must be configured as static.";
191 leaf bridged-virtual-interface {
192 when "../v3po:action = 'forward'";
194 config false; // FIXME setting bvi is currently not supported by VPP's binary api
200 grouping tap-interface-base-attributes {
206 grouping tap-interface-config-attributes {
208 type yang:phys-address;
210 description "Mac address to be set for the tap interface. Random will be used if not configured";
213 leaf device-instance {
216 description "Custom device instance. Autogenerated will be used if not configured";
220 grouping ethernet-base-attributes {
228 "The size, in octets, of the largest packet that the
229 hardware interface will send and receive.";
233 grouping ethernet-state-attributes {
234 leaf manufacturer-description {
247 grouping vhost-user-interface-base-attributes {
254 type vhost-user-role;
257 description "vhost-user settings";
260 grouping vhost-user-interface-state-attributes {
265 leaf virtio-net-hdr-size {
269 leaf num-memory-regions {
279 grouping vxlan-base-attributes {
280 // FIXME: this should be in an vxlan-specific extension
283 type inet:ip-address;
287 type inet:ip-address;
298 grouping gre-base-attributes {
301 type inet:ip-address;
305 type inet:ip-address;
312 grouping vxlan-gpe-base-attributes {
315 type inet:ip-address;
319 type inet:ip-address;
326 type vxlan-gpe-next-protocol;
336 grouping l2-base-attributes {
338 "Parameters for configuring Layer2 features on interfaces.";
340 choice interconnection {
341 case xconnect-based {
342 leaf xconnect-outgoing-interface {
343 /* Don't allow selection of this interface */
344 must "../../if:name != current()";
345 type if:interface-ref; // todo use interface-state-ref for operational data?
352 type bridge-domain-ref;
355 "Interfaces in a bridge-domain forward packets to other
356 interfaces in the same bridge-domain based on
357 destination mac address.";
359 leaf split-horizon-group {
360 when "../bridge-domain";
365 "Interface's split-horizon group. Interfaces in the same
366 bridge-domain and split-horizon group can not forward
367 packets between each other. ";
369 leaf bridged-virtual-interface {
370 when "../bridge-domain";
374 "Interface forward packets in the bridge-domain
375 associated with the BVI.";
381 grouping acl-base-attributes {
383 "Defines references to classify tables.
384 At least one table reference should be specified.";
386 leaf classify-table {
387 type vpp-classifier:classify-table-ref;
393 leaf classify-table {
394 type vpp-classifier:classify-table-ref;
400 leaf classify-table {
401 type vpp-classifier:classify-table-ref;
408 augment /if:interfaces/if:interface {
409 ext:augment-identifier "vpp-interface-augmentation";
411 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
412 // 1. The link between interface type and this augmentation is unclear
413 // 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
414 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
417 when "../if:type = 'v3po:tap'";
418 uses tap-interface-base-attributes;
419 uses tap-interface-config-attributes;
423 when "../if:type = 'ianaift:ethernetCsmacd'";
424 uses ethernet-base-attributes;
428 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
434 container vhost-user {
435 when "../if:type = 'v3po:vhost-user'";
436 uses vhost-user-interface-base-attributes;
440 when "../if:type = 'v3po:vxlan-tunnel'";
441 uses vxlan-base-attributes;
445 when "../if:type = 'v3po:gre-tunnel'";
446 uses gre-base-attributes;
450 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
451 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
453 uses l2-base-attributes;
456 container vxlan-gpe {
457 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
459 uses vxlan-gpe-base-attributes;
463 uses acl-base-attributes;
471 container bridge-domains {
479 uses bridge-domain-attributes;
480 uses l2-fib-attributes;
483 "bridge-domain configuration";
488 augment /if:interfaces-state/if:interface {
489 ext:augment-identifier "vpp-interface-state-augmentation";
496 when "../if:type = 'v3po:tap'";
497 uses tap-interface-base-attributes;
501 when "../if:type = 'ianaift:ethernetCsmacd'";
502 uses ethernet-base-attributes;
503 uses ethernet-state-attributes;
506 container vhost-user {
507 when "../if:type = 'v3po:vhost-user'";
508 uses vhost-user-interface-base-attributes;
509 uses vhost-user-interface-state-attributes;
513 when "../if:type = 'v3po:vxlan-tunnel'";
514 uses vxlan-base-attributes;
516 container vxlan-gpe {
517 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
519 uses vxlan-gpe-base-attributes;
523 when "../if:type = 'gre-tunnel'";
524 uses gre-base-attributes;
528 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
529 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
531 uses l2-base-attributes;
535 uses acl-base-attributes;
539 augment /if:interfaces-state/if:interface/if:statistics {
540 ext:augment-identifier "vpp-interface-statistics-augmentation";
541 leaf in-errors-no-buf {
544 leaf in-errors-miss {
547 leaf out-discards-fifo-full {
552 container vpp-state {
556 "VPP operational data";
558 container bridge-domains {
559 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
567 uses bridge-domain-attributes;
568 uses l2-fib-attributes;
571 "bridge-domain operational data";
579 leaf build-directory {
595 typedef interface-status {
606 typedef interface-name-or-index {
613 notification interface-state-change {
615 type interface-name-or-index;
619 type interface-status;
623 type interface-status;
627 notification interface-deleted {
629 type interface-name-or-index;