3 namespace "urn:opendaylight:params:xml:ns:yang:vpp:vlan";
6 revision "2015-05-27" {
8 "Initial revision of vlan model for VPP.
9 Reuses some concepts from draft-wilton-netmod-intf-vlan-yang-02 model.";
12 import ietf-interfaces {
15 import ietf-inet-types {
18 import ietf-yang-types {
31 typedef sub-interface-status {
38 // todo add 802dot1ad support to dot1q-types.yang
40 * Defines the supported IEEE 802.1Q types that can be used for
44 description "Base identity from which all VLAN types
51 "An 802.1Q VLAN type";
57 "An 802.1ad VLAN type";
64 description "Identifies a specific VLAN type";
67 grouping match-attributes {
70 description "Provides a choice of how the frames may be matched";
73 description "Default match";
77 "Default match. Matches all traffic not matched to any
78 other peer sub-interface by a more specific
84 description "Match untagged Ethernet frames only";
88 "Untagged match. Matches all untagged traffic.";
93 container vlan-tagged {
94 description "Matches VLAN tagged frames. Vlan tags need to be specified to use this match type";
96 leaf match-exact-tags {
100 "If set, indicates that all 802.1Q VLAN tags in the
101 Ethernet frame header must be explicitly matched, i.e.
102 the EtherType following the matched tags must not be a
103 802.1Q tag EtherType. If unset then extra 802.1Q VLAN
106 } // container vlan-tagged
107 } // case vlan-tagged
111 // TODO VPP does not allow to change subinterface nor delete it (except for tag-rewrite operation)
112 grouping sub-interface-base-attributes {
123 description "The VLAN tags to use by locally sourced traffic";
131 * Only allow a push of an inner tag if an outer tag is also
135 count(../../push-tags[index = 0]/index) > 0" {
136 error-message "An inner tag can only be pushed if an outer
137 tag is also specified";
138 description "Only allow a push of an inner tag if an outer
139 tag is also being pushed";
141 description "The index into the tag stack";
144 uses dot1q:dot1q-tag-or-any;
151 "The match used to classify frames to this interface";
152 uses match-attributes;
156 uses v3po:l2-base-attributes;
164 uses v3po:acl-base-attributes;
167 uses v3po:acl-base-attributes;
173 uses v3po:ietf-acl-base-attributes;
176 uses v3po:ietf-acl-base-attributes;
181 grouping sub-interface-config-attributes {
186 "Contains the configured, desired state of the sub-interface.
187 To enable sub-interface, the super inerface needs to be enabled";
191 grouping sub-interface-operational-attributes {
193 type sub-interface-status;
197 type sub-interface-status;
202 range "1..2147483647";
207 type yang:phys-address;
209 "The sub-interface's Media Access Control (MAC) address.";
218 * Only symetrical rewrite is supported
220 grouping tag-rewrite {
221 description "Flexible rewrite";
223 leaf vlan-type { // todo rename to push_dot1q, mandatory(?) with default true
232 description "The number of tags to pop (or translate if used in
233 conjunction with push-tags)";
239 description "The number of tags to push (or translate if used
240 in conjunction with pop-tags)";
242 * Server should order by increasing index.
250 * Only allow a push of an inner tag if an outer tag is also
254 count(../../push-tags[index = 0]/index) > 0" {
255 error-message "An inner tag can only be pushed if an outer
256 tag is also specified";
257 description "Only allow a push of an inner tag if an outer
258 tag is also being pushed";
262 uses dot1q:dot1q-tag;
266 grouping sub-interface-ip4-attributes {
268 // TODO: add currently unsupported:
269 // enabled, forwarding, mtu, address/origin(config false), neighbor/origin(config false)
271 // TODO: reuse groupings once ietf-ip provides them
274 "Parameters for the IPv4 address family (based on ietf-ip rev. 2014-06-16)";
279 "The list of configured IPv4 addresses on the interface.";
281 type inet:ipv4-address-no-zone;
283 "The IPv4 address on the interface.";
289 "The subnet can be specified as a prefix-length, or,
290 if the server supports non-contiguous netmasks, as
297 "The length of the subnet prefix.";
300 type yang:dotted-quad;
302 "The subnet specified as a netmask (contiguous)";
310 "A list of mappings from IPv4 addresses to
311 link-layer addresses.
313 Entries in this list are used as static entries in the
316 "RFC 826: An Ethernet Address Resolution Protocol";
319 type inet:ipv4-address-no-zone;
321 "The IPv4 address of the neighbor node.";
324 leaf link-layer-address {
325 type yang:phys-address;
328 "The link-layer address of the neighbor node.";
334 grouping sub-interface-ip6-attributes {
336 // TODO: add currently unsupported:
337 // enabled, forwarding, mtu, neighbor, dup-addr-detect-transmits, autoconf,
338 // address(config false): origin, status
339 // neighbor(config false): origin, is-router, state
341 // TODO: reuse groupings once ietf-ip provides them
344 "Parameters for the IPv6 address family (based on ietf-ip rev. 2014-06-16)";
349 "The list of configured IPv6 addresses on the interface.";
351 type inet:ipv6-address-no-zone;
353 "The IPv6 address on the interface.";
362 "The length of the subnet prefix.";
369 "A list of mappings from IPv6 addresses to
370 link-layer addresses.
372 Entries in this list are used as static entries in the
375 "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
378 type inet:ipv6-address-no-zone;
380 "The IPv6 address of the neighbor node.";
383 leaf link-layer-address {
384 type yang:phys-address;
387 "The link-layer address of the neighbor node.";
393 augment /if:interfaces/if:interface {
394 ext:augment-identifier "subinterface-augmentation";
396 container sub-interfaces {
397 description "L2 vlan subinterfaces";
406 uses sub-interface-base-attributes;
407 uses sub-interface-config-attributes;
408 uses sub-interface-ip4-attributes;
409 uses sub-interface-ip6-attributes;
414 augment /if:interfaces-state/if:interface {
415 ext:augment-identifier "subinterface-state-augmentation";
417 container sub-interfaces {
418 description "L2 vlan subinterfaces";
426 uses sub-interface-base-attributes;
427 uses sub-interface-operational-attributes;
428 uses sub-interface-ip4-attributes;
429 uses sub-interface-ip6-attributes;