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-yang-types {
28 typedef sub-interface-status {
35 // todo add 802dot1ad support to dot1q-types.yang
37 * Defines the supported IEEE 802.1Q types that can be used for
41 description "Base identity from which all VLAN types
48 "An 802.1Q VLAN type";
54 "An 802.1ad VLAN type";
61 description "Identifies a specific VLAN type";
64 grouping match-attributes {
67 description "Provides a choice of how the frames may be matched";
70 description "Default match";
74 "Default match. Matches all traffic not matched to any
75 other peer sub-interface by a more specific
81 description "Match untagged Ethernet frames only";
85 "Untagged match. Matches all untagged traffic.";
90 container vlan-tagged {
91 description "Matches VLAN tagged frames. Vlan tags need to be specified to use this match type";
93 leaf match-exact-tags {
97 "If set, indicates that all 802.1Q VLAN tags in the
98 Ethernet frame header must be explicitly matched, i.e.
99 the EtherType following the matched tags must not be a
100 802.1Q tag EtherType. If unset then extra 802.1Q VLAN
103 } // container vlan-tagged
104 } // case vlan-tagged
108 // TODO VPP does not allow to change subinterface nor delete it (except for tag-rewrite operation)
109 grouping sub-interface-base-attributes {
120 description "The VLAN tags to use by locally sourced traffic";
128 * Only allow a push of an inner tag if an outer tag is also
132 count(../../push-tags[index = 0]/index) > 0" {
133 error-message "An inner tag can only be pushed if an outer
134 tag is also specified";
135 description "Only allow a push of an inner tag if an outer
136 tag is also being pushed";
138 description "The index into the tag stack";
141 uses dot1q:dot1q-tag-or-any;
148 "The match used to classify frames to this interface";
149 uses match-attributes;
153 uses v3po:l2-base-attributes;
160 grouping sub-interface-config-attributes {
165 "Contains the configured, desired state of the sub-interface.
166 To enable sub-interface, the super inerface needs to be enabled";
170 grouping sub-interface-operational-attributes {
172 type sub-interface-status;
176 type sub-interface-status;
181 range "1..2147483647";
186 type yang:phys-address;
188 "The sub-interface's Media Access Control (MAC) address.";
197 * Only symetrical rewrite is supported
199 grouping tag-rewrite {
200 description "Flexible rewrite";
202 leaf vlan-type { // todo rename to push_dot1q, mandatory(?) with default true
211 description "The number of tags to pop (or translate if used in
212 conjunction with push-tags)";
218 description "The number of tags to push (or translate if used
219 in conjunction with pop-tags)";
221 * Server should order by increasing index.
229 * Only allow a push of an inner tag if an outer tag is also
233 count(../../push-tags[index = 0]/index) > 0" {
234 error-message "An inner tag can only be pushed if an outer
235 tag is also specified";
236 description "Only allow a push of an inner tag if an outer
237 tag is also being pushed";
241 uses dot1q:dot1q-tag;
245 augment /if:interfaces/if:interface {
246 ext:augment-identifier "subinterface-augmentation";
248 container sub-interfaces {
249 description "L2 vlan subinterfaces";
258 uses sub-interface-base-attributes;
259 uses sub-interface-config-attributes;
264 augment /if:interfaces-state/if:interface {
265 ext:augment-identifier "subinterface-state-augmentation";
267 container sub-interfaces {
268 description "L2 vlan subinterfaces";
276 uses sub-interface-base-attributes;
277 uses sub-interface-operational-attributes;