Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 3 | * Copyright 2020-present Open Networking Foundation |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 4 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [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 |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 8 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 10 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [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 | adf422d | 2021-04-09 16:06:41 +0000 | [diff] [blame] | 17 | /* |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [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 | // UniGClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity UNI-G |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const UniGClassID = ClassID(264) // 0x0108 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var unigBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // UniG (Class ID: #264 / 0x0108) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // This ME organizes data associated with UNIs supported by GEM. One instance of the UNI-G ME |
| 36 | // exists for each UNI supported by the ONU. |
| 37 | // |
| 38 | // The ONU automatically creates or deletes instances of this ME upon the creation or deletion of a |
| 39 | // real or virtual circuit pack ME, one per port. |
| 40 | // |
| 41 | // Relationships |
| 42 | // An instance of the UNI-G ME exists for each instance of a PPTP ME. |
| 43 | // |
| 44 | // Attributes |
| 45 | // Managed Entity Id |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 46 | // This attribute uniquely identifies each instance of this ME. Through an identical ID, this ME is |
| 47 | // implicitly linked to an instance of a PPTP. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 48 | // |
| 49 | // Deprecated |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 50 | // This attribute is not used. It should be set to 0 by the OLT and ignored by the ONU. (R,-W) |
| 51 | // (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 52 | // |
| 53 | // Administrative State |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 54 | // This attribute locks (1) and unlocks (0) the functions performed by this ME. Administrative |
| 55 | // state is further described in clause A.1.6. (R,-W) (mandatory) (1-byte) |
| 56 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 57 | // NOTE - PPTP MEs also have an administrative state attribute. The user port is unlocked only if |
| 58 | // both administrative state attributes are set to unlocked. It is recommended that this attribute |
| 59 | // not be used: that the OLT set it to 0 and that the ONU ignore it. |
| 60 | // |
| 61 | // Management Capability |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 62 | // An ONU may support the ability for some or all of its PPTPs to be managed either directly by the |
| 63 | // OMCI or from a non-OMCI management environment such as [BBF TR-069]. This attribute advertises |
| 64 | // the ONU's capabilities for each PPTP. |
| 65 | // |
| 66 | // This attribute is an enumeration with the following code points: |
| 67 | // |
| 68 | // 0 OMCI only |
| 69 | // |
| 70 | // 1 Non-OMCI only. In this case, the PPTP may be visible to the OMCI, but only in a read-only |
| 71 | // sense, e.g., for PM collection. |
| 72 | // |
| 73 | // 2 Both OMCI and non-OMCI |
| 74 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 75 | // (R) (optional) (1-byte) |
| 76 | // |
| 77 | // Non_Omci Management Identifier |
| 78 | // Non-OMCI management identifier: If a PPTP can be managed either directly by the OMCI or a non- |
| 79 | // OMCI management environment, this attribute specifies how it is in fact to be managed. This |
| 80 | // attribute is either 0 (default-=-OMCI management), or it is a pointer to a VEIP, which in turn |
| 81 | // links to a non-OMCI management environment. (R,-W) (optional) (2-bytes) |
| 82 | // |
| 83 | // Relay Agent Options |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 84 | // %SL In TR-101, this is called a slot. In an ONU, this variable refers to a shelf. It is |
| 85 | // meaningful if the ONU has multiple shelves internally or is daisy-chained to multiple equipment |
| 86 | // modules. The range of this variable is "0".. "99" |
| 87 | // |
| 88 | // %SU In TR-101, this is called a sub-slot. In fact, it represents a cardholder. The range of this |
| 89 | // variable is "0".. "99" |
| 90 | // |
| 91 | // %PO UNI port number. The range of this variable is "0".. "999" |
| 92 | // |
| 93 | // %AE ATM or Ethernet. This variable can take on the values "atm" or "eth". |
| 94 | // |
| 95 | // %SV S-VID for Ethernet UNI, or ATM VPI for ATM UNI, as it exists on the DHCP request received |
| 96 | // upstream across the UNI. Range "0".. "4096" for S-VID; range "0".. "255" for VPI. The value |
| 97 | // "4096" indicates no S-VID tag. |
| 98 | // |
| 99 | // %CV C-VID (Q-VID) for Ethernet UNI or ATM VCI for ATM UNI, as it exists on the DHCP request |
| 100 | // received upstream across the UNI. Range "0".. "4096" for C-VID; range "0".."65535" for VCI. The |
| 101 | // value "4096" indicates no C-VID tag. |
| 102 | // |
| 103 | // Spaces in the provisioned string are significant. |
| 104 | // |
| 105 | // Example: if the large string were provisioned with the value |
| 106 | // |
| 107 | // %01%SL/%SU/%PO:%AE/%SV.%CV<null>, |
| 108 | // |
| 109 | // then the ONU would generate the following DHCP option 82 agent circuitID string for an Ethernet |
| 110 | // UNI that sent a DHCP request with no S tag and C tag = 3210 on shelf 2, slot 3, port 4. |
| 111 | // |
| 112 | // 2/3/4:eth/4096.3210 |
| 113 | // |
| 114 | // With the same provisioning, the ONU would generate the following DHCP option 82 agent circuit-ID |
| 115 | // string for an ATM UNI that sent a DHCP request on VPI = 123 and VCI = 4567 on shelf 2, slot 3, |
| 116 | // port 4. |
| 117 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 118 | // 2/3/4:atm/123.4567 |
| 119 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 120 | // This attribute is a pointer to a large string ME whose content specifies one or more DHCP relay |
| 121 | // agent options. (R, W) (optional) (2-bytes) |
| 122 | // |
| 123 | // The contents of the large string are parsed by the ONU and converted into text strings. Variable |
| 124 | // substitution is based on defined three-character groups, each of which begins with the '%' |
| 125 | // character. The string '%%' is an escape mechanism whose output is a single '%' character. When |
| 126 | // the ONU cannot perform variable substitution on a substring of the large string, it generates |
| 127 | // the specified option as an exact quotation of the provisioned substring value. |
| 128 | // |
| 129 | // Provisioning of the large string is separate from the operation of setting the pointer in this |
| 130 | // attribute. It is the responsibility of the OLT to ensure that the large string contents are |
| 131 | // correct and meaningful. |
| 132 | // |
| 133 | // Three-character variable definitions are as follows. The first variable in the large string must |
| 134 | // specify one of the option types. Both options for a given IP version may be present if desired, |
| 135 | // each introduced by its option identifier. Terminology is taken from clause 3.9.3 of [b-BBF |
| 136 | // TR-101]. |
| 137 | // |
| 138 | // %01, %18 Specifies that the following string is for option 82 sub-option 1, agent circuit-ID |
| 139 | // (IPv4) or option 18, interface-ID (IPv6). The equivalence permits the same large string to be |
| 140 | // used in both IP environments. |
| 141 | // |
| 142 | // %02, %37 Specifies that the following string is for option 82 sub-option 2, relay agent remote- |
| 143 | // ID (IPv4) or option 37, relay agent remoteID (IPv6). The equivalence permits the same large |
| 144 | // string to be used in both IP environments. |
| 145 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 146 | type UniG struct { |
| 147 | ManagedEntityDefinition |
| 148 | Attributes AttributeValueMap |
| 149 | } |
| 150 | |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 151 | // Attribute name constants |
| 152 | |
| 153 | const UniG_Deprecated = "Deprecated" |
| 154 | const UniG_AdministrativeState = "AdministrativeState" |
| 155 | const UniG_ManagementCapability = "ManagementCapability" |
| 156 | const UniG_NonOmciManagementIdentifier = "NonOmciManagementIdentifier" |
| 157 | const UniG_RelayAgentOptions = "RelayAgentOptions" |
| 158 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 159 | func init() { |
| 160 | unigBME = &ManagedEntityDefinition{ |
| 161 | Name: "UniG", |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 162 | ClassID: UniGClassID, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 163 | MessageTypes: mapset.NewSetWith( |
| 164 | Get, |
| 165 | Set, |
| 166 | ), |
| 167 | AllowedAttributeMask: 0xf800, |
| 168 | AttributeDefinitions: AttributeDefinitionMap{ |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 169 | 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 170 | 1: Uint16Field(UniG_Deprecated, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, true, 1), |
| 171 | 2: ByteField(UniG_AdministrativeState, EnumerationAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2), |
| 172 | 3: ByteField(UniG_ManagementCapability, EnumerationAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, true, false, 3), |
| 173 | 4: Uint16Field(UniG_NonOmciManagementIdentifier, PointerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, true, false, 4), |
| 174 | 5: Uint16Field(UniG_RelayAgentOptions, PointerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, true, false, 5), |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 175 | }, |
| 176 | Access: CreatedByOnu, |
| 177 | Support: UnknownSupport, |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | // NewUniG (class ID 264) creates the basic |
| 182 | // Managed Entity definition that is used to validate an ME of this type that |
| 183 | // is received from or transmitted to the OMCC. |
| 184 | func NewUniG(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 185 | return NewManagedEntity(*unigBME, params...) |
| 186 | } |