+++ /dev/null
-module ex-vlan {
- namespace "http://example.com/vlan";
- prefix "vlan";
-
- import ietf-interfaces {
- prefix if;
- }
-
- revision 2013-10-22 {
- description
- "Initial revision.";
- reference
- "RFC A YANG Data Model for Interface Management draft-ietf-netmod-interfaces-cfg-12 - Appendix C";
- }
-
- augment "/if:interfaces/if:interface" {
- when "if:type = 'ethernetCsmacd' or
- if:type = 'ieee8023adLag'";
- leaf vlan-tagging {
- type boolean;
- default false;
- }
- }
-
- augment "/if:interfaces/if:interface" {
- when "if:type = 'l2vlan'";
-
- leaf base-interface {
- type if:interface-ref;
- must "/if:interfaces/if:interface[if:name = current()]"
- + "/vlan:vlan-tagging = 'true'" {
- description
- "The base interface must have vlan tagging enabled.";
- }
- }
- leaf vlan-id {
- type uint16 {
- range "1..4094";
- }
- must "../base-interface" {
- description
- "If a vlan-id is defined, a base-interface must
- be specified.";
- }
- }
- }
-}
\ No newline at end of file