blob: fd1eb1be89db83946914e685cb0c367e66976758 [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// AuthenticationSecurityMethodClassID is the 16-bit ID for the OMCI
29// Managed entity Authentication security method
Chip Boling610117d2021-09-09 11:24:34 -050030const AuthenticationSecurityMethodClassID = ClassID(148) // 0x0094
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var authenticationsecuritymethodBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// AuthenticationSecurityMethod (Class ID: #148 / 0x0094)
Chip Boling6e27b352020-02-14 09:10:01 -060035// The authentication security method defines the user ID and password configuration to establish a
36// session between a client and a server. This object may be used in the role of the client or
37// server. An instance of this ME is created by the OLT if authenticated communication is
38// necessary.
39//
40// Relationships
41// One instance of this management entity may be associated with a network address ME. This ME may
42// also be cited by other MEs that require authentication parameter management.
43//
44// Attributes
45// Managed Entity Id
Chip Boling610117d2021-09-09 11:24:34 -050046// This attribute uniquely identifies each instance of this ME. The value 0xFFFF is reserved. (R,
47// setbycreate) (mandatory) (2-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060048//
49// Validation Scheme
Chip Boling610117d2021-09-09 11:24:34 -050050// This attribute specifies the validation scheme used when the ONU validates a challenge.
51// Validation schemes are defined as follows.
52//
53// 0 Validation disabled
54//
55// 1 Validate using MD5 digest authentication as defined in [IETF-RFC-2617] (recommended)
56//
57// 3 Validate using basic authentication as defined in [IETF RFC 2617]
58//
Chip Boling6e27b352020-02-14 09:10:01 -060059// (R,-W) (mandatory) (1-byte)
60//
61// Username 1
Chip Boling610117d2021-09-09 11:24:34 -050062// This string attribute is the user name. If the string is shorter than 25-bytes, it must be null
63// terminated (Note). (R,-W) (mandatory) (25-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060064//
65// Password
Chip Boling610117d2021-09-09 11:24:34 -050066// This string attribute is the password. If the string is shorter than 25-bytes, it must be null
67// terminated. (R,-W) (mandatory) (25-bytes)
Chip Boling6e27b352020-02-14 09:10:01 -060068//
69// Realm
Chip Boling610117d2021-09-09 11:24:34 -050070// This string attribute specifies the realm used in digest authentication. If the string is
Chip Boling6e27b352020-02-14 09:10:01 -060071// shorter than 25-bytes, it must be null terminated. (R,-W) (mandatory) (25-bytes)
72//
73// Username 2
Chip Boling610117d2021-09-09 11:24:34 -050074// This string attribute allows for continuation of the user name beyond 25-characters (Note). Its
75// default value is a null string. (R,-W) (optional) (25-bytes)
76//
Chip Boling6e27b352020-02-14 09:10:01 -060077// NOTE - The total username is the concatenation of the username 1 and username 2 attributes if
78// and only if: a) username 1 comprises 25 non-null characters; b) username 2 is supported by the
79// ONU; and c) username 2 contains a leading non-null character string. Otherwise, the total
80// username is simply the value of the username 1 attribute.
81//
82type AuthenticationSecurityMethod struct {
83 ManagedEntityDefinition
84 Attributes AttributeValueMap
85}
86
87func init() {
88 authenticationsecuritymethodBME = &ManagedEntityDefinition{
89 Name: "AuthenticationSecurityMethod",
90 ClassID: 148,
91 MessageTypes: mapset.NewSetWith(
92 Create,
93 Delete,
94 Get,
95 Set,
96 ),
97 AllowedAttributeMask: 0xf800,
98 AttributeDefinitions: AttributeDefinitionMap{
99 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
100 1: ByteField("ValidationScheme", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
101 2: MultiByteField("Username1", OctetsAttributeType, 0x4000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 2),
102 3: MultiByteField("Password", OctetsAttributeType, 0x2000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 3),
103 4: MultiByteField("Realm", OctetsAttributeType, 0x1000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 4),
104 5: MultiByteField("Username2", OctetsAttributeType, 0x0800, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 5),
105 },
106 Access: CreatedByOlt,
107 Support: UnknownSupport,
108 }
109}
110
111// NewAuthenticationSecurityMethod (class ID 148) creates the basic
112// Managed Entity definition that is used to validate an ME of this type that
113// is received from or transmitted to the OMCC.
114func NewAuthenticationSecurityMethod(params ...ParamData) (*ManagedEntity, OmciErrors) {
115 return NewManagedEntity(*authenticationsecuritymethodBME, params...)
116}