blob: af3fa3c0f5935b769e4feecbe23aed706101a071 [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Matteo Scandolof9d43412021-01-12 11:11:34 -08003 * Copyright 2020-present Open Networking Foundation
4
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07005 * 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
Matteo Scandolof9d43412021-01-12 11:11:34 -08008
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07009 * http://www.apache.org/licenses/LICENSE-2.0
Matteo Scandolof9d43412021-01-12 11:11:34 -080010
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070011 * 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 */
Girish Gowdra161d27a2021-05-05 12:01:44 -070017/*
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070018 * 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 */
Matteo Scandolof9d43412021-01-12 11:11:34 -080023
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070024package generated
25
26import "github.com/deckarep/golang-set"
27
Matteo Scandolof9d43412021-01-12 11:11:34 -080028// EnhancedSecurityControlClassID is the 16-bit ID for the OMCI
29// Managed entity Enhanced security control
30const EnhancedSecurityControlClassID ClassID = ClassID(332)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070031
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//
Matteo Scandolof9d43412021-01-12 11:11:34 -080040// NOTE - If an ITU-T G.987 system uses 802.1X authentication as defined in [ITU-T G.987.3], the
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070041// 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
Matteo Scandolof9d43412021-01-12 11:11:34 -080055// NOTE - It is assumed that the length of OLT_challenge is always an integer multiple of 16-bytes.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070056//
57// Olt Challenge Status
Matteo Scandolof9d43412021-01-12 11:11:34 -080058// The ONU initializes this attribute to the value false. (R, W) (mandatory) (1-byte)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070059//
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
Matteo Scandolof9d43412021-01-12 11:11:34 -080068// 16-bytes of content. ONU_challenge is the concatenation of all 16-byte content fields in the
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070069// 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
Matteo Scandolof9d43412021-01-12 11:11:34 -080072// commence a get/get-next sequence to obtain the table's contents. (R) (mandatory) (16 * P-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070073//
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-
Matteo Scandolof9d43412021-01-12 11:11:34 -080078// next sequence to obtain the table's contents. (R) (mandatory) (16 * Q-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070079//
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
Matteo Scandolof9d43412021-01-12 11:11:34 -080083// concatenation of all 16-byte content fields. The OLT writes all entries into the table, and then
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070084// 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
Matteo Scandolof9d43412021-01-12 11:11:34 -080086// operation to row 0. (W) (mandatory) (17 * R-bytes)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -070087//
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 ),
Matteo Scandolof9d43412021-01-12 11:11:34 -0800120 AllowedAttributeMask: 0xfff0,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700121 AttributeDefinitions: AttributeDefinitionMap{
Matteo Scandolof9d43412021-01-12 11:11:34 -0800122 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),
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700135 },
Matteo Scandolof9d43412021-01-12 11:11:34 -0800136 Access: CreatedByOnu,
137 Support: UnknownSupport,
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700138 }
139}
140
Matteo Scandolof9d43412021-01-12 11:11:34 -0800141// NewEnhancedSecurityControl (class ID 332) creates the basic
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700142// Managed Entity definition that is used to validate an ME of this type that
Matteo Scandolof9d43412021-01-12 11:11:34 -0800143// is received from or transmitted to the OMCC.
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700144func NewEnhancedSecurityControl(params ...ParamData) (*ManagedEntity, OmciErrors) {
Matteo Scandolof9d43412021-01-12 11:11:34 -0800145 return NewManagedEntity(*enhancedsecuritycontrolBME, params...)
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -0700146}