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 |
Elia Battiston | 9bfe110 | 2022-02-03 10:38:03 +0100 | [diff] [blame] | 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 |
Elia Battiston | 9bfe110 | 2022-02-03 10:38:03 +0100 | [diff] [blame] | 8 | * |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Elia Battiston | 9bfe110 | 2022-02-03 10:38:03 +0100 | [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 | */ |
| 17 | /* |
| 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 | // MacBridgeConfigurationDataClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity MAC bridge configuration data |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 30 | const MacBridgeConfigurationDataClassID = ClassID(46) // 0x002e |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 31 | |
| 32 | var macbridgeconfigurationdataBME *ManagedEntityDefinition |
| 33 | |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 34 | // MacBridgeConfigurationData (Class ID: #46 / 0x002e) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 35 | // This ME organizes status data associated with a MAC bridge. The ONU automatically creates or |
| 36 | // deletes an instance of this ME upon the creation or deletion of a MAC bridge service profile. |
| 37 | // |
| 38 | // Relationships |
| 39 | // This ME is associated with one instance of a MAC bridge service profile. |
| 40 | // |
| 41 | // Attributes |
| 42 | // Managed Entity Id |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 43 | // This attribute uniquely identifies each instance of this ME. Through an identical ID, this ME is |
| 44 | // implicitly linked to an instance of the MAC bridge service profile. (R) (mandatory) (2-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 45 | // |
| 46 | // Bridge Mac Address |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 47 | // This attribute indicates the MAC address used by the bridge. The ONU sets this attribute to a |
| 48 | // value based on criteria beyond the scope of this Recommendation, e.g., factory settings. (R) |
| 49 | // (mandatory) (6-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 50 | // |
| 51 | // Bridge Priority |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 52 | // This attribute reports the priority of the bridge. The ONU copies this attribute from the |
| 53 | // priority attribute of the associated MAC bridge service profile. The value of this attribute |
| 54 | // changes with updates to the MAC bridge service profile priority attribute. (R) (mandatory) |
| 55 | // (2-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 56 | // |
| 57 | // Designated Root |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 58 | // This attribute identifies the bridge at the root of the spanning tree. It comprises bridge |
| 59 | // priority (2-bytes) and MAC address (6-bytes). (R) (mandatory) (8-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 60 | // |
| 61 | // Root Path Cost |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 62 | // This attribute reports the cost of the best path to the root as seen from this bridge. Upon ME |
| 63 | // instantiation, the ONU sets this attribute to 0. (R) (mandatory) (4-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 64 | // |
| 65 | // Bridge Port Count |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 66 | // This attribute records the number of ports linked to this bridge. (R) (mandatory) (1-byte) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 67 | // |
| 68 | // Root Port Num |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 69 | // This attribute contains the port number that has the lowest cost from the bridge to the root |
| 70 | // bridge. The value 0 means that this bridge is itself the root. Upon ME instantiation, the ONU |
| 71 | // sets this attribute to 0. (R) (mandatory) (2-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 72 | // |
| 73 | // Hello Time |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 74 | // NOTE - [IEEE 802.1D] specifies the compatibility range for hello time to be 1..2-s. |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 75 | // |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 76 | // This attribute is the hello time received from the designated root, the interval (in 256ths of a |
| 77 | // second) between HELLO packets. Its range is 0x0100 to 0x0A00 (1..10-s). (R) (optional) (2-bytes) |
| 78 | // |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 79 | // Forward Delay |
Andrea Campanella | 10426e2 | 2021-10-15 17:58:04 +0200 | [diff] [blame] | 80 | // This attribute is the forwarding delay time received from the designated root (in 256ths of a |
| 81 | // second). Its range is 0x0400 to 0x1E00 (4..30-s) in accordance with [IEEE 802.1D]. (R) |
| 82 | // (optional) (2-bytes) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 83 | // |
| 84 | type MacBridgeConfigurationData struct { |
| 85 | ManagedEntityDefinition |
| 86 | Attributes AttributeValueMap |
| 87 | } |
| 88 | |
Elia Battiston | 9bfe110 | 2022-02-03 10:38:03 +0100 | [diff] [blame] | 89 | // Attribute name constants |
| 90 | |
| 91 | const MacBridgeConfigurationData_BridgeMacAddress = "BridgeMacAddress" |
| 92 | const MacBridgeConfigurationData_BridgePriority = "BridgePriority" |
| 93 | const MacBridgeConfigurationData_DesignatedRoot = "DesignatedRoot" |
| 94 | const MacBridgeConfigurationData_RootPathCost = "RootPathCost" |
| 95 | const MacBridgeConfigurationData_BridgePortCount = "BridgePortCount" |
| 96 | const MacBridgeConfigurationData_RootPortNum = "RootPortNum" |
| 97 | const MacBridgeConfigurationData_HelloTime = "HelloTime" |
| 98 | const MacBridgeConfigurationData_ForwardDelay = "ForwardDelay" |
| 99 | |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 100 | func init() { |
| 101 | macbridgeconfigurationdataBME = &ManagedEntityDefinition{ |
| 102 | Name: "MacBridgeConfigurationData", |
Elia Battiston | 9bfe110 | 2022-02-03 10:38:03 +0100 | [diff] [blame] | 103 | ClassID: MacBridgeConfigurationDataClassID, |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 104 | MessageTypes: mapset.NewSetWith( |
| 105 | Get, |
| 106 | ), |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 107 | AllowedAttributeMask: 0xff00, |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 108 | AttributeDefinitions: AttributeDefinitionMap{ |
Elia Battiston | 9bfe110 | 2022-02-03 10:38:03 +0100 | [diff] [blame] | 109 | 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 110 | 1: MultiByteField(MacBridgeConfigurationData_BridgeMacAddress, OctetsAttributeType, 0x8000, 6, toOctets("AAAAAAAA"), mapset.NewSetWith(Read), false, false, false, 1), |
| 111 | 2: Uint16Field(MacBridgeConfigurationData_BridgePriority, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read), false, false, false, 2), |
| 112 | 3: MultiByteField(MacBridgeConfigurationData_DesignatedRoot, OctetsAttributeType, 0x2000, 8, toOctets("AAAAAAAAAAA="), mapset.NewSetWith(Read), false, false, false, 3), |
| 113 | 4: Uint32Field(MacBridgeConfigurationData_RootPathCost, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4), |
| 114 | 5: ByteField(MacBridgeConfigurationData_BridgePortCount, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, false, false, 5), |
| 115 | 6: Uint16Field(MacBridgeConfigurationData_RootPortNum, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read), false, false, false, 6), |
| 116 | 7: Uint16Field(MacBridgeConfigurationData_HelloTime, UnsignedIntegerAttributeType, 0x0200, 256, mapset.NewSetWith(Read), false, true, false, 7), |
| 117 | 8: Uint16Field(MacBridgeConfigurationData_ForwardDelay, UnsignedIntegerAttributeType, 0x0100, 1024, mapset.NewSetWith(Read), false, true, false, 8), |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 118 | }, |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 119 | Access: CreatedByOnu, |
| 120 | Support: UnknownSupport, |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 121 | } |
| 122 | } |
| 123 | |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 124 | // NewMacBridgeConfigurationData (class ID 46) creates the basic |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 125 | // 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] | 126 | // is received from or transmitted to the OMCC. |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 127 | func NewMacBridgeConfigurationData(params ...ParamData) (*ManagedEntity, OmciErrors) { |
Matteo Scandolo | f9d4341 | 2021-01-12 11:11:34 -0800 | [diff] [blame] | 128 | return NewManagedEntity(*macbridgeconfigurationdataBME, params...) |
Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 129 | } |