[VOL-3680] Integrate omci-lib-go 0.13.3
Change-Id: I00895373842bac8e6885919d0e3b2032cd70d350
diff --git a/vendor/github.com/opencord/omci-lib-go/VERSION b/vendor/github.com/opencord/omci-lib-go/VERSION
index 9beb74d..288adf5 100644
--- a/vendor/github.com/opencord/omci-lib-go/VERSION
+++ b/vendor/github.com/opencord/omci-lib-go/VERSION
@@ -1 +1 @@
-0.13.2
+0.13.3
diff --git a/vendor/github.com/opencord/omci-lib-go/generated/classidmap.go b/vendor/github.com/opencord/omci-lib-go/generated/classidmap.go
index 7538d66..2fe9ea1 100644
--- a/vendor/github.com/opencord/omci-lib-go/generated/classidmap.go
+++ b/vendor/github.com/opencord/omci-lib-go/generated/classidmap.go
@@ -23,8 +23,6 @@
package generated
-import "fmt"
-
// ManagedEntityInfo provides ManagedEntity information
type ManagedEntityInfo struct {
New func(params ...ParamData) (*ManagedEntity, error)
@@ -239,12 +237,13 @@
// LoadManagedEntityDefinition returns a function to create a Managed Entity for a specific
// Managed Entity class ID
func LoadManagedEntityDefinition(classID ClassID, params ...ParamData) (*ManagedEntity, OmciErrors) {
- newFunc, ok := classToManagedEntityMap[classID]
- if ok {
+ if newFunc, ok := classToManagedEntityMap[classID]; ok {
return newFunc(params...)
}
- return nil, NewUnknownEntityError(fmt.Sprintf("managed entity %d (%#x) definition not found",
- uint16(classID), uint16(classID)))
+ if IsVendorSpecificClassID(classID) {
+ return NewUnknownVendorSpecificME(classID, params...)
+ }
+ return NewUnknownG988ME(classID, params...)
}
// GetSupportedClassIDs returns an array of Managed Entity Class IDs supported
@@ -264,3 +263,12 @@
}
return medef.GetAttributeDefinitions(), err
}
+
+// IsVendorSpecificClassID returns true if the provided class ID is reserved in ITU-T G.988
+// for vendor specific functionality
+func IsVendorSpecificClassID(classID ClassID) bool {
+ // Values below are from Table 11.2.4-1 of ITU-T G.988 (11/2017)
+ return (ClassID(240) <= classID && classID <= ClassID(255)) ||
+ (ClassID(350) <= classID && classID <= ClassID(399)) ||
+ (ClassID(65280) <= classID && classID <= ClassID(65535))
+}
\ No newline at end of file
diff --git a/vendor/github.com/opencord/omci-lib-go/generated/classsupport.go b/vendor/github.com/opencord/omci-lib-go/generated/classsupport.go
index 5edba61..9cc9dc6 100644
--- a/vendor/github.com/opencord/omci-lib-go/generated/classsupport.go
+++ b/vendor/github.com/opencord/omci-lib-go/generated/classsupport.go
@@ -26,6 +26,10 @@
Unsupported // OMCI returns error code if accessed
PartiallySupported // some aspects of ME supported
Ignored // OMCI supported, but underlying function is now
+
+ // The following two are specific unsupported Managed Entity Definitions
+ UnsupportedManagedEntity // Unsupported ITU G.988 Class ID
+ UnsupportedVendorSpecificManagedEntity // Unsupported Vendor Specific Class ID
)
func (cs ClassSupport) String() string {
diff --git a/vendor/github.com/opencord/omci-lib-go/generated/me.go b/vendor/github.com/opencord/omci-lib-go/generated/me.go
index 7e51f85..caa32bc 100644
--- a/vendor/github.com/opencord/omci-lib-go/generated/me.go
+++ b/vendor/github.com/opencord/omci-lib-go/generated/me.go
@@ -74,6 +74,11 @@
return entity.definition.GetClassID()
}
+// SetClassID assigns the 16-bit class ID of a Managed Entity
+func (entity *ManagedEntity) SetClassID(classID ClassID) {
+ entity.definition.SetClassID(classID)
+}
+
// GetMessageTypes returns the OMCI message types that a Managed Entity supports
func (entity ManagedEntity) GetMessageTypes() mapset.Set {
return entity.definition.GetMessageTypes()
diff --git a/vendor/github.com/opencord/omci-lib-go/generated/medef.go b/vendor/github.com/opencord/omci-lib-go/generated/medef.go
index a2bd2da..7cb85d2 100644
--- a/vendor/github.com/opencord/omci-lib-go/generated/medef.go
+++ b/vendor/github.com/opencord/omci-lib-go/generated/medef.go
@@ -58,6 +58,11 @@
return bme.ClassID
}
+// SetClassID assigns the 16-bit class ID of a managed entity from a ME Definition
+func (bme *ManagedEntityDefinition) SetClassID(classID ClassID) {
+ bme.ClassID = classID
+}
+
// GetMessageTypes retrieves the OMCI Message Types supporte3d by a managed entity from a ME Definition
func (bme ManagedEntityDefinition) GetMessageTypes() mapset.Set {
return bme.MessageTypes
diff --git a/vendor/github.com/opencord/omci-lib-go/generated/unknowng988me.go b/vendor/github.com/opencord/omci-lib-go/generated/unknowng988me.go
new file mode 100644
index 0000000..af68823
--- /dev/null
+++ b/vendor/github.com/opencord/omci-lib-go/generated/unknowng988me.go
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
+ * Copyright 2020-present Open Networking Foundation
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * NOTE: This file was generated, manual edits will be overwritten!
+ *
+ * Generated by 'goCodeGenerator.py':
+ * https://github.com/cboling/OMCI-parser/README.md
+ */
+
+package generated
+
+import "github.com/deckarep/golang-set"
+
+
+var unknownG988BME *ManagedEntityDefinition
+
+type UnknownG988ME struct {
+ ManagedEntityDefinition
+ Attributes AttributeValueMap
+}
+
+func init() {
+ unknownG988BME = &ManagedEntityDefinition{
+ Name: "UnknownItuG988ManagedEntity",
+ ClassID: 0,
+ MessageTypes: mapset.NewSetWith(
+ MibUploadNext,
+ AlarmNotification,
+ AttributeValueChange,
+ ),
+ AllowedAttributeMask: 0xffff,
+ AttributeDefinitions: AttributeDefinitionMap{
+ 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
+ 1: MultiByteField("UnknownAttr_1", OctetsAttributeType, 0x8000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 1),
+ 2: MultiByteField("UnknownAttr_2", OctetsAttributeType, 0x4000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 2),
+ 3: MultiByteField("UnknownAttr_3", OctetsAttributeType, 0x2000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 3),
+ 4: MultiByteField("UnknownAttr_4", OctetsAttributeType, 0x1000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 4),
+ 5: MultiByteField("UnknownAttr_5", OctetsAttributeType, 0x0800, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 5),
+ 6: MultiByteField("UnknownAttr_6", OctetsAttributeType, 0x0400, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 6),
+ 7: MultiByteField("UnknownAttr_7", OctetsAttributeType, 0x0200, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 7),
+ 8: MultiByteField("UnknownAttr_8", OctetsAttributeType, 0x0100, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 8),
+ 9: MultiByteField("UnknownAttr_9", OctetsAttributeType, 0x0080, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 9),
+ 10: MultiByteField("UnknownAttr_10", OctetsAttributeType, 0x0040, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 10),
+ 11: MultiByteField("UnknownAttr_11", OctetsAttributeType, 0x0020, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 11),
+ 12: MultiByteField("UnknownAttr_12", OctetsAttributeType, 0x0010, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 12),
+ 13: MultiByteField("UnknownAttr_13", OctetsAttributeType, 0x0008, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 13),
+ 14: MultiByteField("UnknownAttr_14", OctetsAttributeType, 0x0004, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 14),
+ 15: MultiByteField("UnknownAttr_15", OctetsAttributeType, 0x0002, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 15),
+ 16: MultiByteField("UnknownAttr_16", OctetsAttributeType, 0x0001, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 16),
+ },
+ Access: UnknownAccess,
+ Support: UnsupportedManagedEntity,
+ }
+}
+
+func NewUnknownG988ME(classID ClassID, params ...ParamData) (*ManagedEntity, OmciErrors) {
+ return newUnknownManagedEntity(classID, *unknownG988BME, params...)
+}
+
+// newUnknownManagedEntity creates a ManagedEntity given an ME Definition and parameter/attribute data
+// much like NewManagedEntity but treats attributes is a special way
+func newUnknownManagedEntity(classID ClassID, definition ManagedEntityDefinition, params ...ParamData) (*ManagedEntity, OmciErrors) {
+ entity := &ManagedEntity{
+ definition: definition,
+ attributes: make(map[string]interface{}),
+ }
+ // Make this unique for the received class ID and attribute masks
+ entity.SetClassID(classID)
+
+ if params != nil {
+ if err := entity.setAttributes(params...); err.StatusCode() != Success {
+ return nil, err
+ }
+ }
+ return entity, NewOmciSuccess()
+}
diff --git a/vendor/github.com/opencord/omci-lib-go/generated/unknownvendorspecificme.go b/vendor/github.com/opencord/omci-lib-go/generated/unknownvendorspecificme.go
new file mode 100644
index 0000000..146e012
--- /dev/null
+++ b/vendor/github.com/opencord/omci-lib-go/generated/unknownvendorspecificme.go
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
+ * Copyright 2020-present Open Networking Foundation
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /*
+ * NOTE: This file was generated, manual edits will be overwritten!
+ *
+ * Generated by 'goCodeGenerator.py':
+ * https://github.com/cboling/OMCI-parser/README.md
+ */
+
+package generated
+
+import "github.com/deckarep/golang-set"
+
+
+var unknownVendorSpecificBME *ManagedEntityDefinition
+
+type UnknownVendorSpecific struct {
+ ManagedEntityDefinition
+ Attributes AttributeValueMap
+}
+
+func init() {
+ unknownVendorSpecificBME = &ManagedEntityDefinition{
+ Name: "UnknownVendorSpecificManagedEntity",
+ ClassID: 0,
+ MessageTypes: mapset.NewSetWith(
+ MibUploadNext,
+ AlarmNotification,
+ AttributeValueChange,
+ ),
+ AllowedAttributeMask: 0xffff,
+ AttributeDefinitions: AttributeDefinitionMap{
+ 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
+ 1: MultiByteField("UnknownAttr_1", OctetsAttributeType, 0x8000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 1),
+ 2: MultiByteField("UnknownAttr_2", OctetsAttributeType, 0x4000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 2),
+ 3: MultiByteField("UnknownAttr_3", OctetsAttributeType, 0x2000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 3),
+ 4: MultiByteField("UnknownAttr_4", OctetsAttributeType, 0x1000, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 4),
+ 5: MultiByteField("UnknownAttr_5", OctetsAttributeType, 0x0800, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 5),
+ 6: MultiByteField("UnknownAttr_6", OctetsAttributeType, 0x0400, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 6),
+ 7: MultiByteField("UnknownAttr_7", OctetsAttributeType, 0x0200, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 7),
+ 8: MultiByteField("UnknownAttr_8", OctetsAttributeType, 0x0100, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 8),
+ 9: MultiByteField("UnknownAttr_9", OctetsAttributeType, 0x0080, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 9),
+ 10: MultiByteField("UnknownAttr_10", OctetsAttributeType, 0x0040, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 10),
+ 11: MultiByteField("UnknownAttr_11", OctetsAttributeType, 0x0020, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 11),
+ 12: MultiByteField("UnknownAttr_12", OctetsAttributeType, 0x0010, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 12),
+ 13: MultiByteField("UnknownAttr_13", OctetsAttributeType, 0x0008, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 13),
+ 14: MultiByteField("UnknownAttr_14", OctetsAttributeType, 0x0004, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 14),
+ 15: MultiByteField("UnknownAttr_15", OctetsAttributeType, 0x0002, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 15),
+ 16: MultiByteField("UnknownAttr_16", OctetsAttributeType, 0x0001, 1, toOctets("AA=="), mapset.NewSetWith(Read), true, true, false, 16),
+ },
+ Access: UnknownAccess,
+ Support: UnsupportedVendorSpecificManagedEntity,
+ }
+}
+
+func NewUnknownVendorSpecificME(classID ClassID, params ...ParamData) (*ManagedEntity, OmciErrors) {
+ return newUnknownManagedEntity(classID, *unknownVendorSpecificBME, params...)
+}