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 {
37 typedef sub-interface-status {
44 // todo add 802dot1ad support to dot1q-types.yang
46 * Defines the supported IEEE 802.1Q types that can be used for
50 description "Base identity from which all VLAN types
57 "An 802.1Q VLAN type";
63 "An 802.1ad VLAN type";
70 description "Identifies a specific VLAN type";
73 grouping match-attributes {
76 description "Provides a choice of how the frames may be matched";
79 description "Default match";
83 "Default match. Matches all traffic not matched to any
84 other peer sub-interface by a more specific
90 description "Match untagged Ethernet frames only";
94 "Untagged match. Matches all untagged traffic.";
99 container vlan-tagged {
100 description "Matches VLAN tagged frames. Vlan tags need to be specified to use this match type";
102 leaf match-exact-tags {
106 "If set, indicates that all 802.1Q VLAN tags in the
107 Ethernet frame header must be explicitly matched, i.e.
108 the EtherType following the matched tags must not be a
109 802.1Q tag EtherType. If unset then extra 802.1Q VLAN
112 } // container vlan-tagged
113 } // case vlan-tagged
117 // TODO VPP does not allow to change subinterface nor delete it (except for tag-rewrite operation)
118 grouping sub-interface-base-attributes {
129 description "The VLAN tags to use by locally sourced traffic";
137 * Only allow a push of an inner tag if an outer tag is also
141 count(../../push-tags[index = 0]/index) > 0" {
142 error-message "An inner tag can only be pushed if an outer
143 tag is also specified";
144 description "Only allow a push of an inner tag if an outer
145 tag is also being pushed";
147 description "The index into the tag stack";
150 uses dot1q:dot1q-tag-or-any;
157 "The match used to classify frames to this interface";
158 uses match-attributes;
162 uses v3po:l2-base-attributes;
170 uses v3po:acl-base-attributes;
173 uses v3po:acl-base-attributes;
179 uses v3po:ietf-acl-base-attributes;
182 uses v3po:ietf-acl-base-attributes;
187 grouping sub-interface-config-attributes {
192 "Contains the configured, desired state of the sub-interface.
193 To enable sub-interface, the super inerface needs to be enabled";
197 grouping sub-interface-operational-attributes {
199 type sub-interface-status;
203 type sub-interface-status;
208 range "1..2147483647";
213 type yang:phys-address;
215 "The sub-interface's Media Access Control (MAC) address.";
224 * Only symetrical rewrite is supported
226 grouping tag-rewrite {
227 description "Flexible rewrite";
229 leaf vlan-type { // todo rename to push_dot1q, mandatory(?) with default true
238 description "The number of tags to pop (or translate if used in
239 conjunction with push-tags)";
245 description "The number of tags to push (or translate if used
246 in conjunction with pop-tags)";
248 * Server should order by increasing index.
256 * Only allow a push of an inner tag if an outer tag is also
260 count(../../push-tags[index = 0]/index) > 0" {
261 error-message "An inner tag can only be pushed if an outer
262 tag is also specified";
263 description "Only allow a push of an inner tag if an outer
264 tag is also being pushed";
268 uses dot1q:dot1q-tag;
272 grouping sub-interface-ip4-attributes {
274 // TODO: add currently unsupported:
275 // enabled, forwarding, mtu, address/origin(config false), neighbor/origin(config false)
277 // TODO: reuse groupings once ietf-ip provides them
280 "Parameters for the IPv4 address family (based on ietf-ip rev. 2014-06-16)";
285 "The list of configured IPv4 addresses on the interface.";
287 type inet:ipv4-address-no-zone;
289 "The IPv4 address on the interface.";
295 "The subnet can be specified as a prefix-length, or,
296 if the server supports non-contiguous netmasks, as
303 "The length of the subnet prefix.";
306 type yang:dotted-quad;
308 "The subnet specified as a netmask (contiguous)";
316 "A list of mappings from IPv4 addresses to
317 link-layer addresses.
319 Entries in this list are used as static entries in the
322 "RFC 826: An Ethernet Address Resolution Protocol";
325 type inet:ipv4-address-no-zone;
327 "The IPv4 address of the neighbor node.";
330 leaf link-layer-address {
331 type yang:phys-address;
334 "The link-layer address of the neighbor node.";
340 grouping sub-interface-ip6-attributes {
342 // TODO: add currently unsupported:
343 // enabled, forwarding, mtu, neighbor, dup-addr-detect-transmits, autoconf,
344 // address(config false): origin, status
345 // neighbor(config false): origin, is-router, state
347 // TODO: reuse groupings once ietf-ip provides them
350 "Parameters for the IPv6 address family (based on ietf-ip rev. 2014-06-16)";
355 "The list of configured IPv6 addresses on the interface.";
357 type inet:ipv6-address-no-zone;
359 "The IPv6 address on the interface.";
368 "The length of the subnet prefix.";
375 "A list of mappings from IPv6 addresses to
376 link-layer addresses.
378 Entries in this list are used as static entries in the
381 "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
384 type inet:ipv6-address-no-zone;
386 "The IPv6 address of the neighbor node.";
389 leaf link-layer-address {
390 type yang:phys-address;
393 "The link-layer address of the neighbor node.";
399 augment /if:interfaces/if:interface {
400 ext:augment-identifier "subinterface-augmentation";
402 container sub-interfaces {
403 description "L2 vlan subinterfaces";
412 uses sub-interface-base-attributes;
413 uses sub-interface-config-attributes;
414 uses sub-interface-ip4-attributes;
415 uses sub-interface-ip6-attributes;
420 augment /if:interfaces-state/if:interface {
421 ext:augment-identifier "subinterface-state-augmentation";
423 container sub-interfaces {
424 description "L2 vlan subinterfaces";
432 uses sub-interface-base-attributes;
433 uses sub-interface-operational-attributes;
434 uses sub-interface-ip4-attributes;
435 uses sub-interface-ip6-attributes;