blob: e7485fec19068e39c4eb43d8af6f0027d9995246 [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Andrea Campanella7167ebb2020-02-24 09:56:38 +01003 * Copyright 2020-present Open Networking Foundation
4
Chip Boling6e27b352020-02-14 09:10:01 -06005 * 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
Andrea Campanella7167ebb2020-02-24 09:56:38 +01008
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Andrea Campanella7167ebb2020-02-24 09:56:38 +010010
Chip Boling6e27b352020-02-14 09:10:01 -060011 * 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. Bainbridgeadf422d2021-04-09 16:06:41 +000017/*
Chip Boling6e27b352020-02-14 09:10:01 -060018 * 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
24package generated
25
26import "github.com/deckarep/golang-set"
27
28// UniGClassID is the 16-bit ID for the OMCI
29// Managed entity UNI-G
Chip Boling610117d2021-09-09 11:24:34 -050030const UniGClassID = ClassID(264) // 0x0108
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var unigBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// UniG (Class ID: #264 / 0x0108)
Chip Boling6e27b352020-02-14 09:10:01 -060035// 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 Boling610117d2021-09-09 11:24:34 -050046// 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 Boling6e27b352020-02-14 09:10:01 -060048//
49// Deprecated
Chip Boling610117d2021-09-09 11:24:34 -050050// 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 Boling6e27b352020-02-14 09:10:01 -060052//
53// Administrative State
Chip Boling610117d2021-09-09 11:24:34 -050054// 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 Boling6e27b352020-02-14 09:10:01 -060057// 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 Boling610117d2021-09-09 11:24:34 -050062// 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 Boling6e27b352020-02-14 09:10:01 -060075// (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 Boling610117d2021-09-09 11:24:34 -050084// %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 Boling6e27b352020-02-14 09:10:01 -0600118// 2/3/4:atm/123.4567
119//
Chip Boling610117d2021-09-09 11:24:34 -0500120// 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 Boling6e27b352020-02-14 09:10:01 -0600146type UniG struct {
147 ManagedEntityDefinition
148 Attributes AttributeValueMap
149}
150
151func init() {
152 unigBME = &ManagedEntityDefinition{
153 Name: "UniG",
154 ClassID: 264,
155 MessageTypes: mapset.NewSetWith(
156 Get,
157 Set,
158 ),
159 AllowedAttributeMask: 0xf800,
160 AttributeDefinitions: AttributeDefinitionMap{
161 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
162 1: Uint16Field("Deprecated", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, true, 1),
163 2: ByteField("AdministrativeState", EnumerationAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
164 3: ByteField("ManagementCapability", EnumerationAttributeType, 0x2000, 0, mapset.NewSetWith(Read), false, true, false, 3),
165 4: Uint16Field("NonOmciManagementIdentifier", PointerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, true, false, 4),
166 5: Uint16Field("RelayAgentOptions", PointerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, true, false, 5),
167 },
168 Access: CreatedByOnu,
169 Support: UnknownSupport,
170 }
171}
172
173// NewUniG (class ID 264) creates the basic
174// Managed Entity definition that is used to validate an ME of this type that
175// is received from or transmitted to the OMCC.
176func NewUniG(params ...ParamData) (*ManagedEntity, OmciErrors) {
177 return NewManagedEntity(*unigBME, params...)
178}