[VOL-3680] Integrate omci-lib-go 0.13.3
Change-Id: I00895373842bac8e6885919d0e3b2032cd70d350
diff --git a/VERSION b/VERSION
index 034c80e..736f74c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.15-dev145
+0.1.15-dev146
diff --git a/go.mod b/go.mod
index f2d3ff5..c315675 100644
--- a/go.mod
+++ b/go.mod
@@ -8,7 +8,7 @@
github.com/golang/protobuf v1.4.2
github.com/google/gopacket v1.1.17
github.com/looplab/fsm v0.1.0
- github.com/opencord/omci-lib-go v0.13.2
+ github.com/opencord/omci-lib-go v0.13.3
github.com/opencord/voltha-lib-go/v3 v3.1.23
github.com/opencord/voltha-protos/v3 v3.3.9
github.com/stretchr/testify v1.6.1
diff --git a/go.sum b/go.sum
index 857cbc0..89c8c62 100644
--- a/go.sum
+++ b/go.sum
@@ -217,8 +217,8 @@
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.2 h1:3mYCb7aPxS/RU7TI1y4rkEn1oKmPRjNJLNEXgw7MH2I=
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
-github.com/opencord/omci-lib-go v0.13.2 h1:h6tNSc89cQ8Bj7NzemIzbMioPQxD6Jr8Du0fp1myJvE=
-github.com/opencord/omci-lib-go v0.13.2/go.mod h1:6OIHB14Ch5qGgHzwSWlMACtk5KFoLzQ4LAhdcy4jwvo=
+github.com/opencord/omci-lib-go v0.13.3 h1:HlBw/bdCsfz/sRVm8bXNrxdRcCpPqEqJ7xQk7CUqWkA=
+github.com/opencord/omci-lib-go v0.13.3/go.mod h1:6OIHB14Ch5qGgHzwSWlMACtk5KFoLzQ4LAhdcy4jwvo=
github.com/opencord/voltha-lib-go/v3 v3.1.23 h1:cbrg+QmIXR3fQHSlo5+QokmSDkFdU7fTYmwxCU5QprY=
github.com/opencord/voltha-lib-go/v3 v3.1.23/go.mod h1:sa508HZ5vlOauh0i+WC0XFX1JZnfHtJqNIms5XBT/Z0=
github.com/opencord/voltha-protos/v3 v3.3.9 h1:BnfDN9oaRBgyAiH9ZN7LpBpEJYxjX/ZS7R4OT2hDrtY=
diff --git a/internal/pkg/onuadaptercore/mib_sync.go b/internal/pkg/onuadaptercore/mib_sync.go
index 2163b6c..97dfc47 100644
--- a/internal/pkg/onuadaptercore/mib_sync.go
+++ b/internal/pkg/onuadaptercore/mib_sync.go
@@ -336,25 +336,26 @@
func (oo *OnuDeviceEntry) handleOmciMibUploadNextResponseMessage(msg OmciMessage) {
msgLayer := (*msg.OmciPacket).Layer(omci.LayerTypeMibUploadNextResponse)
- //TODO: temporary change due to VOL-3532
- // if msgLayer == nil {
- // logger.Errorw("Omci Msg layer could not be detected", log.Fields{"device-id": onuDeviceEntry.deviceID})
- // return
- // }
- if msgLayer != nil {
- msgObj, msgOk := msgLayer.(*omci.MibUploadNextResponse)
- if !msgOk {
- logger.Errorw("Omci Msg layer could not be assigned", log.Fields{"device-id": oo.deviceID})
- return
- }
- logger.Debugw("MibUploadNextResponse Data for:", log.Fields{"device-id": oo.deviceID, "data-fields": msgObj})
+ if msgLayer == nil {
+ logger.Errorw("Omci Msg layer could not be detected", log.Fields{"device-id": oo.deviceID})
+ return
+ }
+ msgObj, msgOk := msgLayer.(*omci.MibUploadNextResponse)
+ if !msgOk {
+ logger.Errorw("Omci Msg layer could not be assigned", log.Fields{"device-id": oo.deviceID})
+ return
+ }
+ meName := msgObj.ReportedME.GetName()
+ if meName == "UnknownItuG988ManagedEntity" || meName == "UnknownVendorSpecificManagedEntity" {
+ logger.Debugw("MibUploadNextResponse Data for unknown ME received - temporary workaround is to ignore it!",
+ log.Fields{"device-id": oo.deviceID, "data-fields": msgObj, "meName": meName})
+ } else {
+ logger.Debugw("MibUploadNextResponse Data for:",
+ log.Fields{"device-id": oo.deviceID, "meName": meName, "data-fields": msgObj})
meClassID := msgObj.ReportedME.GetClassID()
meEntityID := msgObj.ReportedME.GetEntityID()
meAttributes := msgObj.ReportedME.GetAttributeValueMap()
-
oo.pOnuDB.PutMe(meClassID, meEntityID, meAttributes)
- } else {
- logger.Warnw("msgLayer could not be decoded - temporary workaround for VOL-3532 in place!", log.Fields{"device-id": oo.deviceID})
}
if oo.PDevOmciCC.uploadSequNo < oo.PDevOmciCC.uploadNoOfCmds {
_ = oo.PDevOmciCC.sendMibUploadNext(context.TODO(), ConstDefaultOmciTimeout, true)
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...)
+}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index d7fbd3c..8d18d5c 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -71,7 +71,7 @@
github.com/mitchellh/go-homedir
# github.com/mitchellh/mapstructure v1.1.2
github.com/mitchellh/mapstructure
-# github.com/opencord/omci-lib-go v0.13.2
+# github.com/opencord/omci-lib-go v0.13.3
github.com/opencord/omci-lib-go
github.com/opencord/omci-lib-go/generated
# github.com/opencord/voltha-lib-go/v3 v3.1.23