blob: 0c6c0142c350e8233afd22146df0fd09d3e96c7d [file] [log] [blame]
mpagenko836a1fd2021-11-01 16:12:42 +00001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +00004 *
mpagenko836a1fd2021-11-01 16:12:42 +00005 * 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 Hildebrandt3ac49bd2022-02-07 17:46:43 +00008 *
mpagenko836a1fd2021-11-01 16:12:42 +00009 * http://www.apache.org/licenses/LICENSE-2.0
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +000010 *
mpagenko836a1fd2021-11-01 16:12:42 +000011 * 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 */
23
24package generated
25
26import "github.com/deckarep/golang-set"
27
28// IpHostConfigDataClassID is the 16-bit ID for the OMCI
29// Managed entity IP host config data
30const IpHostConfigDataClassID = ClassID(134) // 0x0086
31
32var iphostconfigdataBME *ManagedEntityDefinition
33
34// IpHostConfigData (Class ID: #134 / 0x0086)
35// The IP host config data configures IPv4 based services offered on the ONU. The ONU automatically
36// creates instances of this ME if IP host services are available. A possible IPv6 stack is
37// supported through the IPv6 host config data ME. In this clause, references to IP addresses are
38// understood to mean IPv4.
39//
40// Relationships
41// An instance of this ME is associated with the ONU ME. Any number of TCP/UDP config data MEs can
42// point to the IP host config data, to model any number of ports and protocols. Performance may be
43// monitored through an implicitly linked IP host PM history data ME.
44//
45// Attributes
46// Managed Entity Id
47// This attribute uniquely identifies each instance of this ME. The ONU creates as many instances
48// as there are independent IPv4 stacks on the ONU. To facilitate discovery, IP host config data
49// MEs should be numbered from 0 upwards. The ONU should create IP(v4) and IPv6 host config data
50// MEs with separate ME IDs, such that other MEs can use a single TP type attribute to link with
51// either. (R) (mandatory) (2 bytes)
52//
53// Ip Options
54// This attribute is a bit map that enables or disables IP-related options. The value 1 enables the
55// option while 0 disables it. The default value of this attribute is 0.
56//
57// 0x01 Enable DHCP
58//
59// 0x02 Respond to pings
60//
61// 0x04 Respond to traceroute messages
62//
63// 0x08 Enable IP stack
64//
65// 0x10..0x80 Reserved
66//
67// (R,-W) (mandatory) (1-byte)
68//
69// Mac Address
70// This attribute indicates the MAC address used by the IP node. (R) (mandatory) (6-bytes)
71//
72// Onu Identifier
73// A unique ONU identifier string. If set to a non-null value, this string is used instead of the
74// MAC address in retrieving dynamic host configuration protocol (DHCP) parameters. If the string
75// is shorter than 25 characters, it must be null terminated. Its default value is 25 null bytes.
76// (R,-W) (mandatory) (25-bytes)
77//
78// Several attributes of this ME may be paired together into two categories, manual settings and
79// current values.
80//
81// While the IP stack is disabled, there is no IP connectivity to the external world from this ME
82// instance.
83//
84// While DHCP is disabled, the current values are always the same as the manual settings. While
85// DHCP is enabled, the current values are those assigned by DHCP, or undefined (0) if DHCP has
86// never assigned values.
87//
88// Ip Address
89// The address used for IP host services; this attribute has the default value 0. (R,-W)
90// (mandatory) (4-bytes)
91//
92// Mask
93// The subnet mask for IP host services; this attribute has the default value 0. (R,-W) (mandatory)
94// (4-bytes)
95//
96// Gateway
97// The default gateway address used for IP host services; this attribute has the default value 0.
98// (R,-W) (mandatory) (4-bytes)
99//
100// Primary Dns
101// The address of the primary DNS server; this attribute has the default value 0. (R,-W)
102// (mandatory) (4-bytes)
103//
104// Secondary Dns
105// The address of the secondary DNS server; this attribute has the default value 0. (R,-W)
106// (mandatory) (4-bytes)
107//
108// Current Address
109// Current address of the IP host service. (R) (optional) (4-bytes)
110//
111// Current Mask
112// Current subnet mask for the IP host service. (R) (optional) (4-bytes)
113//
114// Current Gateway
115// Current default gateway address for the IP host service. (R) (optional) (4-bytes)
116//
117// Current Primary Dns
118// Current primary DNS server address. (R) (optional) (4-bytes)
119//
120// Current Secondary Dns
121// Current secondary DNS server address. (R) (optional) (4-bytes)
122//
123// Domain Name
124// If DHCP indicates a domain name, it is presented here. If no domain name is indicated, this
125// attribute is set to a null string. If the string is shorter than 25-bytes, it must be null
126// terminated. The default value is 25 null bytes. (R) (mandatory) (25-bytes)
127//
128// Host Name
129// If DHCP indicates a host name, it is presented here. If no host name is indicated, this
130// attribute is set to a null string. If the string is shorter than 25-bytes, it must be null
131// terminated. The default value is 25 null bytes. (R) (mandatory) (25-bytes)
132//
133// Relay Agent Options
134// This attribute is a pointer to a large string ME whose content specifies one or more DHCP relay
135// agent options. (R, W) (optional) (2-bytes)
136//
137// The contents of the large string are parsed by the ONU and converted into text strings. Variable
138// substitution is based on defined three-character groups, each of which begins with the '%'
139// character. The string '%%' is an escape mechanism whose output is a single '%' character. When
140// the ONU cannot perform variable substitution on a substring of the large string, it generates
141// the specified option as an exact quotation of the provisioned substring value.
142//
143// Provisioning of the large string is separate from the operation of setting the pointer in this
144// attribute. It is the responsibility of the OLT to ensure that the large string contents are
145// correct and meaningful.
146//
147// Three-character variable definitions are as follows. The first variable in the large string must
148// specify one of the option types. Both options for a given IP version may be present if desired,
149// each introduced by its option identifier. Terminology is taken from clause 3.9.3 of [b-BBF
150// TR-101].
151//
152// %01, %18 Specifies that the following string is for option 82 sub-option 1, agent circuit-ID
153// (IPv4) or option 18, interface-ID (IPv6). The equivalence permits the same large string to be
154// used in both IP environments.
155//
156// %02, %37 Specifies that the following string is for option 82 sub-option 2, relay agent remote-
157// ID (IPv4) or option 37, relay agent remote-ID (IPv6). The equivalence permits the same large
158// string to be used in both IP environments.
159//
160// %SL In [b-BBF TR-101], this is called a slot. In an ONU, this variable refers to a shelf. It
161// would be meaningful if the ONU has multiple shelves internally or is daisy-chained to multiple
162// equipment modules. The range of this variable is "0".. "99"
163//
164// %SU In TR-101, this is called a sub-slot. In fact, it represents a cardholder. The range of this
165// variable is "0".. "99"
166//
167// %PO UNI port number. The range of this variable is "0".. "999"
168//
169// %AE ATM or Ethernet. This variable can take on the values "atm" or "eth".
170//
171// %SV S-VID for Ethernet UNI, or ATM virtual path identifier (VPI) for ATM UNI, as it exists on
172// the DHCP request received upstream across the UNI. Range "0".. "4096" for S-VID; range "0"..
173// "255" for VPI. The value "4096" indicates no S-VID tag.
174//
175// %CV C-VID (Q-VID) for Ethernet UNI, or ATM virtual circuit identifier (VCI) for ATM UNI, as it
176// exists on the DHCP request received upstream across the UNI. Range "0".. "4096" for C-VID; range
177// "0".."65535" for VCI. The value "4096" indicates no C-VID tag.
178//
179// Spaces in the provisioned string are significant.
180//
181// Example: if the large string were provisioned with the value
182//
183// %01%SL/%SU/%PO:%AE/%SV.%CV<null>,
184//
185// then the ONU would generate the following DHCP option 82 agent circuit-ID string for an Ethernet
186// UNI that sent a DHCP request with no S tag and C tag = 3210 on shelf 2, slot 3, port 4.
187//
188// 2/3/4:eth/4096.3210
189//
190// With the same provisioning, the ONU would generate the following DHCP option 82 agent circuit-ID
191// string for an ATM UNI that sent a DHCP request on VPI = 123 and VCI = 4567 on shelf 2, slot 3,
192// port 4.
193//
194// 2/3/4:atm/123.4567
195//
196type IpHostConfigData struct {
197 ManagedEntityDefinition
198 Attributes AttributeValueMap
199}
200
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000201// Attribute name constants
202
203const IpHostConfigData_IpOptions = "IpOptions"
204const IpHostConfigData_MacAddress = "MacAddress"
205const IpHostConfigData_OnuIdentifier = "OnuIdentifier"
206const IpHostConfigData_IpAddress = "IpAddress"
207const IpHostConfigData_Mask = "Mask"
208const IpHostConfigData_Gateway = "Gateway"
209const IpHostConfigData_PrimaryDns = "PrimaryDns"
210const IpHostConfigData_SecondaryDns = "SecondaryDns"
211const IpHostConfigData_CurrentAddress = "CurrentAddress"
212const IpHostConfigData_CurrentMask = "CurrentMask"
213const IpHostConfigData_CurrentGateway = "CurrentGateway"
214const IpHostConfigData_CurrentPrimaryDns = "CurrentPrimaryDns"
215const IpHostConfigData_CurrentSecondaryDns = "CurrentSecondaryDns"
216const IpHostConfigData_DomainName = "DomainName"
217const IpHostConfigData_HostName = "HostName"
218const IpHostConfigData_RelayAgentOptions = "RelayAgentOptions"
219
mpagenko836a1fd2021-11-01 16:12:42 +0000220func init() {
221 iphostconfigdataBME = &ManagedEntityDefinition{
222 Name: "IpHostConfigData",
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000223 ClassID: IpHostConfigDataClassID,
mpagenko836a1fd2021-11-01 16:12:42 +0000224 MessageTypes: mapset.NewSetWith(
225 Get,
226 Set,
227 Test,
228 ),
229 AllowedAttributeMask: 0xffff,
230 AttributeDefinitions: AttributeDefinitionMap{
Holger Hildebrandt3ac49bd2022-02-07 17:46:43 +0000231 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
232 1: ByteField(IpHostConfigData_IpOptions, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
233 2: MultiByteField(IpHostConfigData_MacAddress, OctetsAttributeType, 0x4000, 6, toOctets("AAAAAAAA"), mapset.NewSetWith(Read), false, false, false, 2),
234 3: MultiByteField(IpHostConfigData_OnuIdentifier, OctetsAttributeType, 0x2000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 3),
235 4: Uint32Field(IpHostConfigData_IpAddress, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4),
236 5: Uint32Field(IpHostConfigData_Mask, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5),
237 6: Uint32Field(IpHostConfigData_Gateway, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
238 7: Uint32Field(IpHostConfigData_PrimaryDns, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
239 8: Uint32Field(IpHostConfigData_SecondaryDns, UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8),
240 9: Uint32Field(IpHostConfigData_CurrentAddress, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), true, true, false, 9),
241 10: Uint32Field(IpHostConfigData_CurrentMask, UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), true, true, false, 10),
242 11: Uint32Field(IpHostConfigData_CurrentGateway, UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read), true, true, false, 11),
243 12: Uint32Field(IpHostConfigData_CurrentPrimaryDns, UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read), true, true, false, 12),
244 13: Uint32Field(IpHostConfigData_CurrentSecondaryDns, UnsignedIntegerAttributeType, 0x0008, 0, mapset.NewSetWith(Read), true, true, false, 13),
245 14: MultiByteField(IpHostConfigData_DomainName, OctetsAttributeType, 0x0004, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), true, false, false, 14),
246 15: MultiByteField(IpHostConfigData_HostName, OctetsAttributeType, 0x0002, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), true, false, false, 15),
247 16: Uint16Field(IpHostConfigData_RelayAgentOptions, UnsignedIntegerAttributeType, 0x0001, 0, mapset.NewSetWith(Read, Write), true, true, false, 16),
mpagenko836a1fd2021-11-01 16:12:42 +0000248 },
249 Access: CreatedByOnu,
250 Support: UnknownSupport,
251 }
252}
253
254// NewIpHostConfigData (class ID 134) creates the basic
255// Managed Entity definition that is used to validate an ME of this type that
256// is received from or transmitted to the OMCC.
257func NewIpHostConfigData(params ...ParamData) (*ManagedEntity, OmciErrors) {
258 return NewManagedEntity(*iphostconfigdataBME, params...)
259}