Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
| 3 | * Copyright 2020-present Open Networking Foundation |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame^] | 4 | * |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [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 |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame^] | 8 | * |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame^] | 10 | * |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [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 | */ |
David K. Bainbridge | d80007b | 2021-04-12 12:22:29 +0000 | [diff] [blame] | 17 | /* |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [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 | */ |
| 23 | |
| 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
| 28 | // MacBridgeServiceProfileClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity MAC bridge service profile |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 30 | const MacBridgeServiceProfileClassID = ClassID(45) // 0x002d |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 31 | |
| 32 | var macbridgeserviceprofileBME *ManagedEntityDefinition |
| 33 | |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 34 | // MacBridgeServiceProfile (Class ID: #45 / 0x002d) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 35 | // This ME models a MAC bridge in its entirety; any number of ports may be associated with the |
| 36 | // bridge through pointers to the MAC bridge service profile ME. Instances of this ME are created |
| 37 | // and deleted by the OLT. |
| 38 | // |
| 39 | // Relationships |
| 40 | // Bridge ports are modelled by MAC bridge port configuration data MEs, any number of which can |
| 41 | // point to a MAC bridge service profile. The real-time status of the bridge is available from an |
| 42 | // implicitly linked MAC bridge configuration data ME. |
| 43 | // |
| 44 | // Attributes |
| 45 | // Managed Entity Id |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 46 | // This attribute uniquely identifies each instance of this ME. The first byte is the slot ID. In |
| 47 | // an integrated ONU, this value is 0. The second byte is the bridge group ID. (R, setbycreate) |
| 48 | // (mandatory) (2-bytes) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 49 | // |
| 50 | // Spanning Tree Ind |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 51 | // The Boolean value true specifies that a spanning tree algorithm is enabled. The value false |
| 52 | // disables (rapid) spanning tree. (R,-W, setbycreate) (mandatory) (1-byte) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 53 | // |
| 54 | // Learning Ind |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 55 | // The Boolean value true specifies that bridge learning functions are enabled. The value false |
| 56 | // disables bridge learning. (R,-W, setbycreate) (mandatory) (1-byte) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 57 | // |
| 58 | // Port Bridging Ind |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 59 | // The Boolean value true specifies that bridging between UNI ports is enabled. The value false |
| 60 | // disables local bridging. (R,-W, setbycreate) (mandatory) (1-byte) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 61 | // |
| 62 | // Priority |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 63 | // This attribute specifies the bridge priority in the range 0..65535. The value of this attribute |
| 64 | // is copied to the bridge priority attribute of the associated MAC bridge configuration data ME. |
| 65 | // (R,-W, setbycreate) (mandatory) (2-bytes) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 66 | // |
| 67 | // Max Age |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 68 | // This attribute specifies the maximum age (in 256ths of a second) of received protocol |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 69 | // information before its entry in the spanning tree listing is discarded. The range is 0x0600 to |
| 70 | // 0x2800 (6..40-s) in accordance with [IEEE-802.1D]. (R,-W, setbycreate) (mandatory) (2-bytes) |
| 71 | // |
| 72 | // Hello Time |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 73 | // This attribute specifies how often (in 256ths of a second) the bridge advertises its presence |
| 74 | // via hello packets, while acting as a root or attempting to become a root. The range is 0x0100 to |
| 75 | // 0x0A00 (1..10-s). (R,-W, setbycreate) (mandatory) (2-bytes) |
| 76 | // |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 77 | // NOTE - [IEEE 802.1D] specifies the compatibility range for hello time to be 1..2-s. |
| 78 | // |
| 79 | // Forward Delay |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 80 | // This attribute specifies the forwarding delay (in 256ths of a second) when the bridge acts as |
| 81 | // the root. The range is 0x0400 to 0x1E00 (4..30-s) in accordance with [IEEE 802.1D]. (R,-W, set- |
| 82 | // by-create) (mandatory) (2-bytes) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 83 | // |
| 84 | // Unknown Mac Address Discard |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 85 | // The Boolean value true specifies that MAC frames with unknown DAs be discarded. The value false |
| 86 | // specifies that such frames be forwarded to all allowed ports. (R,-W, setbycreate) (mandatory) |
| 87 | // (1-byte) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 88 | // |
| 89 | // Mac Learning Depth |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 90 | // This attribute specifies the maximum number of UNI MAC addresses to be learned by the bridge. |
| 91 | // The default value 0 specifies that there is no administratively imposed limit. (R,-W, |
| 92 | // setbycreate) (optional) (1-byte) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 93 | // |
| 94 | // Dynamic Filtering Ageing Time |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 95 | // This attribute specifies the age of dynamic filtering entries in the bridge database, after |
| 96 | // which unrefreshed entries are discarded. In accordance with clause 7.9.2 of [IEEE 802.1D] and |
| 97 | // clause 8.8.3 of [IEEE 802.1Q], the range is 10..1 000 000-s, with a resolution of 1-s and a |
| 98 | // default of 300-s. The value 0 specifies that the ONU uses its internal default. (R, W, set-by- |
| 99 | // create) (optional) (4 bytes) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 100 | // |
| 101 | type MacBridgeServiceProfile struct { |
| 102 | ManagedEntityDefinition |
| 103 | Attributes AttributeValueMap |
| 104 | } |
| 105 | |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame^] | 106 | // Attribute name constants |
| 107 | |
| 108 | const MacBridgeServiceProfile_SpanningTreeInd = "SpanningTreeInd" |
| 109 | const MacBridgeServiceProfile_LearningInd = "LearningInd" |
| 110 | const MacBridgeServiceProfile_PortBridgingInd = "PortBridgingInd" |
| 111 | const MacBridgeServiceProfile_Priority = "Priority" |
| 112 | const MacBridgeServiceProfile_MaxAge = "MaxAge" |
| 113 | const MacBridgeServiceProfile_HelloTime = "HelloTime" |
| 114 | const MacBridgeServiceProfile_ForwardDelay = "ForwardDelay" |
| 115 | const MacBridgeServiceProfile_UnknownMacAddressDiscard = "UnknownMacAddressDiscard" |
| 116 | const MacBridgeServiceProfile_MacLearningDepth = "MacLearningDepth" |
| 117 | const MacBridgeServiceProfile_DynamicFilteringAgeingTime = "DynamicFilteringAgeingTime" |
| 118 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 119 | func init() { |
| 120 | macbridgeserviceprofileBME = &ManagedEntityDefinition{ |
| 121 | Name: "MacBridgeServiceProfile", |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame^] | 122 | ClassID: MacBridgeServiceProfileClassID, |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 123 | MessageTypes: mapset.NewSetWith( |
| 124 | Create, |
| 125 | Delete, |
| 126 | Get, |
| 127 | Set, |
| 128 | ), |
| 129 | AllowedAttributeMask: 0xffc0, |
| 130 | AttributeDefinitions: AttributeDefinitionMap{ |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame^] | 131 | 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0), |
| 132 | 1: ByteField(MacBridgeServiceProfile_SpanningTreeInd, EnumerationAttributeType, 0x8000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 1), |
| 133 | 2: ByteField(MacBridgeServiceProfile_LearningInd, EnumerationAttributeType, 0x4000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 2), |
| 134 | 3: ByteField(MacBridgeServiceProfile_PortBridgingInd, EnumerationAttributeType, 0x2000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 3), |
| 135 | 4: Uint16Field(MacBridgeServiceProfile_Priority, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 4), |
| 136 | 5: Uint16Field(MacBridgeServiceProfile_MaxAge, UnsignedIntegerAttributeType, 0x0800, 1536, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 5), |
| 137 | 6: Uint16Field(MacBridgeServiceProfile_HelloTime, UnsignedIntegerAttributeType, 0x0400, 256, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 6), |
| 138 | 7: Uint16Field(MacBridgeServiceProfile_ForwardDelay, UnsignedIntegerAttributeType, 0x0200, 1024, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 7), |
| 139 | 8: ByteField(MacBridgeServiceProfile_UnknownMacAddressDiscard, EnumerationAttributeType, 0x0100, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, false, false, 8), |
| 140 | 9: ByteField(MacBridgeServiceProfile_MacLearningDepth, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 9), |
| 141 | 10: Uint32Field(MacBridgeServiceProfile_DynamicFilteringAgeingTime, UnsignedIntegerAttributeType, 0x0040, 300, mapset.NewSetWith(Read, SetByCreate, Write), false, true, false, 10), |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 142 | }, |
| 143 | Access: CreatedByOlt, |
| 144 | Support: UnknownSupport, |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | // NewMacBridgeServiceProfile (class ID 45) creates the basic |
| 149 | // Managed Entity definition that is used to validate an ME of this type that |
| 150 | // is received from or transmitted to the OMCC. |
| 151 | func NewMacBridgeServiceProfile(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 152 | return NewManagedEntity(*macbridgeserviceprofileBME, params...) |
| 153 | } |