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