blob: 85bf697a28e3c28ad58dbbb59fb615ebcedcb027 [file] [log] [blame]
module bbf-l2-access-attributes {
yang-version 1.1;
namespace "urn:bbf:yang:bbf-l2-access-attributes";
prefix bbf-l2access-attr;
import bbf-dot1q-types {
prefix bbf-dot1qt;
}
import ietf-network {
prefix nw;
}
import ietf-network-topology {
prefix nt;
}
organization
"Broadband Forum <https://www.broadband-forum.org>
Common YANG Work Area";
contact
"Comments or questions about this Broadband Forum YANG module
should be directed to <mailto:help@broadband-forum.org>.
Editor: TBD
PS Leader: TBD
WA Director: TBD";
description
"This module contains a collection of YANG definitions for
simplifying the Access Device Model as exposed over NBI of BAA.
Copyright (c) 2022, Broadband Forum
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The above license is used as a license under copyright only.
Please reference the Forum IPR Policy for patent licensing terms
<https://www.broadband-forum.org/ipr-policy>.
Any moral rights which are necessary to exercise under the above
license grant are also deemed granted under this license.
This version of this YANG module is part of TR-383a4; see
the TR itself for full legal notices.";
revision 2021-09-30 {
description
"Initial revision.";
reference
"RFC 8944: A YANG Data Model for Layer 2 Network Topologies";
}
grouping access-tag {
leaf tag-type {
type union {
type bbf-dot1qt:dot1q-tag-type;
type uint16;
type enumeration {
enum any {
description
"Matches any tag type.";
}
}
}
default "any";
description
"VLAN tag type.";
}
leaf vlan-id {
type union {
type bbf-dot1qt:vlan-id-range;
type enumeration {
enum any {
description
"Matches any VLAN-ID in the range 1 to 4094, or
matches priority tagged frames.";
}
enum priority-tagged {
description
"Priority-tagged frames are frames with a VLAN tag
present and that match VLAN-ID 0.";
}
enum vlan-id-is-a-parameter {
description
"The VLAN ID is not
specified inside this profile but has to be
specified at the place where this profile
is referenced.";
}
}
}
mandatory true;
description
"Allowed VLAN-IDs.";
}
leaf pbit {
type union {
type bbf-dot1qt:pbit-list;
type enumeration {
enum any {
description
"Matches any pbit value in the range of 0 to 7.";
}
}
}
description
"Allowed PBIT values.";
}
}
grouping access-vlan-tag-match {
description
"Flexible match on the VLAN tags of Ethernet frames.";
choice vlan-tag-match-type {
description
"Provides a choice of how the frames may be matched.";
case untagged {
leaf untagged {
type empty;
description
"Untagged match. Matches all untagged traffic.";
}
}
case vlan-tagged {
container outer-tag {
description
"Classifies traffic using the outermost VLAN tag on the
frame.";
uses access-tag;
}
container second-tag {
description
"Classifies traffic using the second outermost VLAN tag
on the frame.";
uses access-tag;
}
}
}
}
grouping access-vlan-tag-rewrite {
description
"Flexible match on the VLAN tags of Ethernet frames.";
leaf pop-tags {
type uint8 {
range "0..2";
}
description
"The number of tags to pop.";
}
container push-outer-tag {
description
"The outermost VLAN tag to push onto the frame.";
uses access-tag;
}
container push-second-tag {
description
"The second outermost VLAN tag to push onto the frame.";
uses access-tag;
}
}
grouping vlan-match-and-rewrite {
description
"Configuration of frame vlan tag processing, include frame classification and vlan tag rewrite";
container match-criteria {
description
"This container collects match criteria for various frame fields.";
uses access-vlan-tag-match;
}
container ingress-rewrite {
description
"Ingress rewrite refers to the supported tag manipulations
before the frame is offered to a higher layer interface or
to a forwarder or to a destination termination-point.";
uses access-vlan-tag-rewrite;
}
}
grouping l2-access-attributes {
description
"Flexible match on the VLAN tags of Ethernet frames.";
container vlan-translation {
leaf translation-profile {
type leafref {
path
"/bbf-l2access-attr:vlan-translation-profiles/bbf-l2access-attr:"
+ "vlan-translation-profile/bbf-l2access-attr:name";
}
description
"A reference to a vlan translation profile that contains
frame vlan classification and vlan tag rewrite.";
}
leaf outer-vlan-id {
when
'/bbf-l2access-attr:vlan-translation-profiles/'
+ 'bbf-l2access-attr:vlan-translation-profile[bbf-l2access-attr:'
+ 'name = current()/../../vlan-translation-profile]/'
+ 'match-criteria/outer-tag/vlan-id = '
+ '"vlan-id-is-a-parameter" ' {
description
"Match criteria for the outer VLAN tag of a frame that
overrules the match criteria provided through the
referenced vlan translaton profile.";
}
type bbf-dot1qt:vlan-id;
}
leaf second-vlan-id {
when
'/bbf-l2access-attr:vlan-translation-profiles/'
+ 'bbf-l2access-attr:vlan-translation-profile[bbf-l2access-attr:'
+ 'name = current()/../../vlan-translation-profile]/'
+ 'match-criteria/second-tag/vlan-id = '
+ '"vlan-id-is-a-parameter" ' {
description
"Match criteria for the second VLAN tag of a frame that
overrules the match criteria provided through the
referenced vlan translaton profile.";
}
type bbf-dot1qt:vlan-id;
}
leaf push-outer-vlan-id {
when
'/bbf-l2access-attr:vlan-translation-profiles/'
+ 'bbf-l2access-attr:vlan-translation-profile[bbf-l2access-attr:'
+ 'name = current()/../../vlan-translation-profile]/'
+ 'ingress-rewrite/push-outer-tag/vlan-id = '
+ '"vlan-id-is-a-parameter" ' {
description
"Indicates the VLAN ID of the pushed outer VLAN tag,
which overwrites the outer VLAN tag rewritten
by the referenced VLAN translation profile.";
}
type bbf-dot1qt:vlan-id;
}
leaf push-second-vlan-id {
when
'/bbf-l2access-attr:vlan-translation-profiles/'
+ 'bbf-l2access-attr:vlan-translation-profile[bbf-l2access-attr:'
+ 'name = current()/../../vlan-translation-profile]/'
+ 'ingress-rewrite/push-second-tag/vlan-id = '
+ '"vlan-id-is-a-parameter" ' {
description
"Indicates the VLAN ID of the pushed seconed VLAN tag,
which overwrites the seconed VLAN tag rewritten
by the referenced VLAN translation profile.";
}
type bbf-dot1qt:vlan-id;
}
}
}
container vlan-translation-profiles {
description
"Configuration of VLAN translation profiles.";
list vlan-translation-profile {
key "name";
description
"A translation profile defines the vlan match criteria and
vlan tag rewrite.";
leaf name {
type string;
description
"vlan translaton profile name.";
}
uses vlan-match-and-rewrite;
}
}
container vlan-forwarding-profiles {
description
"Configuration of VLAN forwarding profiles.";
list vlan-forwarding-profile {
key "name";
description
"A forwarding profile defines the network-side
forwarding of traffic in a forwarding VLAN.";
leaf name {
type string;
description
"vlan forwrding profile name.";
}
container forwarding-ports {
description
"Network-side forwarding ports in the forwarding profile.";
list port {
key "name";
leaf name {
type string;
description
"forwarding port name.";
}
leaf node-ref {
type leafref {
path "/nw:networks/nw:network/nw:node/nw:node-id";
require-instance false;
}
description
"This leaf references a network side node.";
}
leaf tp-ref {
type leafref {
path "/nw:networks/nw:network/"
+ "nw:node/nt:termination-point/nt:tp-id";
require-instance false;
}
description
"This leaf references a network side termination point types.";
}
}
}
}
}
}