3 namespace "urn:opendaylight:params:xml:ns:yang:vpp:vlan";
6 revision "2016-12-14" {
8 "This revision adds the following new features:
9 - ingress/egress ACLs support";
12 revision "2015-05-27" {
14 "Initial revision of vlan model for VPP.
15 Reuses some concepts from draft-wilton-netmod-intf-vlan-yang-02 model.";
18 import ietf-interfaces {
21 import ietf-inet-types {
24 import ietf-yang-types {
40 typedef sub-interface-status {
47 // todo add 802dot1ad support to dot1q-types.yang
49 * Defines the supported IEEE 802.1Q types that can be used for
53 description "Base identity from which all VLAN types
60 "An 802.1Q VLAN type";
66 "An 802.1ad VLAN type";
73 description "Identifies a specific VLAN type";
76 grouping match-attributes {
79 description "Provides a choice of how the frames may be matched";
82 description "Default match";
86 "Default match. Matches all traffic not matched to any
87 other peer sub-interface by a more specific
93 description "Match untagged Ethernet frames only";
97 "Untagged match. Matches all untagged traffic.";
102 container vlan-tagged {
103 description "Matches VLAN tagged frames. Vlan tags need to be specified to use this match type";
105 leaf match-exact-tags {
109 "If set, indicates that all 802.1Q VLAN tags in the
110 Ethernet frame header must be explicitly matched, i.e.
111 the EtherType following the matched tags must not be a
112 802.1Q tag EtherType. If unset then extra 802.1Q VLAN
115 } // container vlan-tagged
116 } // case vlan-tagged
120 // TODO VPP does not allow to change subinterface nor delete it (except for tag-rewrite operation)
121 grouping sub-interface-base-attributes {
132 description "The VLAN tags to use by locally sourced traffic";
140 * Only allow a push of an inner tag if an outer tag is also
144 count(../../push-tags[index = 0]/index) > 0" {
145 error-message "An inner tag can only be pushed if an outer
146 tag is also specified";
147 description "Only allow a push of an inner tag if an outer
148 tag is also being pushed";
150 description "The index into the tag stack";
153 uses dot1q:dot1q-tag-or-any;
160 "The match used to classify frames to this interface";
161 uses match-attributes;
165 uses v3po:l2-base-attributes;
173 uses vpp-acl:acl-base-attributes;
176 uses vpp-acl:acl-base-attributes;
182 uses vpp-acl:ietf-acl-base-attributes;
185 uses vpp-acl:ietf-acl-base-attributes;
190 grouping sub-interface-config-attributes {
195 "Contains the configured, desired state of the sub-interface.
196 To enable sub-interface, the super inerface needs to be enabled";
200 grouping sub-interface-operational-attributes {
202 type sub-interface-status;
206 type sub-interface-status;
211 range "1..2147483647";
216 type yang:phys-address;
218 "The sub-interface's Media Access Control (MAC) address.";
227 * Only symetrical rewrite is supported
229 grouping tag-rewrite {
230 description "Flexible rewrite";
232 leaf vlan-type { // todo rename to push_dot1q, mandatory(?) with default true
241 description "The number of tags to pop (or translate if used in
242 conjunction with push-tags)";
248 description "The number of tags to push (or translate if used
249 in conjunction with pop-tags)";
251 * Server should order by increasing index.
259 * Only allow a push of an inner tag if an outer tag is also
263 count(../../push-tags[index = 0]/index) > 0" {
264 error-message "An inner tag can only be pushed if an outer
265 tag is also specified";
266 description "Only allow a push of an inner tag if an outer
267 tag is also being pushed";
271 uses dot1q:dot1q-tag;
275 grouping sub-interface-ip4-attributes {
277 // TODO: add currently unsupported:
278 // enabled, forwarding, mtu, address/origin(config false), neighbor/origin(config false)
280 // TODO: reuse groupings once ietf-ip provides them
283 "Parameters for the IPv4 address family (based on ietf-ip rev. 2014-06-16)";
288 "The list of configured IPv4 addresses on the interface.";
290 type inet:ipv4-address-no-zone;
292 "The IPv4 address on the interface.";
298 "The subnet can be specified as a prefix-length, or,
299 if the server supports non-contiguous netmasks, as
306 "The length of the subnet prefix.";
309 type yang:dotted-quad;
311 "The subnet specified as a netmask (contiguous)";
319 "A list of mappings from IPv4 addresses to
320 link-layer addresses.
322 Entries in this list are used as static entries in the
325 "RFC 826: An Ethernet Address Resolution Protocol";
328 type inet:ipv4-address-no-zone;
330 "The IPv4 address of the neighbor node.";
333 leaf link-layer-address {
334 type yang:phys-address;
337 "The link-layer address of the neighbor node.";
343 grouping sub-interface-ip6-attributes {
345 // TODO: add currently unsupported:
346 // enabled, forwarding, mtu, neighbor, dup-addr-detect-transmits, autoconf,
347 // address(config false): origin, status
348 // neighbor(config false): origin, is-router, state
350 // TODO: reuse groupings once ietf-ip provides them
353 "Parameters for the IPv6 address family (based on ietf-ip rev. 2014-06-16)";
358 "The list of configured IPv6 addresses on the interface.";
360 type inet:ipv6-address-no-zone;
362 "The IPv6 address on the interface.";
371 "The length of the subnet prefix.";
378 "A list of mappings from IPv6 addresses to
379 link-layer addresses.
381 Entries in this list are used as static entries in the
384 "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
387 type inet:ipv6-address-no-zone;
389 "The IPv6 address of the neighbor node.";
392 leaf link-layer-address {
393 type yang:phys-address;
396 "The link-layer address of the neighbor node.";
402 augment /if:interfaces/if:interface {
403 ext:augment-identifier "subinterface-augmentation";
405 container sub-interfaces {
406 description "L2 vlan subinterfaces";
415 uses sub-interface-base-attributes;
416 uses sub-interface-config-attributes;
417 uses sub-interface-ip4-attributes;
418 uses sub-interface-ip6-attributes;
423 augment /if:interfaces-state/if:interface {
424 ext:augment-identifier "subinterface-state-augmentation";
426 container sub-interfaces {
427 description "L2 vlan subinterfaces";
435 uses sub-interface-base-attributes;
436 uses sub-interface-operational-attributes;
437 uses sub-interface-ip4-attributes;
438 uses sub-interface-ip6-attributes;