blob: 7786d9101687e4d3946c6c9fed143b87e6e65d4a [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// IpHostConfigDataClassID is the 16-bit ID for the OMCI
29// Managed entity IP host config data
Chip Boling610117d2021-09-09 11:24:34 -050030const IpHostConfigDataClassID = ClassID(134) // 0x0086
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var iphostconfigdataBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// IpHostConfigData (Class ID: #134 / 0x0086)
Chip Boling6e27b352020-02-14 09:10:01 -060035// 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
Chip Boling610117d2021-09-09 11:24:34 -050047// 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)
Chip Boling6e27b352020-02-14 09:10:01 -060052//
53// Ip Options
Chip Boling610117d2021-09-09 11:24:34 -050054// 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//
Chip Boling6e27b352020-02-14 09:10:01 -060067// (R,-W) (mandatory) (1-byte)
68//
69// Mac Address
Chip Boling610117d2021-09-09 11:24:34 -050070// This attribute indicates the MAC address used by the IP node. (R) (mandatory) (6-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060071//
72// Onu Identifier
Chip Boling610117d2021-09-09 11:24:34 -050073// 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.
Chip Boling6e27b352020-02-14 09:10:01 -060087//
88// Ip Address
Chip Boling610117d2021-09-09 11:24:34 -050089// The address used for IP host services; this attribute has the default value 0. (R,-W)
Chip Boling6e27b352020-02-14 09:10:01 -060090// (mandatory) (4-bytes)
91//
Chip Boling610117d2021-09-09 11:24:34 -050092// Mask
93// The subnet mask for IP host services; this attribute has the default value 0. (R,-W) (mandatory)
Chip Boling6e27b352020-02-14 09:10:01 -060094// (4-bytes)
95//
Chip Boling610117d2021-09-09 11:24:34 -050096// 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//
Chip Boling6e27b352020-02-14 09:10:01 -0600117// Current Primary Dns
Chip Boling610117d2021-09-09 11:24:34 -0500118// Current primary DNS server address. (R) (optional) (4-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -0600119//
120// Current Secondary Dns
Chip Boling610117d2021-09-09 11:24:34 -0500121// Current secondary DNS server address. (R) (optional) (4-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -0600122//
123// Domain Name
Chip Boling610117d2021-09-09 11:24:34 -0500124// 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)
Chip Boling6e27b352020-02-14 09:10:01 -0600127//
128// Host Name
Chip Boling610117d2021-09-09 11:24:34 -0500129// 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
Chip Boling6e27b352020-02-14 09:10:01 -0600131// terminated. The default value is 25 null bytes. (R) (mandatory) (25-bytes)
132//
133// Relay Agent Options
Chip Boling610117d2021-09-09 11:24:34 -0500134// 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//
Chip Boling6e27b352020-02-14 09:10:01 -0600194// 2/3/4:atm/123.4567
195//
196type IpHostConfigData struct {
197 ManagedEntityDefinition
198 Attributes AttributeValueMap
199}
200
201func init() {
202 iphostconfigdataBME = &ManagedEntityDefinition{
203 Name: "IpHostConfigData",
204 ClassID: 134,
205 MessageTypes: mapset.NewSetWith(
206 Get,
207 Set,
Chip Boling17e17782021-10-06 08:29:06 -0500208 Test,
Chip Boling6e27b352020-02-14 09:10:01 -0600209 ),
210 AllowedAttributeMask: 0xffff,
211 AttributeDefinitions: AttributeDefinitionMap{
212 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
213 1: ByteField("IpOptions", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
214 2: MultiByteField("MacAddress", OctetsAttributeType, 0x4000, 6, toOctets("AAAAAAAA"), mapset.NewSetWith(Read), false, false, false, 2),
215 3: MultiByteField("OnuIdentifier", OctetsAttributeType, 0x2000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 3),
216 4: Uint32Field("IpAddress", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4),
217 5: Uint32Field("Mask", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5),
218 6: Uint32Field("Gateway", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
219 7: Uint32Field("PrimaryDns", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
220 8: Uint32Field("SecondaryDns", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8),
221 9: Uint32Field("CurrentAddress", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), true, true, false, 9),
222 10: Uint32Field("CurrentMask", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), true, true, false, 10),
223 11: Uint32Field("CurrentGateway", UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read), true, true, false, 11),
224 12: Uint32Field("CurrentPrimaryDns", UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read), true, true, false, 12),
225 13: Uint32Field("CurrentSecondaryDns", UnsignedIntegerAttributeType, 0x0008, 0, mapset.NewSetWith(Read), true, true, false, 13),
226 14: MultiByteField("DomainName", OctetsAttributeType, 0x0004, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), true, false, false, 14),
227 15: MultiByteField("HostName", OctetsAttributeType, 0x0002, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), true, false, false, 15),
228 16: Uint16Field("RelayAgentOptions", UnsignedIntegerAttributeType, 0x0001, 0, mapset.NewSetWith(Read, Write), true, true, false, 16),
229 },
230 Access: CreatedByOnu,
231 Support: UnknownSupport,
232 }
233}
234
235// NewIpHostConfigData (class ID 134) creates the basic
236// Managed Entity definition that is used to validate an ME of this type that
237// is received from or transmitted to the OMCC.
238func NewIpHostConfigData(params ...ParamData) (*ManagedEntity, OmciErrors) {
239 return NewManagedEntity(*iphostconfigdataBME, params...)
240}