Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
| 3 | * Copyright 2020-present Open Networking Foundation |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 4 | * |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 5 | * 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 |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 8 | * |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 10 | * |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 11 | * 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. Bainbridge | d80007b | 2021-04-12 12:22:29 +0000 | [diff] [blame] | 17 | /* |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 18 | * 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 | |
| 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
| 28 | // AuthenticationSecurityMethodClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Authentication security method |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 30 | const AuthenticationSecurityMethodClassID = ClassID(148) // 0x0094 |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 31 | |
| 32 | var authenticationsecuritymethodBME *ManagedEntityDefinition |
| 33 | |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 34 | // AuthenticationSecurityMethod (Class ID: #148 / 0x0094) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 35 | // 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 |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 46 | // This attribute uniquely identifies each instance of this ME. The value 0xFFFF is reserved. (R, |
| 47 | // setbycreate) (mandatory) (2-bytes) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 48 | // |
| 49 | // Validation Scheme |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 50 | // 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 | // |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 59 | // (R,-W) (mandatory) (1-byte) |
| 60 | // |
| 61 | // Username 1 |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 62 | // 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) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 64 | // |
| 65 | // Password |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 66 | // 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) |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 68 | // |
| 69 | // Realm |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 70 | // This string attribute specifies the realm used in digest authentication. If the string is |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 71 | // shorter than 25-bytes, it must be null terminated. (R,-W) (mandatory) (25-bytes) |
| 72 | // |
| 73 | // Username 2 |
mpagenko | 836a1fd | 2021-11-01 16:12:42 +0000 | [diff] [blame] | 74 | // 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 | // |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 77 | // 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 | // |
| 82 | type AuthenticationSecurityMethod struct { |
| 83 | ManagedEntityDefinition |
| 84 | Attributes AttributeValueMap |
| 85 | } |
| 86 | |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 87 | // Attribute name constants |
| 88 | |
| 89 | const AuthenticationSecurityMethod_ValidationScheme = "ValidationScheme" |
| 90 | const AuthenticationSecurityMethod_Username1 = "Username1" |
| 91 | const AuthenticationSecurityMethod_Password = "Password" |
| 92 | const AuthenticationSecurityMethod_Realm = "Realm" |
| 93 | const AuthenticationSecurityMethod_Username2 = "Username2" |
| 94 | |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 95 | func init() { |
| 96 | authenticationsecuritymethodBME = &ManagedEntityDefinition{ |
| 97 | Name: "AuthenticationSecurityMethod", |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 98 | ClassID: AuthenticationSecurityMethodClassID, |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 99 | MessageTypes: mapset.NewSetWith( |
| 100 | Create, |
| 101 | Delete, |
| 102 | Get, |
| 103 | Set, |
| 104 | ), |
| 105 | AllowedAttributeMask: 0xf800, |
| 106 | AttributeDefinitions: AttributeDefinitionMap{ |
Holger Hildebrandt | 3ac49bd | 2022-02-07 17:46:43 +0000 | [diff] [blame] | 107 | 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), |
Holger Hildebrandt | fa07499 | 2020-03-27 15:42:06 +0000 | [diff] [blame] | 113 | }, |
| 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. |
| 122 | func NewAuthenticationSecurityMethod(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 123 | return NewManagedEntity(*authenticationsecuritymethodBME, params...) |
| 124 | } |