blob: 3c1968ceee669e4506934764d34e9c5e164dbe9c [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14/*
15 * NOTE: This file was generated, manual edits will be overwritten!
16 *
17 * Generated by 'goCodeGenerator.py':
18 * https://github.com/cboling/OMCI-parser/README.md
19 */
20
21package generated
22
23import "github.com/deckarep/golang-set"
24
25// EnhancedSecurityControlClassID is the 16-bit ID for the OMCI
26// Managed entity Enhanced security control
27const EnhancedSecurityControlClassID ClassID = ClassID(332)
28
29var enhancedsecuritycontrolBME *ManagedEntityDefinition
30
31// EnhancedSecurityControl (class ID #332)
32// This ME contains the capabilities, parameters and controls of enhanced GPON security features
33// when they are negotiated via the OMCI (Note). The attributes in this ME are intended to be used
34// to implement a symmetric-key-based three step authentication process as described in the
35// supplemental information section in the following.
36//
37// NOTE - If an ITU-T G.987 system uses 802.1X authentication as defined in [ITU-T G.987.3], the
38// only applicable attribute of this ME is the broadcast key table.
39//
40// Relationships
41// One instance of this ME is associated with the ONU ME.
42//
43// Attributes
44// Managed Entity Id
45// Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only
46// one instance, number 0. (R) (mandatory) (2 bytes)
47//
48// Olt Crypto Capabilities
49// (W) (mandatory) (16 bytes)
50//
51// Olt Random Challenge Table
52// NOTE - It is assumed that the length of OLT_challenge is always an integer multiple of 16-bytes.
53//
54// Olt Challenge Status
55// The ONU initializes this attribute to the value false. (R, W) (mandatory) (1-byte)
56//
57// Onu Selected Crypto Capabilities
58// ONU selected crypto capabilities: This attribute specifies the cryptographic capability selected
59// by the ONU in authentication step 2. Its value specifies one of the bit positions that has the
60// value 1 in the OLT crypto capabilities attribute. (R) (mandatory) (1 byte)
61//
62// Onu Random Challenge Table
63// ONU random challenge table: This attribute specifies the random challenge ONU_challenge issued
64// by the ONU during authentication step 2. It is structured as a table, with each entry being
65// 16-bytes of content. ONU_challenge is the concatenation of all 16-byte content fields in the
66// table. Once the OLT triggers a response to be generated using the OLT challenge status
67// attribute, the ONU generates the response and writes the table (in a single operation). The AVC
68// generated by this attribute signals to the OLT that the challenge is ready, so that the OLT can
69// commence a get/get-next sequence to obtain the table's contents. (R) (mandatory) (16 * P-bytes)
70//
71// Onu Authentication Result Table
72// Once the OLT triggers a response to be generated using the OLT challenge status attribute, the
73// ONU generates ONU_result and writes the table (in a single operation). The AVC generated by this
74// attribute signals to the OLT that the response is ready, so that the OLT can commence a get/get-
75// next sequence to obtain the table's contents. (R) (mandatory) (16 * Q-bytes)
76//
77// Olt Authentication Result Table
78// This attribute is structured as a table, with each entry being 17 bytes. The first byte is the
79// table row number, starting at 1; the remaining 16 bytes are content. OLT_result is the
80// concatenation of all 16-byte content fields. The OLT writes all entries into the table, and then
81// triggers the ONU's processing of the table using the OLT result status attribute. The number of
82// rows R is implicit in the choice of hash algorithm. The OLT can clear the table with a set
83// operation to row 0. (W) (mandatory) (17 * R-bytes)
84//
85// Olt Result Status
86// (R, W) (mandatory) (1 byte)
87//
88// Onu Authentication Status
89// (R) (mandatory) (1 byte)
90//
91// Master Session Key Name
92// Upon the invalidation of a master session key (e.g., due to an ONU reset or deactivation, or due
93// to an ONU-local decision that the master session key has expired), the ONU sets the master
94// session key name to all zeros. (R) (mandatory) (16 bytes)
95//
96// Broadcast Key Table
97// (R, W) (optional) (18N bytes)
98//
99// Effective Key Length
100// Effective key length: This attribute specifies the maximum effective length, in bits, of keys
101// generated by the ONU. (R) (optional) (2 bytes)
102//
103type EnhancedSecurityControl struct {
104 ManagedEntityDefinition
105 Attributes AttributeValueMap
106}
107
108func init() {
109 enhancedsecuritycontrolBME = &ManagedEntityDefinition{
110 Name: "EnhancedSecurityControl",
111 ClassID: 332,
112 MessageTypes: mapset.NewSetWith(
113 Get,
114 GetNext,
115 Set,
116 ),
117 AllowedAttributeMask: 0xfff0,
118 AttributeDefinitions: AttributeDefinitionMap{
119 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
120 1: MultiByteField("OltCryptoCapabilities", OctetsAttributeType, 0x8000, 16, toOctets("AAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Write), false, false, false, 1),
121 2: TableField("OltRandomChallengeTable", TableAttributeType, 0x4000, TableInfo{nil, 17}, mapset.NewSetWith(Read, Write), false, false, false, 2),
122 3: ByteField("OltChallengeStatus", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
123 4: ByteField("OnuSelectedCryptoCapabilities", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read), false, false, false, 4),
124 5: TableField("OnuRandomChallengeTable", TableAttributeType, 0x0800, TableInfo{nil, 16}, mapset.NewSetWith(Read), true, false, false, 5),
125 6: TableField("OnuAuthenticationResultTable", TableAttributeType, 0x0400, TableInfo{nil, 16}, mapset.NewSetWith(Read), true, false, false, 6),
126 7: TableField("OltAuthenticationResultTable", TableAttributeType, 0x0200, TableInfo{nil, 17}, mapset.NewSetWith(Read, Write), false, false, false, 7),
127 8: ByteField("OltResultStatus", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8),
128 9: ByteField("OnuAuthenticationStatus", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), true, false, false, 9),
129 10: MultiByteField("MasterSessionKeyName", OctetsAttributeType, 0x0040, 16, toOctets("AAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read), false, false, false, 10),
130 11: TableField("BroadcastKeyTable", TableAttributeType, 0x0020, TableInfo{nil, 18}, mapset.NewSetWith(Read, Write), false, true, false, 11),
131 12: Uint16Field("EffectiveKeyLength", UnsignedIntegerAttributeType, 0x0010, 0, mapset.NewSetWith(Read), false, true, false, 12),
132 },
133 Access: CreatedByOnu,
134 Support: UnknownSupport,
135 }
136}
137
138// NewEnhancedSecurityControl (class ID 332) creates the basic
139// Managed Entity definition that is used to validate an ME of this type that
140// is received from or transmitted to the OMCC.
141func NewEnhancedSecurityControl(params ...ParamData) (*ManagedEntity, OmciErrors) {
142 return NewManagedEntity(*enhancedsecuritycontrolBME, params...)
143}