module openconfig-vlan { yang-version "1"; // namespace namespace "http://openconfig.net/yang/vlan"; prefix "oc-vlan"; // import some basic types import openconfig-vlan-types { prefix oc-vlan-types; } import openconfig-interfaces { prefix oc-if; } import openconfig-if-ethernet { prefix oc-eth; } import openconfig-if-aggregate { prefix oc-lag; } import iana-if-type { prefix ift; } import openconfig-extensions { prefix oc-ext; } // meta organization "OpenConfig working group"; contact "OpenConfig working group netopenconfig@googlegroups.com"; description "This module defines configuration and state variables for VLANs, in addition to VLAN parameters associated with interfaces"; oc-ext:openconfig-version "3.0.1"; revision "2018-06-05" { description "Fix bugs in when statements."; reference "3.0.1"; } revision "2018-02-14" { description "Fix bug with name of 802.1ad identity."; reference "3.0.0"; } revision "2017-07-14" { description "Move top-level vlan data to network-instance; Update identities to comply to style guide; fixed pattern quoting; corrected trunk vlan types; added TPID config to base interface."; reference "2.0.0"; } revision "2016-05-26" { description "OpenConfig public release"; reference "1.0.2"; } // grouping statements grouping vlan-config { description "VLAN configuration container."; leaf vlan-id { type oc-vlan-types:vlan-id; description "Interface VLAN id."; } leaf name { type string; description "Interface VLAN name."; } leaf status { type enumeration { enum ACTIVE { description "VLAN is active"; } enum SUSPENDED { description "VLAN is inactive / suspended"; } } default ACTIVE; description "Admin state of the VLAN"; } } grouping vlan-state { description "State variables for VLANs"; // placeholder } grouping vlan-tpid-config { description "TPID configuration for dot1q-enabled interfaces"; leaf tpid { type identityref { base oc-vlan-types:TPID_TYPES; } default oc-vlan-types:TPID_0X8100; description "Optionally set the tag protocol identifier field (TPID) that is accepted on the VLAN"; } } grouping vlan-tpid-state { description "TPID opstate for dot1q-enabled interfaces"; // placeholder } grouping vlan-members-state { description "List of interfaces / subinterfaces belonging to the VLAN."; container members { description "Enclosing container for list of member interfaces"; list member { config false; description "List of references to interfaces / subinterfaces associated with the VLAN."; uses oc-if:base-interface-ref-state; } } } grouping vlan-switched-config { description "VLAN related configuration that is part of the physical Ethernet interface."; leaf interface-mode { type oc-vlan-types:vlan-mode-type; description "Set the interface to access or trunk mode for VLANs"; } leaf native-vlan { when "../interface-mode = 'TRUNK'" { description "Native VLAN is valid for trunk mode interfaces"; } type oc-vlan-types:vlan-id; description "Set the native VLAN id for untagged frames arriving on a trunk interface. Tagged frames sent on an interface configured with a native VLAN should have their tags stripped prior to transmission. This configuration is only valid on a trunk interface."; } leaf access-vlan { when "../interface-mode = 'ACCESS'" { description "Access VLAN assigned to the interfaces"; } type oc-vlan-types:vlan-id; description "Assign the access vlan to the access port."; } leaf-list trunk-vlans { when "../interface-mode = 'TRUNK'" { description "Allowed VLANs may be specified for trunk mode interfaces."; } type union { type oc-vlan-types:vlan-id; type oc-vlan-types:vlan-range; } description "Specify VLANs, or ranges thereof, that the interface may carry when in trunk mode. If not specified, all VLANs are allowed on the interface. Ranges are specified in the form x..y, where x