Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 3 | * Copyright 2020-present Open Networking Foundation |
| 4 | |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 8 | |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 10 | |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
Girish Gowdra | 161d27a | 2021-05-05 12:01:44 -0700 | [diff] [blame] | 17 | /* |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 18 | * NOTE: This file was generated, manual edits will be overwritten! |
| 19 | * |
| 20 | * Generated by 'goCodeGenerator.py': |
| 21 | * https://github.com/cboling/OMCI-parser/README.md |
| 22 | */ |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 23 | |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 28 | // Dot1RateLimiterClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Dot1 rate limiter |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 30 | const Dot1RateLimiterClassID = ClassID(298) // 0x012a |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 31 | |
| 32 | var dot1ratelimiterBME *ManagedEntityDefinition |
| 33 | |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 34 | // Dot1RateLimiter (Class ID: #298 / 0x012a) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 35 | // This ME allows rate limits to be defined for various types of upstream traffic that are |
| 36 | // processed by IEEE 802.1 bridges or related structures. |
| 37 | // |
| 38 | // Relationships |
| 39 | // An instance of this ME may be linked to an instance of a MAC bridge service profile or an IEEE |
| 40 | // 802.1p mapper. |
| 41 | // |
| 42 | // Attributes |
| 43 | // Managed Entity Id |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 44 | // This attribute uniquely identifies each instance of this ME. (R, setbycreate) (mandatory) |
| 45 | // (2-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 46 | // |
| 47 | // Parent Me Pointer |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 48 | // This attribute points to an instance of a ME. The type of ME is determined by the TP type |
| 49 | // attribute. (R,-W, setbycreate) (mandatory) (2-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 50 | // |
| 51 | // Tp Type |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 52 | // (R,-W, setbycreate) (mandatory) (1-byte) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 53 | // |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 54 | // This attribute identifies the type of TP associated with this dot1 rate limiter. Valid values |
| 55 | // are: |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 56 | // |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 57 | // 1 MAC bridge service profile |
| 58 | // |
| 59 | // 2 IEEE 802.1p mapper service profile |
| 60 | // |
| 61 | // Upstream Unicast Flood Rate Pointer |
| 62 | // This attribute points to an instance of the traffic descriptor that governs the rate of upstream |
| 63 | // unicast packets whose DA is unknown to the bridge. A null pointer specifies that no |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 64 | // administrative limit is to be imposed. (R,-W, setbycreate) (optional) (2-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 65 | // |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 66 | // Upstream Broadcast Rate Pointer |
| 67 | // This attribute points to an instance of the traffic descriptor that governs the rate of upstream |
| 68 | // broadcast packets. A null pointer specifies that no administrative limit is to be imposed. |
| 69 | // (R,-W, setbycreate) (optional) (2-bytes) |
| 70 | // |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 71 | // Upstream Multicast Payload Rate Pointer |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 72 | // This attribute points to an instance of the traffic descriptor that governs the rate of upstream |
| 73 | // multicast payload packets. A null pointer specifies that no administrative limit is to be |
| 74 | // imposed. (R,-W, setbycreate) (optional) (2-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 75 | // |
| 76 | type Dot1RateLimiter struct { |
| 77 | ManagedEntityDefinition |
| 78 | Attributes AttributeValueMap |
| 79 | } |
| 80 | |
| 81 | func init() { |
| 82 | dot1ratelimiterBME = &ManagedEntityDefinition{ |
| 83 | Name: "Dot1RateLimiter", |
| 84 | ClassID: 298, |
| 85 | MessageTypes: mapset.NewSetWith( |
| 86 | Create, |
| 87 | Delete, |
| 88 | Get, |
| 89 | Set, |
| 90 | ), |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 91 | AllowedAttributeMask: 0xf800, |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 92 | AttributeDefinitions: AttributeDefinitionMap{ |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 93 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0), |
| 94 | 1: Uint16Field("ParentMePointer", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 1), |
| 95 | 2: ByteField("TpType", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 2), |
| 96 | 3: Uint16Field("UpstreamUnicastFloodRatePointer", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 3), |
| 97 | 4: Uint16Field("UpstreamBroadcastRatePointer", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 4), |
| 98 | 5: Uint16Field("UpstreamMulticastPayloadRatePointer", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 5), |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 99 | }, |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 100 | Access: CreatedByOlt, |
| 101 | Support: UnknownSupport, |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 102 | } |
| 103 | } |
| 104 | |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 105 | // NewDot1RateLimiter (class ID 298) creates the basic |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 106 | // Managed Entity definition that is used to validate an ME of this type that |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 107 | // is received from or transmitted to the OMCC. |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 108 | func NewDot1RateLimiter(params ...ParamData) (*ManagedEntity, OmciErrors) { |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 109 | return NewManagedEntity(*dot1ratelimiterBME, params...) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 110 | } |