VLAN member interfaces and QinQ.
Version: 2021-08-12
module huawei-ethernet { yang-version 1; namespace "urn:huawei:yang:huawei-ethernet"; prefix ethernet; import huawei-pub-type { prefix pub-type; } import huawei-ifm { prefix ifm; } import huawei-vlan { prefix vlan; } import huawei-ip { prefix ip; } import huawei-extension { prefix ext; } organization "Huawei Technologies Co., Ltd."; contact "Huawei Industrial Base Bantian, Longgang Shenzhen 518129 People's Republic of China Website: http://www.huawei.com Email: support@huawei.com"; description "VLAN member interfaces and QinQ."; revision "2021-08-12" { description "Modify description."; reference "Huawei private."; } revision "2020-05-14" { description "Modify leaf node qinq-vids's condition."; reference "Huawei private."; } revision "2020-03-09" { description "Modify description."; reference "Huawei private."; } revision "2019-04-23" { description "Initial revision."; reference "Huawei private."; } ext:task-name "ethernet"; typedef link-type { type enumeration { enum "access" { value 1; description "Access port that accepts packets without VLAN tags."; } enum "trunk" { value 2; description "Trunk port that accepts packets with VLAN tags."; } enum "hybrid" { value 3; description "Hybrid port that accepts packets with or without VLAN tags."; } enum "dot1qtunnel" { value 4; description "Dot1q tunnel port that accepts packets with double tags."; } } description "Ethernet link type."; } typedef enable-type { type enumeration { enum "disable" { value 0; description "Disable type."; } enum "enable" { value 1; description "Enable type."; } } description "Ethernet enable type definition."; } typedef tag-type { type enumeration { enum "none" { value 0; description "None type."; } enum "local-switch" { value 1; description "Enable local switching on a sub-interface for QinQ VLAN tag termination."; } enum "rt-protocol" { value 2; description "Enable the termination sub-interface to support routing protocols."; } } description "Tag type."; } typedef group-mode-type { type enumeration { enum "multiple" { value 1; description "Users of a VLAN group are considered as multiple users."; } enum "single" { value 2; description "Users of a VLAN group are considered one user."; } } description "The type of group mode."; } typedef pw-tag-mode { type enumeration { enum "null" { value 0; description "Null type."; } enum "outer-vlan" { value 1; description "Outer VLAN tag."; } enum "inner-vlan" { value 2; description "Inner VLAN tag."; } enum "user-define" { value 3; description "User definded."; } } description "The mode of pw tag."; } typedef policy-type { type enumeration { enum "8021p" { value 1; description "802.1p type."; } enum "dscp" { value 2; description "DSCP type."; } enum "pppoe" { value 3; description "Ethernet encapsulation type pppoe."; } enum "default" { value 4; description "Default type."; } } description "Policy Type."; } typedef remark-type { type enumeration { enum "precedence" { value 0; description "The remark type is the user-defined precedence."; } enum "trust-ce-8021p" { value 1; description "Trust the 802.1p in the inner VLAN tag."; } enum "trust-pe-8021p" { value 2; description "Trust the 802.1p in the outer VLAN tag."; } } description "Remark type."; } typedef symmetry-type { type enumeration { enum "asymmetry" { value 0; description "Asymmetry type."; } enum "symmetry" { value 1; description "Symmetry type."; } enum "transparent" { value 2; description "Transparent type."; } } description "Symmetry Type."; } typedef action-type { type enumeration { enum "pop-outer" { value 0; description "Pop the outer VLAN tag."; } enum "push1-layer" { value 1; description "Push one VLAN tag."; } enum "swap" { value 2; description "Swap the inner and outer VLAN tags."; } enum "map-offset-increase" { value 3; description "Offset increasing."; } enum "map-1-to-1" { value 4; description "Map one VLAN tag to a specified VLAN tag."; } enum "map-2-to-1" { value 5; description "Map two VLAN tags to a specified VLAN tag."; } enum "map-1-to-2" { value 6; description "Map one VLAN tag to two VLAN tags."; } enum "map-2-to-2" { value 7; description "Map two VLAN tags to two VLAN tags."; } enum "pop-double" { value 8; description "Pop double VLAN tags."; } enum "push2-layer" { value 9; description "Push two VLAN tags."; } enum "map-offset-decrease" { value 10; description "Offset decreasing."; } enum "map-single-outbound" { value 12; description "Map the pe-vid in outbound interface."; } } description "Traffic action type."; } grouping group-l3-dot1q-vrrp { description "Configuration of dot1q vrrp."; list vrrp { key "vlan-id"; max-elements 1; description "Configure dot1q VRRP entry."; leaf vlan-id { type uint32 { range "1..4094"; } description "Specified VLAN ID."; } } // list vrrp } // grouping group-l3-dot1q-vrrp grouping group-l3-sub-policy-attribute { description "Configuration of policy."; leaf policy-type { ext:operation-exclude "update"; type policy-type; mandatory true; description "Policy type."; } leaf value-8021p { when "../policy-type='8021p'"; type pub-type:id-range { pattern '(([0-7])?(-([0-7]))?(,(([0-7])(-([0-7]))?))*)|((([\+|\-]([0-7]))|([\+|\-]\(([0-7])-([0-7])\)))?(,(([\+|\-]([0-7]))|([\+|\-]\(([0-7])-([0-7])\))))*)'; } mandatory true; description "802.1p policy value."; } leaf dscp-values { when "../policy-type='dscp'"; type pub-type:id-range { pattern '((6[0-3]|[1-5][0-9]|[0-9])?(-(6[0-3]|[1-5][0-9]|[0-9]))?(,((6[0-3]|[1-5][0-9]|[0-9])(-(6[0-3]|[1-5][0-9]|[0-9]))?))*)|((([\+|\-](6[0-3]|[1-5][0-9]|[0-9]))|([\+|\-]\((6[0-3]|[1-5][0-9]|[0-9])-(6[0-3]|[1-5][0-9]|[0-9])\)))?(,(([\+|\-](6[0-3]|[1-5][0-9]|[0-9]))|([\+|\-]\((6[0-3]|[1-5][0-9]|[0-9])-(6[0-3]|[1-5][0-9]|[0-9])\))))*)'; } mandatory true; description "DSCP policy value."; } } // grouping group-l3-sub-policy-attribute grouping group-dot1q-vlan-segment { description "Definition of the dot1q VLAN segment."; leaf vlan-id-begin { type uint16 { range "1..4094"; } description "Start VLAN ID in the user packet."; } leaf vlan-id-end { type uint16 { range "1..4094"; } must "(../vlan-id-end>=../vlan-id-begin)"; description "End VLAN ID in the user packet."; } } // grouping group-dot1q-vlan-segment grouping group-l3-sub-policy { description "Configuration of policy."; container policy-vlans { description "List of sub-interface policy VLAN."; list policy-vlan { key "vlan-id-begin vlan-id-end"; description "Apply sub-interface policy."; uses group-dot1q-vlan-segment; uses group-l3-sub-policy-attribute; } // list policy-vlan } // container policy-vlans } // grouping group-l3-sub-policy grouping group-l3-sub-pwtag { description "Configuration of pwtag."; leaf tag-vid-mode { type pw-tag-mode; mandatory true; description "Vid mode of pwtag."; } leaf tag-vid { when "(../tag-vid-mode='user-define')"; type uint16 { range "1..4094"; } mandatory true; description "User-defined VLAN ID."; } leaf tag-8021p-mode { type pw-tag-mode; default "null"; description "802.1p mode of pwtag."; } leaf tag-8021p-value { when "(../tag-8021p-mode='user-define')"; type uint8 { range "0..7"; } mandatory true; description "User-defined 802.1p value."; } } // grouping group-l3-sub-pwtag rpc create-qinq-termination { ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:flow-type/ethernet:qinq-termination/ethernet:qinq-termination"; description "Enable QinQ VLAN tag termination on a sub-interface."; input { leaf interface-name { type leafref { path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name"; } mandatory true; description "Name of a sub-interface. For example, Ethernet 0/1/0.1."; } leaf pe-vlan-begin { type uint16 { range "1..4094"; } mandatory true; description "Start outer VLAN ID."; } leaf pe-vlan-end { type uint16 { range "1..4094"; } description "End outer VLAN ID."; } leaf ce-vlan-begin { type uint16 { range "1..4094"; } mandatory true; description "Start inner VLAN ID."; } leaf ce-vlan-end { type uint16 { range "1..4094"; } description "End inner VLAN ID."; } leaf group-id { type uint8 { range "1..16"; } description "Specified VLAN group ID."; } } } // rpc create-qinq-termination rpc delete-qinq-termination { ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:flow-type/ethernet:qinq-termination/ethernet:qinq-termination"; description "Disable QinQ VLAN tag termination on a sub-interface."; input { leaf interface-name { type leafref { path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name"; } mandatory true; description "Name of a sub-interface. For example, Ethernet 0/1/0.1."; } leaf pe-vlan-begin { type uint16 { range "1..4094"; } mandatory true; description "Start outer VLAN ID."; } leaf pe-vlan-end { type uint16 { range "1..4094"; } description "End outer VLAN ID."; } leaf ce-vlan-begin { type uint16 { range "1..4094"; } mandatory true; description "Start inner VLAN ID."; } leaf ce-vlan-end { type uint16 { range "1..4094"; } description "End inner VLAN ID."; } leaf group-id { type uint8 { range "1..16"; } description "Specified VLAN group ID."; } } } // rpc delete-qinq-termination rpc create-user-vlan-qinq { ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:flow-type/ethernet:user-vlan-comm/ethernet:user-vlan-common/ethernet:user-vlan-qinqs/ethernet:user-vlan-qinq"; description "Create User-VLAN QinQ."; input { leaf interface-name { type leafref { path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name"; } mandatory true; description "Name of a sub-interface. For example, Ethernet 0/1/0.1."; } leaf pe-vlan-begin { type uint16 { range "1..4094"; } mandatory true; description "Start outer VLAN ID."; } leaf pe-vlan-end { type uint16 { range "1..4094"; } description "End outer VLAN ID."; } leaf ce-vlan-begin { type uint16 { range "1..4094"; } mandatory true; description "Start inner VLAN ID."; } leaf ce-vlan-end { type uint16 { range "1..4094"; } description "End inner VLAN ID."; } } } // rpc create-user-vlan-qinq rpc delete-user-vlan-qinq { ext:node-ref "/ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:flow-type/ethernet:user-vlan-comm/ethernet:user-vlan-common/ethernet:user-vlan-qinqs/ethernet:user-vlan-qinq"; description "Delete User-VLAN QinQ."; input { leaf interface-name { type leafref { path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name"; } mandatory true; description "Name of a sub-interface. For example, Ethernet 0/1/0.1."; } leaf pe-vlan-begin { type uint16 { range "1..4094"; } mandatory true; description "Start outer VLAN ID."; } leaf pe-vlan-end { type uint16 { range "1..4094"; } description "End outer VLAN ID."; } leaf ce-vlan-begin { type uint16 { range "1..4094"; } mandatory true; description "Start inner VLAN ID."; } leaf ce-vlan-end { type uint16 { range "1..4094"; } description "End inner VLAN ID."; } } } // rpc delete-user-vlan-qinq augment /ifm:ifm/ifm:interfaces/ifm:interface { description "Ethernet interface configuration."; container ethernet { description "Configure ethernet interface."; container main-interface { when "../../ifm:class='main-interface'"; description "Configure main-interface attribute."; leaf vlan-swap { type enable-type; default "disable"; description "Enable or disable VLAN tag swapping."; } leaf qinq-protocol { type pub-type:hex-binary { length "1..6"; pattern '(0x)[6-9a-f][0-9a-f]{2,3}'; } default "0x8100"; description "Ethernet type."; } container encapsulation { when "not(../l2-attribute)"; description "Configure ethernet tag attribute."; leaf pvid { type uint16 { range "0..4094"; } description "L3 port defalut VLAN ID."; } } // container encapsulation container l2-attribute { presence "Enables portswitch"; description "Configure interface Layer 2 attribute."; leaf link-type { type link-type; default "hybrid"; description "Link type."; } leaf pvid { when "../link-type!='trunk'"; type leafref { path "/vlan:vlan/vlan:vlans/vlan:vlan/vlan:id"; } must "/vlan:vlan/vlan:vlans/vlan:vlan[vlan:id=current()]/vlan:type!='super'"; description "Default VLAN ID."; } leaf trunk-vlans { when "../link-type='trunk' or ../link-type='hybrid'"; type pub-type:vlan-range; description "List of VLANs that are allowed to pass."; } leaf erps-auto-vlans { type pub-type:vlan-range; config false; description "List of VLANs created when the port is added to ERPS ring."; } leaf untag-vlans { when "../link-type='hybrid'"; type pub-type:vlan-range; description "List of untagged VLANs that are allowed to pass."; } leaf untag-discarding { type boolean; default "false"; description "Enable/disable discard untagged packets."; } container vlan-stackings { when "../link-type='trunk' or ../link-type='hybrid'"; description "List of VLAN stacking."; list vlan-stacking { must "ce-default or trans-vlans"; key "stacking-vlan"; unique "ce-default"; description "Configure VLAN stacking."; leaf stacking-vlan { type leafref { path "/vlan:vlan/vlan:vlans/vlan:vlan/vlan:id"; } must "/vlan:vlan/vlan:vlans/vlan:vlan[vlan:id=current()]/vlan:type!='super'"; description "VLAN ID in the outer VLAN tag after VLAN stacking is performed."; } leaf ce-default { type empty; must "not(../../../pvid)"; description "Add a VLAN tag to received untagged packets."; } leaf trans-vlans { type pub-type:vlan-range; description "List of VLAN IDs of received packets. VLANs are used to control traffic access. Only one VLAN can be configured on an interface and all its sub-interfaces."; } } // list vlan-stacking } // container vlan-stackings container vlan-stacking-remarks { when "../link-type='trunk' or ../link-type='hybrid'"; description "List of VLAN stacking with remark."; list vlan-stacking-remark { key "vlan-begin vlan-end"; description "Configure VLAN stacking interface with remark 8021p."; leaf vlan-begin { type uint16 { range "1..4094"; } description "The beginning VLAN before stacking."; } leaf vlan-end { type uint16 { range "1..4094"; } description "The end VLAN before stacking."; } leaf stack-vlan { type uint16 { range "1..4094"; } mandatory true; description "The VLAN after stacking."; } leaf remark-8021p { type uint16 { range "0..7"; } mandatory true; description "IEEE 802.1P encapsulation."; } } // list vlan-stacking-remark } // container vlan-stacking-remarks container vlan-mappings { when "../link-type='trunk' or ../link-type='hybrid'"; description "List of VLAN mapping configuration."; list vlan-mapping { key "mapping-vlan"; description "Configure VLAN mapping interface."; leaf mapping-vlan { type leafref { path "/vlan:vlan/vlan:vlans/vlan:vlan/vlan:id"; } description "VLAN ID in the VLAN tag after VLAN mapping is performed."; } leaf trans-vlans { type pub-type:vlan-range; mandatory true; description "List of VLAN IDs in VLAN tags before VLAN mapping is performed."; } } // list vlan-mapping } // container vlan-mappings container vlan-mapping-remarks { when "../link-type='trunk' or ../link-type='hybrid'"; description "List of VLAN mapping with remark."; list vlan-mapping-remark { key "vlan-begin vlan-end"; description "Configure VLAN mapping interface with remark 8021p."; leaf vlan-begin { type uint16 { range "1..4094"; } description "The beginning VLAN before mapping."; } leaf vlan-end { type uint16 { range "1..4094"; } description "The end VLAN before mapping."; } leaf mapping-vlan { type uint16 { range "1..4094"; } mandatory true; description "The VLAN after mapping."; } leaf remark-8021p { type uint16 { range "0..7"; } mandatory true; description "IEEE 802.1P encapsulation."; } } // list vlan-mapping-remark } // container vlan-mapping-remarks container statistics-enable-vlans { description "Configure VLAN statistics collection enable."; leaf vlans { type pub-type:vlan-range; description "VLAN list. The specified VLAN must have been added to an interface."; } } // container statistics-enable-vlans container port-isolate-groups { description "List of port isolate groups."; list port-isolate-group { key "group-id"; description "Configure port isolate group."; leaf group-id { type int32 { range "1..64"; } description "Group ID."; } } // list port-isolate-group } // container port-isolate-groups } // container l2-attribute } // container main-interface container l3-sub-interface { when "../../ifm:class='sub-interface'"; description "Configure l3 sub-interface attribute."; container vlan-groups { description "List of sub-interface VLAN group."; list vlan-group { key "id"; description "Configure sub-interface VLAN group."; leaf id { type uint8 { range "1..16"; } description "Specified VLAN group ID."; } leaf mode { ext:operation-exclude "update" { when "(../../../qinq-termination/qinq-vids/qinq-vid/group-id[.=current()/../id]) or (../../../dot1q-termination/dot1q-vlans/dot1q-vlans-group/group-id[.=current()/../id]) or (../../../dot1q-termination/dot1q-vlans-policy/policy-vlan-groups/policy-vlan-group/group-id[.=current()/../id]) or (../../../qinq-mapping/mapping-vids/mapping-vid/group-id[.=current()/../id]) or (../../../qinq-stacking/stacking-vid/group-id[.=current()/../id]) or (../../../stacking-policy/policy-vlan-groups/policy-vlan-group/group-id[.=current()/../id])"; description "The mode cannot be modified after the VLAN group is referenced."; } type group-mode-type; default "single"; description "Include single and multiple modes. The mode cannot be modified after being referenced."; } leaf statistic-enable { type boolean; default "false"; description "Enable/disable VLAN group-based QinQ packet statistics."; } leaf description { type string { length "1..31"; } description "VLAN group description."; } } // list vlan-group } // container vlan-groups choice flow-type { description "Specify an encapsulation type. After an encapsulation type is specified, it cannot be changed to another encapsulation type. In addition, it can not be deleted if a service has been configured in the same interface. If an encapsulation type fails to be specified, see the error message to determine the failure cause."; case vlan-type { description "Configuration of VLAN-type dot1q."; container vlan-type-dot1q { presence "Vlan type dot1q."; description "Configure VLAN-type dot1q."; leaf vlan-type-vid { type uint16 { range "1..4094"; } mandatory true; description "VLAN ID of the VLAN sub-interface;"; } } // container vlan-type-dot1q } // case vlan-type case dot1q-termination { description "Configuration of dot1q termination."; container dot1q-termination { must "not(dot1q-vlans/dot1q-vlans-group or dot1q-vlans/dot1q-vlans/vlan-list) or not(dot1q-vlans-policy/policy-vlans/policy-vlan or dot1q-vlans-policy/policy-vlan-groups/policy-vlan-group)"; presence "Dot1q termination."; description "Configure dot1q termination."; leaf tag { ext:operation-exclude "update"; type tag-type; must "(../tag='none' or ../tag='rt-protocol')"; mandatory true; description "Tag type."; } leaf arp-broadcast-enable { type boolean; default "false"; description "Enable/disable ARP broadcast."; } container dot1q-vlans { description "List of dot1q termination configuration. When tag-type is rt-protocol, this node can only configure one VLAN."; list dot1q-vlans-group { key "group-id"; description "Configure dot1q termination."; leaf group-id { type leafref { path "../../../../vlan-groups/vlan-group/id"; } description "Specified VLAN group ID."; } leaf vlan-list { type pub-type:vlan-range; mandatory true; description "Dot1q termination VLAN ID list."; } } // list dot1q-vlans-group container dot1q-vlans { presence "dot1q vlans."; description "Configure dot1q termination."; leaf vlan-list { type pub-type:vlan-range; mandatory true; description "Dot1q termination VLAN ID list. The VLAN in VLAN-list can not exist in the VLAN-list of dot1q-VLANs-group."; } } // container dot1q-vlans } // container dot1q-vlans container dot1q-vlans-policy { must "(../tag!='rt-protocol') or (not(policy-vlans/policy-vlan) or not(policy-vlan-groups/policy-vlan-group))"; description "Configure VLAN policy encapsulation list."; uses group-l3-sub-policy { refine policy-vlans/policy-vlan/vlan-id-end { must "../../../../tag!='rt-protocol' or (../vlan-id-end=../vlan-id-begin)"; } refine policy-vlans { must "../../tag!='rt-protocol' or (count(../policy-vlans/policy-vlan)<=1)"; } } container policy-vlan-groups { must "../../tag!='rt-protocol' or (count(../policy-vlan-groups/policy-vlan-group)<=1)"; description "List of sub-interface policy VLAN with gorup."; list policy-vlan-group { key "group-id vlan-id-begin vlan-id-end"; description "Apply sub-interface policy."; leaf group-id { type leafref { path "../../../../../vlan-groups/vlan-group/id"; } description "Specified VLAN group ID."; } uses group-dot1q-vlan-segment { refine vlan-id-end { must "../../../../tag!='rt-protocol' or (../vlan-id-end=../vlan-id-begin)"; } } uses group-l3-sub-policy-attribute; } // list policy-vlan-group } // container policy-vlan-groups } // container dot1q-vlans-policy container vrrps { description "Configure dot1q VRRP list. VLAN-id must be configured on the interface."; uses group-l3-dot1q-vrrp; } // container vrrps container pwtag { must "not(../dot1q-vlans-policy)"; presence "PW tag configuration"; description "Configure the P-Tag of the packets in the PW with VLAN."; uses group-l3-sub-pwtag { refine tag-vid-mode { must "(../tag-vid-mode='user-define' or ../tag-vid-mode='outer-vlan')"; } refine tag-8021p-mode { must "(../tag-8021p-mode!='inner-vlan')"; } } } // container pwtag } // container dot1q-termination } // case dot1q-termination case qinq-termination { description "Configuration of QinQ termination."; container qinq-termination { presence "QinQ termination."; description "Configure QinQ termination."; leaf tag { ext:operation-exclude "update"; type tag-type; mandatory true; description "Tag type, include local switching, rt-protocol and none type, this value can not be merged."; } leaf arp-broadcast-enable { type boolean; default "false"; description "Enable/disable ARP broadcast."; } container remark-8021p { when "../qinq-vids"; must "(remark-type='precedence' and precedence-value) or (remark-type!='precedence') or not(remark-type)"; description "Configure 802.1p mapping."; leaf remark-type { type remark-type; default "trust-pe-8021p"; description "Trust the 802.1p in the outer VLAN tag, inner VLAN tag, or user-defined precedence."; } leaf precedence-value { when "../remark-type='precedence'"; type uint8 { range "0..7"; } description "User-defined 802.1p value."; } } // container remark-8021p container symmetry-mode { description "Configure symmetry mode."; leaf symmetry-type { ext:operation-exclude "update" { when "../../qinq-vids/qinq-vid"; description "Symmetry-type cannot be updated when qinq-vids is configured."; } type symmetry-type; must "../../tag='none' or ../symmetry-type='asymmetry' or ../symmetry-type='symmetry'"; default "asymmetry"; description "Symmetry type."; } leaf user-mode { when "../symmetry-type='symmetry'"; type enable-type; default "disable"; description "Enable or disable the user mode."; } } // container symmetry-mode container qinq-vids { must "(../tag!='rt-protocol' or (count(../qinq-vids/qinq-vid)<=1))"; description "List of QinQ termination configuration."; list qinq-vid { must "(ce-vlan-end>=ce-vlan-begin) and (pe-vlan-end>=pe-vlan-begin)"; must "((../../tag!='rt-protocol') or ((ce-vlan-end=ce-vlan-begin and pe-vlan-end=pe-vlan-begin)))"; key "pe-vlan-begin pe-vlan-end ce-vlan-begin ce-vlan-end"; description "Configure QinQ termination."; leaf pe-vlan-begin { type uint16 { range "1..4094"; } description "Start outer VLAN ID."; } leaf pe-vlan-end { type uint16 { range "1..4094"; } description "End outer VLAN ID."; } leaf ce-vlan-begin { type uint16 { range "1..4094"; } description "Start inner VLAN ID."; } leaf ce-vlan-end { type uint16 { range "1..4094"; } description "End inner VLAN ID."; } leaf group-id { ext:operation-exclude "create|delete|update"; type leafref { path "../../../../vlan-groups/vlan-group/id"; } description "Specified VLAN group ID. The group-id cannot be modified after the qinq-vid is created."; } } // list qinq-vid } // container qinq-vids container pwtag { presence "PW tag configuration"; description "Configure the P-Tag of the packets in the PW with VLAN."; uses group-l3-sub-pwtag { refine tag-vid-mode { must "(../tag-vid-mode!='null')"; } } } // container pwtag } // container qinq-termination } // case qinq-termination case qinq-stacking { description "Configuration of QinQ stacking."; container qinq-stacking { must "not(../../../ip:ipv6)"; must "not(../../../ip:ipv4/ip:addresses/ip:address)"; must "not(../../../ip:ipv4/ip:unnumbered-address/ip:unnumbered-if-name)"; must "../../../ifm:vrf-name='_public_'"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:user-vlan-any)"; presence "qinq-stacking type"; description "Enable/disable QinQ stacking configuration list."; leaf pe-vid { type uint16 { range "1..4094"; } description "Outer VLAN ID."; } list stacking-vid { must "(vlan-id-end>=vlan-id-begin)"; key "vlan-id-begin vlan-id-end"; description "Apply QinQ stacking configuration policy."; leaf vlan-id-begin { type uint16 { range "1..4094"; } description "QinQ stacking outside VLAN."; } leaf vlan-id-end { type uint16 { range "1..4094"; } description "QinQ stacking inside VLAN."; } leaf group-id { type leafref { path "../../../vlan-groups/vlan-group/id"; } must "count(../../../vlan-groups/vlan-group/id)=1"; description "Specified VLAN group ID."; } } // list stacking-vid } // container qinq-stacking } // case qinq-stacking case qinq-mapping { description "Configuration of QinQ mapping."; container qinq-mapping { must "not(../../../ip:ipv6)"; must "not(../../../ip:ipv4/ip:addresses/ip:address)"; must "not(../../../ip:ipv4/ip:unnumbered-address/ip:unnumbered-if-name)"; must "../../../ifm:vrf-name='_public_'"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:user-vlan-any)"; presence "qinq-mapping type"; description "Configure QinQ mapping."; container mapping-vids { description "List of QinQ mapping VLAN ID."; list mapping-vid { key "vlan-id"; unique "mapping-vlan-id"; description "Configure QinQ mapping."; leaf vlan-id { type uint16 { range "1..4094"; } must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:qinq-mapping/ethernet:mapping-vids/ethernet:mapping-vid[ethernet:vlan-id=current()])"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../../../../../../ifm:parent-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:pvid[.=current()])"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:vlan-type-dot1q/ethernet:vlan-type-vid[.=current()])"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:vlan-type-policy/ethernet:vlan-type-vid[.=current()])"; description "VLAN ID."; } leaf mapping-vlan-id { ext:operation-exclude "update"; type uint16 { range "1..4094"; } must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:qinq-mapping/ethernet:mapping-vids/ethernet:mapping-vid[ethernet:mapping-vlan-id=current()])"; mandatory true; description "VLAN ID after VLAN mapping is performed."; } leaf group-id { ext:operation-exclude "create|delete|update"; type leafref { path "../../../../vlan-groups/vlan-group/id"; } description "Specified VLAN group ID."; } } // list mapping-vid } // container mapping-vids } // container qinq-mapping } // case qinq-mapping case vlan-type-policy { description "Configuration of VLAN-type dot1q policy."; container vlan-type-policy { must "not(../vlan-groups/vlan-group)"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:user-vlan-any)"; presence "Vlan type dot1q policy."; description "Configure VLAN-type dot1q policy."; leaf vlan-type-vid { ext:operation-exclude "update"; type uint16 { range "1..4094"; } must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../../../../ifm:parent-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:pvid[.=current()/../vlan-type-vid])"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:vlan-type-dot1q/ethernet:vlan-type-vid[.=current()/../vlan-type-vid])"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../../ifm:parent-name]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:qinqs/ethernet:qinq-vids/ethernet:qinq-vid[ethernet:pe-vlan-id=current()/../vlan-type-vid])"; mandatory true; description "VLAN ID of the VLAN sub-interface."; } uses group-l3-sub-policy-attribute; } // container vlan-type-policy } // case vlan-type-policy case qinq-stacking-policy { description "Configuration of qinq stacking policy."; container stacking-policy { must "(policy-vlan-groups/policy-vlan-group) or (policy-vlans/policy-vlan)"; presence "qinq-stacking policy type."; description "Configure VLAN policy encapsulation list."; uses group-l3-sub-policy; container policy-vlan-groups { description "List of sub-interface policy VLAN with gorup."; list policy-vlan-group { key "group-id vlan-id-begin vlan-id-end"; description "Apply sub-interface policy."; leaf group-id { type leafref { path "../../../../vlan-groups/vlan-group/id"; } description "Specified VLAN group ID."; } uses group-dot1q-vlan-segment; uses group-l3-sub-policy-attribute; } // list policy-vlan-group } // container policy-vlan-groups } // container stacking-policy } // case qinq-stacking-policy case untag-policy { description "Configuration of untag policy."; container untag-policy { must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../../../ifm:parent-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:pvid)"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:user-vlan-any)"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../ifm:parent-name]/ethernet:ethernet/ethernet:l2-sub-interface/ethernet:default)"; must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../../../ifm:name]/ip:ipv6)"; must "count(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:untag-policy)<=8"; must "count(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:parent-name=current()/../../../ifm:parent-name]/ethernet:ethernet/ethernet:l3-sub-interface/ethernet:untag-policy[ethernet:policy-type='default'])<=1"; presence "Untag policy."; description "Configure untag."; leaf policy-type { ext:operation-exclude "update"; type policy-type; must "../policy-type='dscp' or (../policy-type='default' and not (/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../../../../ifm:parent-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:vlan-stackings/ethernet:vlan-stacking/ethernet:ce-default))"; mandatory true; description "Policy type."; } leaf dscp-values { when "../policy-type='dscp'"; type pub-type:id-range { pattern '((6[0-3]|[1-5][0-9]|[0-9])?(-(6[0-3]|[1-5][0-9]|[0-9]))?(,((6[0-3]|[1-5][0-9]|[0-9])(-(6[0-3]|[1-5][0-9]|[0-9]))?))*)|((([\+|\-](6[0-3]|[1-5][0-9]|[0-9]))|([\+|\-]\((6[0-3]|[1-5][0-9]|[0-9])-(6[0-3]|[1-5][0-9]|[0-9])\)))?(,(([\+|\-](6[0-3]|[1-5][0-9]|[0-9]))|([\+|\-]\((6[0-3]|[1-5][0-9]|[0-9])-(6[0-3]|[1-5][0-9]|[0-9])\))))*)'; } mandatory true; description "DSCP policy value. The dscp-values ranges of different sub-interfaces on the same main interface cannot overlap."; } } // container untag-policy } // case untag-policy case user-vlan-comm { description "User VLAN common configuration."; container user-vlan-common { description "Configure user VLAN QinQ."; container user-vlan-qinqs { description "List of user VLAN QinQ configuration."; list user-vlan-qinq { must "((pe-vlan-end>=pe-vlan-begin) and (ce-vlan-end>=ce-vlan-begin))"; key "pe-vlan-begin pe-vlan-end ce-vlan-begin ce-vlan-end"; description "Configure user VLAN QinQ."; leaf pe-vlan-begin { type uint16 { range "1..4094"; } description "Start outer VLAN ID."; } leaf pe-vlan-end { type uint16 { range "1..4094"; } description "End outer VLAN ID."; } leaf ce-vlan-begin { type uint16 { range "1..4094"; } description "Start inner VLAN ID."; } leaf ce-vlan-end { type uint16 { range "1..4094"; } description "End inner VLAN ID."; } } // list user-vlan-qinq container descriptions { description "List of user VLAN description."; list description { key "pe-vlan-id ce-vlan-id"; description "Configure description of user VLAN."; leaf pe-vlan-id { type uint16 { range "1..4094"; } description "Outer VLAN ID."; } leaf ce-vlan-id { type uint16 { range "1..4094"; } description "Inner VLAN ID."; } leaf description { type string { length "1..128"; } mandatory true; description "Description of the user VLAN."; } } // list description } // container descriptions } // container user-vlan-qinqs container user-vlan-dot1q { presence "User VLAN dot1q type"; description "Configure user VLAN dot1q."; leaf vlan-list { type pub-type:vlan-range; mandatory true; description "User VLAN dot1q VLAN ID list."; } container descriptions { description "List of user VLAN dot1q description."; list description { key "vlan-id"; description "Configure user VLAN dot1q description."; leaf vlan-id { type uint16 { range "1..4094"; } description "VLAN ID."; } leaf description { type string { length "1..128"; } mandatory true; description "Description of the user VLAN."; } } // list description } // container descriptions } // container user-vlan-dot1q } // container user-vlan-common } // case user-vlan-comm case user-vlan-any { description "User VLAN any configuration."; container user-vlan-any { presence "User VLAN any configuration"; description "Enable/disable user VLAN any configuration."; } // container user-vlan-any } // case user-vlan-any } // choice flow-type } // container l3-sub-interface container l2-sub-interface { when "../../ifm:l2-mode-enable='true'"; description "Configure l2 sub interface attribute."; leaf local-switch { type enable-type; default "disable"; description "Enable/disable local switching on a sub-interface for QinQ VLAN tag termination."; } choice flow-type { description "Encapsulation type."; case default { description "Default encapsulation."; container default { presence "flow type is default."; description "Configure default encapsulation."; } // container default } // case default case untag { description "Untag encapsulation."; container untag { must "not(/ifm:ifm/ifm:interfaces/ifm:interface[ifm:name=current()/../../../ifm:parent-name]/ethernet:ethernet/ethernet:main-interface/ethernet:l2-attribute/ethernet:vlan-stackings/ethernet:vlan-stacking/ethernet:ce-default)"; presence "flow type is untag."; description "Configure untag encapsulation."; } // container untag } // case untag case dot1q { description "Dot1q encapsulation."; container dot1q { presence "flow type is flowDot1q."; description "Configure dot1q encapsulation list."; choice policy { description "Dot1q encapsulation."; case no-policy { description "Dot1q encapsulation without policy."; container vlans { description "Configure VLAN encapsulation list."; leaf vlan-list { type pub-type:vlan-range; description "VLAN list."; } } // container vlans } // case no-policy case policy { description "Dot1q encapsulation with policy."; container policy-vlans { description "List of VLAN policy encapsulation."; list policy-vlan { must "vlan-id-end>=vlan-id-begin"; key "vlan-id-begin vlan-id-end"; description "Apply VLAN encapsulation policy."; leaf vlan-id-begin { type uint16 { range "1..4094"; } description "Start VLAN ID in the user packet."; } leaf vlan-id-end { type uint16 { range "1..4094"; } description "End VLAN ID in the user packet."; } leaf dot1q-8021p { type pub-type:id-range { length "1..31"; pattern '(([0-7])?(-([0-7]))?(,(([0-7])(-([0-7]))?))*)|((([\+|\-]([0-7]))|([\+|\-]\(([0-7])-([0-7])\)))?(,(([\+|\-]([0-7]))|([\+|\-]\(([0-7])-([0-7])\))))*)'; } mandatory true; description "User-defined 802.1p priority value."; } } // list policy-vlan } // container policy-vlans } // case policy } // choice policy } // container dot1q } // case dot1q case qinq { description "Qinq encapsulation."; container qinqs { presence "flow type is flowQinq."; description "Configure QinQ encapsulation list."; container qinq-vids { description "List of QinQ encapsulation."; list qinq-vid { must "not(../../qinq-vid-ce-default/pe-vlan-list)"; key "pe-vlan-id"; description "Configure QinQ encapsulation."; leaf pe-vlan-id { type uint16 { range "1..4094"; } description "Outer VLAN ID."; } leaf ce-vlan-list { type pub-type:vlan-range; mandatory true; description "CE VLAN ID list."; } } // list qinq-vid } // container qinq-vids container qinq-vid-ce-default { description "Configure QinQ encapsulation. The CE VLAN ID is not specified."; leaf pe-vlan-list { type pub-type:vlan-range; must "not(../../qinq-vids/qinq-vid)"; description "PE VLAN ID list."; } } // container qinq-vid-ce-default container qinq-with-pe-segments { description "List of QinQ encapsulation with PE VLAN segment."; list qinq-with-pe-segment { must "((pe-vlan-end>pe-vlan-begin) and (ce-vlan-end>=ce-vlan-begin))"; key "pe-vlan-begin pe-vlan-end ce-vlan-begin ce-vlan-end"; description "Configure QinQ encapsulation with PE VLAN segment."; leaf pe-vlan-begin { type uint16 { range "1..4094"; } description "Start outer VLAN ID."; } leaf pe-vlan-end { type uint16 { range "1..4094"; } description "End outer VLAN ID."; } leaf ce-vlan-begin { type uint16 { range "1..4094"; } description "Start inner VLAN ID."; } leaf ce-vlan-end { type uint16 { range "1..4094"; } description "End inner VLAN ID."; } } // list qinq-with-pe-segment } // container qinq-with-pe-segments } // container qinqs } // case qinq } // choice flow-type container flow-action { presence "flow action"; description "Configure packet rewriting information. If the interface is bound to a BD, this node cannot be modified."; leaf action-type { type action-type; must "(../action-type='push1-layer' ) or (../../dot1q and (../action-type='pop-outer' or ../action-type='map-offset-increase' or ../action-type='map-1-to-1' or ../action-type='map-1-to-2' or ../action-type='push2-layer' or ../action-type='map-offset-decrease' or ../action-type='map-single-outbound') ) or (../../qinqs and not(../../qinqs/qinq-vid-ce-default/pe-vlan-list) and ../action-type!='push2-layer') or (../../qinqs/qinq-vid-ce-default/pe-vlan-list and ../action-type!='pop-double' and ../action-type!='map-2-to-1' and ../action-type!='map-2-to-2' and ../action-type!='push2-layer') or (../../untag and (../action-type='push2-layer')) or not(../../default or ../../dot1q or ../../qinqs or ../../untag)"; mandatory true; description "Specify a traffic action type."; } leaf out-vlan-id { when "../action-type='map-1-to-1' or ../action-type='map-1-to-2' or ../action-type='map-2-to-1' or ../action-type='map-2-to-2' or ../action-type='push1-layer' or ../action-type='push2-layer'"; type uint32 { range "1..4094"; } mandatory true; description "Modified outer VLAN ID."; } leaf inner-vlan-id { when "../action-type='map-1-to-2' or ../action-type='map-2-to-2' or ../action-type='push2-layer'"; type uint32 { range "1..4094"; } mandatory true; description "Modified inner VLAN ID."; } leaf outer-8021p { when "../action-type='map-1-to-1' or ../action-type='map-1-to-2' or ../action-type='map-2-to-1' or ../action-type='map-2-to-2' or ../action-type='push1-layer' or ../action-type='push2-layer'"; type uint8 { range "0..7"; } description "Modified outer 802.1p."; } leaf inner-8021p { when "../action-type='map-1-to-2' or ../action-type='map-2-to-2' or ../action-type='push2-layer'"; type uint8 { range "0..7"; } description "Modified inner 802.1p."; } leaf offset-value { when "../action-type='map-offset-decrease' or ../action-type='map-offset-increase'"; type uint16 { range "1..4093"; } mandatory true; description "Offset value of the modified VLAN."; } } // container flow-action } // container l2-sub-interface } // container ethernet } } // module huawei-ethernet
© 2023 YumaWorks, Inc. All rights reserved.