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;
60 identity l2-fib-action {
61 description "Base identity for l2-fib actions";
64 identity l2-fib-forward {
67 "Forwards packet with configured mac address";
70 identity l2-fib-filter {
73 "Drops packet with configured mac address";
76 typedef l2-fib-action {
80 description "Identifies a specific L2 FIB action";
84 // FIXME: should be in a vxlan-specific model
85 description "VNI used in a VXLAN tunnel";
91 typedef vhost-user-role {
98 identity vxlan-gpe-tunnel {
99 base if:interface-type;
102 typedef vxlan-gpe-vni {
103 description "VNI used in a VXLAN-GPE tunnel";
109 typedef vxlan-gpe-next-protocol {
126 grouping bridge-domain-attributes {
131 "Enable/disable L2 flooding.";
137 "Enable/disable L2 forwarding.";
143 "Enable/disable L2 learning.";
145 leaf unknown-unicast-flood {
149 leaf arp-termination {
155 // TODO express constraints for L2 FIB entries in YANG if possible
156 grouping l2-fib-attributes {
157 container l2-fib-table {
162 type yang:phys-address;
165 leaf outgoing-interface {
168 // mandatory for forward action
169 // FIXME VPP's CLI does not require to set iface id for filter action
170 // VPP's binary api in constrast to CLI does some checks on the iface id value,
171 // so currently it has to be set for all actions
173 "One of interfaces assigned to the FIB table's bridge-domain.";
179 "Static entries cannot be overridden by mac learning.";
185 "L2 FIB action. For filter action, entry must be configured as static.";
187 leaf bridged-virtual-interface {
188 when "../v3po:action = 'forward'";
190 config false; // FIXME setting bvi is currently not supported by VPP's binary api
196 grouping tap-interface-base-attributes {
202 grouping tap-interface-config-attributes {
204 type yang:phys-address;
206 description "Mac address to be set for the tap interface. Random will be used if not configured";
209 leaf device-instance {
212 description "Custom device instance. Autogenerated will be used if not configured";
216 grouping ethernet-base-attributes {
224 "The size, in octets, of the largest packet that the
225 hardware interface will send and receive.";
229 grouping ethernet-state-attributes {
230 leaf manufacturer-description {
243 grouping vhost-user-interface-base-attributes {
250 type vhost-user-role;
253 description "vhost-user settings";
256 grouping vhost-user-interface-state-attributes {
261 leaf virtio-net-hdr-size {
265 leaf num-memory-regions {
275 grouping vxlan-base-attributes {
276 // FIXME: this should be in an vxlan-specific extension
279 type inet:ip-address;
283 type inet:ip-address;
294 grouping vxlan-gpe-base-attributes {
297 type inet:ip-address;
301 type inet:ip-address;
308 type vxlan-gpe-next-protocol;
318 grouping l2-base-attributes {
320 "Parameters for configuring Layer2 features on interfaces.";
322 choice interconnection {
323 case xconnect-based {
324 leaf xconnect-outgoing-interface {
325 /* Don't allow selection of this interface */
326 must "../../if:name != current()";
327 type if:interface-ref; // todo use interface-state-ref for operational data?
334 type bridge-domain-ref;
337 "Interfaces in a bridge-domain forward packets to other
338 interfaces in the same bridge-domain based on
339 destination mac address.";
341 leaf split-horizon-group {
342 when "../bridge-domain";
347 "Interface's split-horizon group. Interfaces in the same
348 bridge-domain and split-horizon group can not forward
349 packets between each other. ";
351 leaf bridged-virtual-interface {
352 when "../bridge-domain";
356 "Interface forward packets in the bridge-domain
357 associated with the BVI.";
363 grouping acl-base-attributes {
365 "Defines references to classify tables.
366 At least one table reference should be specified.";
368 leaf classify-table {
369 type vpp-classifier:classify-table-ref;
375 leaf classify-table {
376 type vpp-classifier:classify-table-ref;
382 leaf classify-table {
383 type vpp-classifier:classify-table-ref;
390 augment /if:interfaces/if:interface {
391 ext:augment-identifier "vpp-interface-augmentation";
393 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
394 // 1. The link between interface type and this augmentation is unclear
395 // 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
396 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
399 when "../if:type = 'v3po:tap'";
400 uses tap-interface-base-attributes;
401 uses tap-interface-config-attributes;
405 when "../if:type = 'ianaift:ethernetCsmacd'";
406 uses ethernet-base-attributes;
410 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
416 container vhost-user {
417 when "../if:type = 'v3po:vhost-user'";
418 uses vhost-user-interface-base-attributes;
422 when "../if:type = 'v3po:vxlan-tunnel'";
423 uses vxlan-base-attributes;
427 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
428 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
430 uses l2-base-attributes;
433 container vxlan-gpe {
434 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
436 uses vxlan-gpe-base-attributes;
440 uses acl-base-attributes;
448 container bridge-domains {
456 uses bridge-domain-attributes;
457 uses l2-fib-attributes;
460 "bridge-domain configuration";
465 augment /if:interfaces-state/if:interface {
466 ext:augment-identifier "vpp-interface-state-augmentation";
473 when "../if:type = 'v3po:tap'";
474 uses tap-interface-base-attributes;
478 when "../if:type = 'ianaift:ethernetCsmacd'";
479 uses ethernet-base-attributes;
480 uses ethernet-state-attributes;
483 container vhost-user {
484 when "../if:type = 'v3po:vhost-user'";
485 uses vhost-user-interface-base-attributes;
486 uses vhost-user-interface-state-attributes;
490 when "../if:type = 'v3po:vxlan-tunnel'";
491 uses vxlan-base-attributes;
493 container vxlan-gpe {
494 when "../if:type = 'v3po:vxlan-gpe-tunnel'";
496 uses vxlan-gpe-base-attributes;
500 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
501 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
503 uses l2-base-attributes;
507 uses acl-base-attributes;
511 augment /if:interfaces-state/if:interface/if:statistics {
512 ext:augment-identifier "vpp-interface-statistics-augmentation";
513 leaf in-errors-no-buf {
516 leaf in-errors-miss {
519 leaf out-discards-fifo-full {
524 container vpp-state {
528 "VPP operational data";
530 container bridge-domains {
531 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
539 uses bridge-domain-attributes;
540 uses l2-fib-attributes;
543 "bridge-domain operational data";
551 leaf build-directory {
567 typedef interface-status {
578 typedef interface-name-or-index {
585 notification interface-state-change {
587 type interface-name-or-index;
591 type interface-status;
595 type interface-status;
599 notification interface-deleted {
601 type interface-name-or-index;