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 {
29 typedef bridge-domain-ref {
31 path "/vpp/bridge-domains/bridge-domain/name";
34 "This type is used by to reference a bridge domain table";
37 typedef bridged-virtual-interface-ref {
39 path "/if:interfaces/if:interface/l2/bridged-virtual-interface";
42 "This type is used by to reference a bridged virtual interface";
52 typedef tag-rewrite-operation {
59 enum translate-1-to-1;
60 enum translate-1-to-2;
61 enum translate-2-to-1;
62 enum translate-2-to-2;
72 identity vxlan-tunnel {
73 base if:interface-type;
77 base if:interface-type;
81 base if:interface-type;
84 identity sub-interface {
85 base if:interface-type;
89 // FIXME: should be in a vxlan-specific model
90 description "VNI used in a VXLAN tunnel";
96 typedef vhost-user-role {
103 grouping bridge-domain-attributes {
108 "Enable/disable L2 flooding.";
114 "Enable/disable L2 forwarding.";
120 "Enable/disable L2 learning.";
122 leaf unknown-unicast-flood {
126 leaf arp-termination {
132 grouping sub-interface-base-attributes {
140 leaf number-of-tags {
152 leaf match-any-outer-id {
155 leaf match-any-inner-id {
166 grouping tap-interface-base-attributes {
172 grouping tap-interface-config-attributes {
174 type yang:phys-address;
176 description "Mac address to be set for the tap interface. Random will be used if not configured";
179 leaf device-instance {
182 description "Custom device instance. Autogenerated will be used if not configured";
186 grouping ethernet-base-attributes {
194 "The size, in octets, of the largest packet that the
195 hardware interface will send and receive.";
199 grouping ethernet-state-attributes {
200 leaf manufacturer-description {
213 grouping vhost-user-interface-base-attributes {
220 type vhost-user-role;
223 description "vhost-user settings";
226 grouping vhost-user-interface-state-attributes {
231 leaf virtio-net-hdr-size {
235 leaf num-memory-regions {
245 grouping vxlan-base-attributes {
246 // FIXME: this should be in an vxlan-specific extension
249 type inet:ip-address;
253 type inet:ip-address;
264 grouping vlan-tag-rewrite-attributes {
265 leaf rewrite-operation {
266 type tag-rewrite-operation;
281 grouping l2-attributes {
283 "Parameters for configuring Layer2 features on interfaces.";
285 choice interconnection {
286 case xconnect-based {
287 leaf xconnect-outgoing-interface {
288 /* Don't allow selection of this interface */
289 must "../../if:name != current()";
290 type if:interface-ref; // todo use interface-state-ref for operational data?
297 type bridge-domain-ref;
299 "Interfaces in a bridge-domain forward packets to other
300 interfaces in the same bridge-domain based on
301 destination mac address.";
303 leaf split-horizon-group {
304 when "../bridge-domain";
310 "Interface's split-horizon group. Interfaces in the same
311 bridge-domain and split-horizon group can not forward
312 packets between each other. ";
314 leaf bridged-virtual-interface {
315 when "../bridge-domain";
319 "Interface forward packets in the bridge-domain
320 associated with the BVI.";
324 container vlan-tag-rewrite { // todo valid only for sub-interfaces
325 uses vlan-tag-rewrite-attributes;
329 augment /if:interfaces/if:interface {
330 ext:augment-identifier "vpp-interface-augmentation";
332 // FIXME using ietf-interfaces model for vpp interfaces makes it hard to implement because:
333 // 1. The link between interface type and this augmentation is unclear
334 // 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
335 // 3. The ietf-interfaces model does not define groupings which makes types reuse difficult
337 container sub-interface {
338 when "../if:type = 'v3po:sub-interface'";
339 leaf super-interface {
340 type if:interface-ref;
342 uses sub-interface-base-attributes;
346 when "../if:type = 'v3po:tap'";
347 uses tap-interface-base-attributes;
348 uses tap-interface-config-attributes;
352 when "../if:type = 'ianaift:ethernetCsmacd'";
353 uses ethernet-base-attributes;
357 leaf vrf-id { // todo no routing info for oper, is it possible to get it from the vpp?
363 container vhost-user {
364 when "../if:type = 'v3po:vhost-user'";
365 uses vhost-user-interface-base-attributes;
369 when "../if:type = 'v3po:vxlan-tunnel'";
370 uses vxlan-base-attributes;
374 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
375 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
385 container bridge-domains {
388 // TODO: where does this come from?
395 uses bridge-domain-attributes;
401 type yang:phys-address;
410 leaf outgoing-interface {
411 type if:interface-ref;
418 augment /if:interfaces-state/if:interface {
419 ext:augment-identifier "vpp-interface-state-augmentation";
425 container sub-interface {
426 when "../if:type = 'v3po:sub-interface'";
427 leaf super-interface {
428 type if:interface-state-ref;
430 uses sub-interface-base-attributes;
434 when "../if:type = 'v3po:tap'";
435 uses tap-interface-base-attributes;
439 when "../if:type = 'ianaift:ethernetCsmacd'";
440 uses ethernet-base-attributes;
441 uses ethernet-state-attributes;
444 container vhost-user {
445 when "../if:type = 'v3po:vhost-user'";
446 uses vhost-user-interface-base-attributes;
447 uses vhost-user-interface-state-attributes;
451 when "../if:type = 'v3po:vxlan-tunnel'";
452 uses vxlan-base-attributes;
456 must "(not (../if:ipv4[if:enabled = 'true']/if:address/if:ip) and " +
457 "not (../if:ipv6[if:enabled = 'true']/if:address/if:ip))";
463 augment /if:interfaces-state/if:interface/if:statistics {
464 ext:augment-identifier "vpp-interface-statistics-augmentation";
465 leaf in-errors-no-buf {
468 leaf in-errors-miss {
471 leaf out-discards-fifo-full {
476 container vpp-state {
480 "VPP operational data";
482 container bridge-domains {
483 // FIXME: Should this live in bridge-domain.yang in a modular fashion ?
491 uses bridge-domain-attributes;
497 type if:interface-state-ref;
500 leaf split-horizon-group {
504 leaf bridged-virtual-interface {
513 type yang:phys-address;
518 leaf outgoing-interface {
519 when "../v3po:action = 'forward'";
520 type if:interface-state-ref;
529 leaf bridged-virtual-interface {
530 when "../v3po:action = 'forward'";
535 "bridge-domain operational data";
543 leaf build-directory {