blob: d4ef4e2d5ea421c424f49a9becb65643bb61f9fc [file] [log] [blame]
Matteo Scandolof9d43412021-01-12 11:11:34 -08001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Elia Battiston9bfe1102022-02-03 10:38:03 +01004 *
Matteo Scandolof9d43412021-01-12 11:11:34 -08005 * 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
Elia Battiston9bfe1102022-02-03 10:38:03 +01008 *
Matteo Scandolof9d43412021-01-12 11:11:34 -08009 * http://www.apache.org/licenses/LICENSE-2.0
Elia Battiston9bfe1102022-02-03 10:38:03 +010010 *
Matteo Scandolof9d43412021-01-12 11:11:34 -080011 * 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 Scandolof9d43412021-01-12 11:11:34 -080018 * 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
Andrea Campanella10426e22021-10-15 17:58:04 +020030const AuthenticationSecurityMethodClassID = ClassID(148) // 0x0094
Matteo Scandolof9d43412021-01-12 11:11:34 -080031
32var authenticationsecuritymethodBME *ManagedEntityDefinition
33
Andrea Campanella10426e22021-10-15 17:58:04 +020034// AuthenticationSecurityMethod (Class ID: #148 / 0x0094)
Matteo Scandolof9d43412021-01-12 11:11:34 -080035// 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
Andrea Campanella10426e22021-10-15 17:58:04 +020046// This attribute uniquely identifies each instance of this ME. The value 0xFFFF is reserved. (R,
47// setbycreate) (mandatory) (2-bytes)
Matteo Scandolof9d43412021-01-12 11:11:34 -080048//
49// Validation Scheme
Andrea Campanella10426e22021-10-15 17:58:04 +020050// 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//
Matteo Scandolof9d43412021-01-12 11:11:34 -080059// (R,-W) (mandatory) (1-byte)
60//
61// Username 1
Andrea Campanella10426e22021-10-15 17:58:04 +020062// 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)
Matteo Scandolof9d43412021-01-12 11:11:34 -080064//
65// Password
Andrea Campanella10426e22021-10-15 17:58:04 +020066// 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)
Matteo Scandolof9d43412021-01-12 11:11:34 -080068//
69// Realm
Andrea Campanella10426e22021-10-15 17:58:04 +020070// This string attribute specifies the realm used in digest authentication. If the string is
Matteo Scandolof9d43412021-01-12 11:11:34 -080071// shorter than 25-bytes, it must be null terminated. (R,-W) (mandatory) (25-bytes)
72//
73// Username 2
Andrea Campanella10426e22021-10-15 17:58:04 +020074// 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//
Matteo Scandolof9d43412021-01-12 11:11:34 -080077// 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
Elia Battiston9bfe1102022-02-03 10:38:03 +010087// Attribute name constants
88
89const AuthenticationSecurityMethod_ValidationScheme = "ValidationScheme"
90const AuthenticationSecurityMethod_Username1 = "Username1"
91const AuthenticationSecurityMethod_Password = "Password"
92const AuthenticationSecurityMethod_Realm = "Realm"
93const AuthenticationSecurityMethod_Username2 = "Username2"
94
Matteo Scandolof9d43412021-01-12 11:11:34 -080095func init() {
96 authenticationsecuritymethodBME = &ManagedEntityDefinition{
97 Name: "AuthenticationSecurityMethod",
Elia Battiston9bfe1102022-02-03 10:38:03 +010098 ClassID: AuthenticationSecurityMethodClassID,
Matteo Scandolof9d43412021-01-12 11:11:34 -080099 MessageTypes: mapset.NewSetWith(
100 Create,
101 Delete,
102 Get,
103 Set,
104 ),
105 AllowedAttributeMask: 0xf800,
106 AttributeDefinitions: AttributeDefinitionMap{
Elia Battiston9bfe1102022-02-03 10:38:03 +0100107 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read, SetByCreate), false, false, false, 0),
108 1: ByteField(AuthenticationSecurityMethod_ValidationScheme, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
109 2: MultiByteField(AuthenticationSecurityMethod_Username1, OctetsAttributeType, 0x4000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 2),
110 3: MultiByteField(AuthenticationSecurityMethod_Password, OctetsAttributeType, 0x2000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 3),
111 4: MultiByteField(AuthenticationSecurityMethod_Realm, OctetsAttributeType, 0x1000, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, false, false, 4),
112 5: MultiByteField(AuthenticationSecurityMethod_Username2, OctetsAttributeType, 0x0800, 25, toOctets("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), mapset.NewSetWith(Read, Write), false, true, false, 5),
Matteo Scandolof9d43412021-01-12 11:11:34 -0800113 },
114 Access: CreatedByOlt,
115 Support: UnknownSupport,
116 }
117}
118
119// NewAuthenticationSecurityMethod (class ID 148) creates the basic
120// Managed Entity definition that is used to validate an ME of this type that
121// is received from or transmitted to the OMCC.
122func NewAuthenticationSecurityMethod(params ...ParamData) (*ManagedEntity, OmciErrors) {
123 return NewManagedEntity(*authenticationsecuritymethodBME, params...)
124}