Elia Battiston | a133364 | 2022-07-27 12:17:24 +0000 | [diff] [blame^] | 1 | module bbf-dot1q-types { |
| 2 | yang-version 1.1; |
| 3 | namespace "urn:bbf:yang:bbf-dot1q-types"; |
| 4 | prefix bbf-dot1qt; |
| 5 | |
| 6 | organization |
| 7 | "Broadband Forum <https://www.broadband-forum.org> |
| 8 | Common YANG Work Area"; |
| 9 | contact |
| 10 | "Comments or questions about this Broadband Forum YANG module |
| 11 | should be directed to <mailto:help@broadband-forum.org>. |
| 12 | |
| 13 | Editor: Nick Hancock, ADTRAN |
| 14 | |
| 15 | Editor: Ludwig Pauwels, Nokia |
| 16 | |
| 17 | PS Leader: Joey Boyd, ADTRAN |
| 18 | |
| 19 | PS Leader: Sowrirajan Padmanabhan, Nokia |
| 20 | |
| 21 | WA Director: Joey Boyd, ADTRAN |
| 22 | |
| 23 | WA Director: Sven Ooghe, Nokia"; |
| 24 | description |
| 25 | "This module contains a collection of YANG definitions for |
| 26 | supporting the Broadband Forum requirements on reusable data |
| 27 | types as applicable to access network equipment. As such, this |
| 28 | module is specific to access network equipment (e.g., |
| 29 | BBF-specified Access Nodes and FTTdp DPUs). |
| 30 | |
| 31 | Specifically, this module defines common types for support of |
| 32 | IEEE 802.1Q. |
| 33 | |
| 34 | Copyright (c) 2017-2021, Broadband Forum |
| 35 | |
| 36 | Redistribution and use in source and binary forms, with or |
| 37 | without modification, are permitted provided that the following |
| 38 | conditions are met: |
| 39 | |
| 40 | 1. Redistributions of source code must retain the above copyright |
| 41 | notice, this list of conditions and the following disclaimer. |
| 42 | |
| 43 | 2. Redistributions in binary form must reproduce the above |
| 44 | copyright notice, this list of conditions and the following |
| 45 | disclaimer in the documentation and/or other materials |
| 46 | provided with the distribution. |
| 47 | |
| 48 | 3. Neither the name of the copyright holder nor the names of its |
| 49 | contributors may be used to endorse or promote products |
| 50 | derived from this software without specific prior written |
| 51 | permission. |
| 52 | |
| 53 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND |
| 54 | CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, |
| 55 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 56 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 57 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
| 58 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 59 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 60 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 61 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 62 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 63 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 64 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 65 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 66 | |
| 67 | The above license is used as a license under copyright only. |
| 68 | Please reference the Forum IPR Policy for patent licensing terms |
| 69 | <https://www.broadband-forum.org/ipr-policy>. |
| 70 | |
| 71 | Any moral rights which are necessary to exercise under the above |
| 72 | license grant are also deemed granted under this license. |
| 73 | |
| 74 | This version of this YANG module is part of TR-383a4; see |
| 75 | the TR itself for full legal notices."; |
| 76 | |
| 77 | revision 2021-06-02 { |
| 78 | description |
| 79 | "Amendment 4. |
| 80 | * Approval Date: 2021-06-02. |
| 81 | * Publication Date: 2021-06-02."; |
| 82 | reference |
| 83 | "TR-383a4: Common YANG Modules |
| 84 | <https://www.broadband-forum.org/technical/download/ |
| 85 | TR-383_Amendment-4.pdf>"; |
| 86 | } |
| 87 | revision 2020-10-13 { |
| 88 | description |
| 89 | "Amendment 3. |
| 90 | * Approval Date: 2020-10-13. |
| 91 | * Publication Date: 2020-10-13."; |
| 92 | reference |
| 93 | "TR-383a3: Common YANG Modules |
| 94 | <https://www.broadband-forum.org/technical/download/ |
| 95 | TR-383_Amendment-3.pdf>"; |
| 96 | } |
| 97 | revision 2018-07-13 { |
| 98 | description |
| 99 | "Amendment 1. |
| 100 | * Approval Date: 2018-06-04. |
| 101 | * Publication Date: see revision date above."; |
| 102 | reference |
| 103 | "TR-383: Common YANG Modules |
| 104 | <https://www.broadband-forum.org/technical/download/ |
| 105 | TR-383_Amendment-1.pdf>"; |
| 106 | } |
| 107 | revision 2017-05-08 { |
| 108 | description |
| 109 | "Initial revision. |
| 110 | * Approval Date: see revision date above. |
| 111 | * Publication Date: 2017-06-02."; |
| 112 | reference |
| 113 | "TR-383: Common YANG Modules |
| 114 | <https://www.broadband-forum.org/technical/download/ |
| 115 | TR-383.pdf>"; |
| 116 | } |
| 117 | |
| 118 | identity dot1q-tag-vlan-type { |
| 119 | description |
| 120 | "Base identity from which all IEEE 802.1Q VLAN tag types are |
| 121 | derived."; |
| 122 | } |
| 123 | |
| 124 | identity c-vlan { |
| 125 | base dot1q-tag-vlan-type; |
| 126 | description |
| 127 | "An IEEE 802.1Q Customer VLAN tag, using the 0x8100 |
| 128 | Ethertype."; |
| 129 | } |
| 130 | |
| 131 | identity s-vlan { |
| 132 | base dot1q-tag-vlan-type; |
| 133 | description |
| 134 | "An IEEE 802.1Q Service VLAN tag, using a the 0x88a8 Ethertype, |
| 135 | originally introduced in IEEE 802.1ad, and incorporated into |
| 136 | IEEE 802.1Q-2014."; |
| 137 | } |
| 138 | |
| 139 | typedef dot1q-tag-type { |
| 140 | type identityref { |
| 141 | base dot1q-tag-vlan-type; |
| 142 | } |
| 143 | description |
| 144 | "Identifies a specific IEEE 802.1Q tag type."; |
| 145 | reference |
| 146 | "IEEE 802.1Q-2014: Virtual Bridged Local Area Networks"; |
| 147 | } |
| 148 | |
| 149 | typedef vlan-id { |
| 150 | type uint16 { |
| 151 | range "1..4094"; |
| 152 | } |
| 153 | description |
| 154 | "The type uniquely identifies a VLAN. This is the |
| 155 | 12-bit VLAN ID used in the VLAN tag header. |
| 156 | The range 1..4094 is defined by the referenced |
| 157 | specification."; |
| 158 | reference |
| 159 | "IEEE 802.1Q-2014: Virtual Bridged Local Area Networks"; |
| 160 | } |
| 161 | |
| 162 | typedef vlan-id-or-0 { |
| 163 | type uint16 { |
| 164 | range "0..4094"; |
| 165 | } |
| 166 | description |
| 167 | "The type uniquely identifies a VLAN. This is the |
| 168 | 12-bit VLAN ID used in the VLAN tag header. |
| 169 | The range 1..4094 is defined by the referenced specification. |
| 170 | The value 0 allows support of priority-tagged frames."; |
| 171 | reference |
| 172 | "IEEE 802.1Q-2014: Virtual Bridged Local Area Networks"; |
| 173 | } |
| 174 | |
| 175 | typedef vlan-id-range { |
| 176 | type string { |
| 177 | pattern '(([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-3][0-9][0-9][' |
| 178 | + '0-9]|40[0-8][0-9]|409[0-4])([,-]([1-9]|[1-9][0-9]|[' |
| 179 | + '1-9][0-9][0-9]|[1-3][0-9][0-9][0-9]|40[0-8][0-9]|' |
| 180 | + '409[0-4]))*)?'; |
| 181 | } |
| 182 | description |
| 183 | "A list of VLAN IDs, or non overlapping VLAN ranges, in |
| 184 | ascending order, between 1 and 4094. |
| 185 | |
| 186 | The format of this string can be any of the following: |
| 187 | |
| 188 | single value |
| 189 | Example: '23' |
| 190 | comma separated list of values |
| 191 | Example: '1,2,100' |
| 192 | range of values |
| 193 | Example: '1-1000' |
| 194 | comma separated list of ranges |
| 195 | Example: '1-1000,2001-2999' |
| 196 | comma separated list of values and ranges |
| 197 | Example: '1-1000,1500,2001-2999'"; |
| 198 | } |
| 199 | |
| 200 | typedef pbit { |
| 201 | type uint8 { |
| 202 | range "0..7"; |
| 203 | } |
| 204 | description |
| 205 | "Priority Code Point. PCP is a 3-bit field that refers to the |
| 206 | class of service applied to a VLAN tagged frame. The |
| 207 | field specifies a priority value between 0 and 7, these values |
| 208 | can be used by quality of service (QoS) to prioritize |
| 209 | different classes of traffic."; |
| 210 | reference |
| 211 | "IEEE 802.1Q-2014: Virtual Bridged Local Area Networks"; |
| 212 | } |
| 213 | |
| 214 | typedef pbit-list { |
| 215 | type string { |
| 216 | pattern '([0-7](-[0-7])?(,[0-7](-[0-7])?)*)'; |
| 217 | } |
| 218 | description |
| 219 | "A list of p-bits values, or non overlapping p-bits value |
| 220 | ranges, in ascending order. Each p-bits value shall be between |
| 221 | 0 and 7. |
| 222 | |
| 223 | Example: 0,2-4,7 |
| 224 | "; |
| 225 | } |
| 226 | |
| 227 | typedef dei { |
| 228 | type uint8 { |
| 229 | range "0..1"; |
| 230 | } |
| 231 | description |
| 232 | "Drop Eligible Indicator. DEI is a 1-bit field in the VLAN tag. |
| 233 | May be used separately or in conjunction with PCP to indicate |
| 234 | frames eligible to be dropped in the presence of congestion."; |
| 235 | reference |
| 236 | "IEEE 802.1Q-2014: Virtual Bridged Local Area Networks"; |
| 237 | } |
| 238 | |
| 239 | typedef ether-type { |
| 240 | type uint16; |
| 241 | description |
| 242 | "The Ethernet Type (or Length) value."; |
| 243 | reference |
| 244 | "IEEE 802.3-2012: IEEE Standard for Ethernet, clause 3.2.6"; |
| 245 | } |
| 246 | |
| 247 | typedef ether-type-hex { |
| 248 | type string { |
| 249 | pattern '0x[A-Fa-f0-9]{4}'; |
| 250 | } |
| 251 | description |
| 252 | "The Ethernet Type (or Length) value expressed as a 4 hex digits |
| 253 | in the form 0xABCD."; |
| 254 | reference |
| 255 | "IEEE 802.3-2012: IEEE Standard for Ethernet, clause 3.2.6"; |
| 256 | } |
| 257 | |
| 258 | typedef ether-type-or-acronym { |
| 259 | type union { |
| 260 | type ether-type; |
| 261 | type enumeration { |
| 262 | enum any { |
| 263 | description |
| 264 | "Matches any Ethertype value."; |
| 265 | } |
| 266 | enum ipv4 { |
| 267 | description |
| 268 | "Matches the Ethertype value 0x0800 or 0x0806 or |
| 269 | 0x8035."; |
| 270 | } |
| 271 | enum pppoe { |
| 272 | description |
| 273 | "Matches the Ethertype value 0x8863 or 0x8864."; |
| 274 | } |
| 275 | enum ipv6 { |
| 276 | description |
| 277 | "Matches the Ethertype value 0x86DD."; |
| 278 | } |
| 279 | } |
| 280 | type ether-type-hex; |
| 281 | } |
| 282 | description |
| 283 | "This type allows to specify |
| 284 | - a specific integer value identifying a particular Ethertype |
| 285 | value of frames, |
| 286 | - a 'pre-defined' enumeration value identifying one or more |
| 287 | specific Ethertype values, |
| 288 | - the enumeration value 'any' that identifies all frames."; |
| 289 | } |
| 290 | } |