[VOL-2452] Using the latest omci-sim to enable MIB templating and
correctly report port status
Change-Id: I291c0fe01416c1541ef0f55779a77412a2271ea9
diff --git a/vendor/github.com/opencord/omci-sim/.gitignore b/vendor/github.com/opencord/omci-sim/.gitignore
new file mode 100644
index 0000000..a9f04a3
--- /dev/null
+++ b/vendor/github.com/opencord/omci-sim/.gitignore
@@ -0,0 +1,2 @@
+# GoLand
+.idea
diff --git a/vendor/github.com/opencord/omci-sim/VERSION b/vendor/github.com/opencord/omci-sim/VERSION
index 4e379d2..81340c7 100644
--- a/vendor/github.com/opencord/omci-sim/VERSION
+++ b/vendor/github.com/opencord/omci-sim/VERSION
@@ -1 +1 @@
-0.0.2
+0.0.4
diff --git a/vendor/github.com/opencord/omci-sim/omci_common.go b/vendor/github.com/opencord/omci-sim/omci_common.go
index c878780..a140141 100644
--- a/vendor/github.com/opencord/omci-sim/omci_common.go
+++ b/vendor/github.com/opencord/omci-sim/omci_common.go
@@ -49,10 +49,26 @@
pkt, _ = GetANIGAttributes(&pos, pkt, content)
return pkt
+ case SoftwareImage:
+ pos := uint(11)
+ pkt, _ = GetSoftwareImageAttributes(&pos, pkt, content)
+ return pkt
+
+ case ONUG:
+ pos := uint(11)
+ pkt, _ = GetOnuGAttributes(&pos, pkt, content)
+ return pkt
+
+ case ONU2G:
+ pos := uint(11)
+ pkt, _ = GetOnu2GAttributes(&pos, pkt, content)
+ return pkt
+
case EthernetPMHistoryData:
pos := uint(11)
pkt, _ = GetEthernetPMHistoryDataAttributes(&pos, pkt, content)
return pkt
+
default:
// For unimplemented MEs, just fill in the attribute mask and return 0 values for the requested attributes
// TODO implement Get for unimplemented MEs as well
diff --git a/vendor/github.com/opencord/omci-sim/omci_defs.go b/vendor/github.com/opencord/omci-sim/omci_defs.go
index d84e878..90ea0af 100644
--- a/vendor/github.com/opencord/omci-sim/omci_defs.go
+++ b/vendor/github.com/opencord/omci-sim/omci_defs.go
@@ -159,10 +159,14 @@
func (c OmciClass) PrettyPrint() string {
switch c {
+ case SoftwareImage:
+ return "SoftwareImage"
case EthernetPMHistoryData:
return "EthernetPMHistoryData"
case ONUG:
return "ONUG"
+ case ONU2G:
+ return "ONU2G"
case ANIG:
return "ANIG"
case GEMPortNetworkCTP:
@@ -175,8 +179,10 @@
const (
// Managed Entity Class values
+ SoftwareImage OmciClass = 7
EthernetPMHistoryData OmciClass = 24
ONUG OmciClass = 256
+ ONU2G OmciClass = 257
ANIG OmciClass = 263
GEMPortNetworkCTP OmciClass = 268
)
diff --git a/vendor/github.com/opencord/omci-sim/omci_handlers.go b/vendor/github.com/opencord/omci-sim/omci_handlers.go
index de62498..5ba28f9 100644
--- a/vendor/github.com/opencord/omci-sim/omci_handlers.go
+++ b/vendor/github.com/opencord/omci-sim/omci_handlers.go
@@ -475,9 +475,10 @@
func getAllAlarms(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
var pkt []byte
+ // Report number of commands as 1, basically there is always one alarm to get, the ONU/PPTP locked, link down or up
pkt = []byte{
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
- 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -513,13 +514,31 @@
func getAllAlarmsNext(class OmciClass, content OmciContent, key OnuKey) ([]byte, error) {
var pkt []byte
- pkt = []byte{
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+ OnuOmciStateMapLock.Lock()
+ if OnuOmciState, ok := OnuOmciStateMap[key]; ok {
+ // if we are locked then admin down was sent and PPTP 257 is in alarm/locked state, this ensures get alarm
+ // shows that
+ if OnuOmciState.state == LOCKED {
+ // alarm set, alarm spot 0, LAN LOS
+ pkt = []byte{
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
+ 0x00, 0x0b, 0x01, 0x01, 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+ } else {
+ // alarm clear
+ pkt = []byte{
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
+ 0x00, 0x0b, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+ }
+ }
+ OnuOmciStateMapLock.Unlock()
log.WithFields(log.Fields{
"IntfId": key.IntfId,
diff --git a/vendor/github.com/opencord/omci-sim/omci_onu2g.go b/vendor/github.com/opencord/omci-sim/omci_onu2g.go
new file mode 100644
index 0000000..0c2329d
--- /dev/null
+++ b/vendor/github.com/opencord/omci-sim/omci_onu2g.go
@@ -0,0 +1,206 @@
+/*
+ * 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.
+ */
+
+package core
+
+import (
+ "encoding/binary"
+)
+
+type Onu2GAttributes int
+
+const (
+ _ = iota
+ EquipmentID Onu2GAttributes = 0x8000
+ OmccVersion Onu2GAttributes = 0x4000
+ VendorProductCode Onu2GAttributes = 0x2000
+ SecurityCapability Onu2GAttributes = 0x1000
+ SecurityMode Onu2GAttributes = 0x0800
+ TotalPriorityQueueNumber Onu2GAttributes = 0x0400
+ TotalTrafficSchedulerNumber Onu2GAttributes = 0x0200
+ Mode Onu2GAttributes = 0x0100
+ TotalGemPortIDNumber Onu2GAttributes = 0x0080
+ SysUptime Onu2GAttributes = 0x0040
+ ConnectivityCapability Onu2GAttributes = 0x0020
+ CurrentConnectivityMode Onu2GAttributes = 0x0010
+ QosConfigurationFlexibility Onu2GAttributes = 0x0008
+ PriorityQueueScaleFactor Onu2GAttributes = 0x0004
+)
+
+type Onu2GAttributeHandler func(*uint, []byte) ([]byte, error)
+
+var Onu2GAttributeHandlers = map[Onu2GAttributes]Onu2GAttributeHandler{
+ EquipmentID: GetEquipmentID,
+ OmccVersion: GetOmccVersion,
+ VendorProductCode: GetVendorProductCode,
+ SecurityCapability: GetSecurityCapability,
+ SecurityMode: GetSecurityMode,
+ TotalPriorityQueueNumber: GetTotalPriorityQueueNumber,
+ TotalTrafficSchedulerNumber: GetTotalTrafficSchedulerNumber,
+ Mode: GetMode,
+ TotalGemPortIDNumber: GetTotalGemPortIDNumber,
+ SysUptime: GetSysUptime,
+ ConnectivityCapability: GetConnectivityCapability,
+ CurrentConnectivityMode: GetCurrentConnectivityMode,
+ QosConfigurationFlexibility: GetQosConfigurationFlexibility,
+ PriorityQueueScaleFactor: GetPriorityQueueScaleFactor,
+}
+
+func GetOnu2GAttributes(pos *uint, pkt []byte, content OmciContent) ([]byte, error) {
+ AttributesMask := getAttributeMask(content)
+
+ for index := uint(16); index >= 1; index-- {
+ Attribute := 1 << (index - 1)
+ reqAttribute := Attribute & AttributesMask
+
+ if reqAttribute != 0 {
+ pkt, _ = Onu2GAttributeHandlers[Onu2GAttributes(reqAttribute)](pos, pkt)
+ }
+ }
+
+ pkt[8] = 0x00 // Command Processed Successfully
+ pkt[9] = uint8(AttributesMask >> 8)
+ pkt[10] = uint8(AttributesMask & 0x00FF)
+
+ return pkt, nil
+
+}
+
+func GetEquipmentID(pos *uint, pkt []byte) ([]byte, error) {
+ // 20 bytes
+ equipid := []byte("12345123451234512345")
+ for _, ch := range equipid {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetOmccVersion(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 bytes
+ pkt[*pos] = 0xB4
+ *pos++
+ return pkt, nil
+}
+
+func GetVendorProductCode(pos *uint, pkt []byte) ([]byte, error) {
+ // 2 bytes
+ prodcode := []byte{0x00, 0x00}
+ for _, ch := range prodcode {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetSecurityCapability(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x01
+ *pos++
+ return pkt, nil
+}
+
+func GetSecurityMode(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x01
+ *pos++
+ return pkt, nil
+}
+
+func GetTotalPriorityQueueNumber(pos *uint, pkt []byte) ([]byte, error) {
+ // 2 bytes
+ // report 0 queues because thats what BRCM does...
+ numqueues := 0
+ bs := make([]byte, 2)
+ binary.BigEndian.PutUint16(bs, uint16(numqueues))
+ for _, ch := range bs {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetTotalTrafficSchedulerNumber(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x00
+ *pos++
+ return pkt, nil
+}
+
+func GetMode(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x01
+ *pos++
+ return pkt, nil
+}
+
+func GetTotalGemPortIDNumber(pos *uint, pkt []byte) ([]byte, error) {
+ // 2 bytes
+ gemports := 32
+ bs := make([]byte, 2)
+ binary.BigEndian.PutUint16(bs, uint16(gemports))
+ for _, ch := range bs {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetSysUptime(pos *uint, pkt []byte) ([]byte, error) {
+ // 4 byte int
+ uptime := 0
+ bs := make([]byte, 4)
+ binary.BigEndian.PutUint32(bs, uint32(uptime))
+ for _, ch := range bs {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetConnectivityCapability(pos *uint, pkt []byte) ([]byte, error) {
+ // 2 bytes
+ caps := []byte{0x00, 0x7F}
+ for _, ch := range caps {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetCurrentConnectivityMode(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x00
+ *pos++
+ return pkt, nil
+}
+
+func GetQosConfigurationFlexibility(pos *uint, pkt []byte) ([]byte, error) {
+ // 2 bytes
+ qosconf := []byte{0x00, 0x30}
+ for _, ch := range qosconf {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetPriorityQueueScaleFactor(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 bytes
+ pkt[*pos] = 0x01
+ *pos++
+ return pkt, nil
+}
diff --git a/vendor/github.com/opencord/omci-sim/omci_onug.go b/vendor/github.com/opencord/omci-sim/omci_onug.go
new file mode 100644
index 0000000..1cf6b0d
--- /dev/null
+++ b/vendor/github.com/opencord/omci-sim/omci_onug.go
@@ -0,0 +1,185 @@
+/*
+ * 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.
+ */
+
+package core
+
+type OnuGAttributes int
+
+const (
+ _ = iota
+ VendorID OnuGAttributes = 0x8000
+ Version OnuGAttributes = 0x4000
+ SerialNumber OnuGAttributes = 0x2000
+ TrafficManagementOptions OnuGAttributes = 0x1000
+ VpVcCrossConnectOptions OnuGAttributes = 0x0800
+ BatteryBackup OnuGAttributes = 0x0400
+ AdministrativeState OnuGAttributes = 0x0200
+ OperationalState OnuGAttributes = 0x0100
+ OntSurvivalTime OnuGAttributes = 0x0080
+ LogicalOnuID OnuGAttributes = 0x0040
+ LogicalPassword OnuGAttributes = 0x0020
+ CredentialsStatus OnuGAttributes = 0x0010
+ ExtendedTcLayerOptions OnuGAttributes = 0x0008
+)
+
+type OnuGAttributeHandler func(*uint, []byte) ([]byte, error)
+
+var OnuGAttributeHandlers = map[OnuGAttributes]OnuGAttributeHandler{
+ VendorID: GetVendorID,
+ Version: GetVersion,
+ SerialNumber: GetSerialNumber,
+ TrafficManagementOptions: GetTrafficManagementOptions,
+ VpVcCrossConnectOptions: GetVpVcCrossConnectOptions,
+ BatteryBackup: GetBatteryBackup,
+ AdministrativeState: GetAdministrativeState,
+ OperationalState: GetOperationalState,
+ OntSurvivalTime: GetOntSurvivalTime,
+ LogicalOnuID: GetLogicalOnuID,
+ LogicalPassword: GetLogicalPassword,
+ CredentialsStatus: GetCredentialsStatus,
+ ExtendedTcLayerOptions: GetExtendedTcLayerOptions,
+}
+
+func GetOnuGAttributes(pos *uint, pkt []byte, content OmciContent) ([]byte, error) {
+ AttributesMask := getAttributeMask(content)
+
+ for index := uint(16); index >= 1; index-- {
+ Attribute := 1 << (index - 1)
+ reqAttribute := Attribute & AttributesMask
+
+ if reqAttribute != 0 {
+ pkt, _ = OnuGAttributeHandlers[OnuGAttributes(reqAttribute)](pos, pkt)
+ }
+ }
+
+ pkt[8] = 0x00 // Command Processed Successfully
+ pkt[9] = uint8(AttributesMask >> 8)
+ pkt[10] = uint8(AttributesMask & 0x00FF)
+
+ return pkt, nil
+
+}
+
+func GetVendorID(pos *uint, pkt []byte) ([]byte, error) {
+ // 4 bytes
+ vendorid := []byte("BBSM")
+ for _, ch := range vendorid {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetVersion(pos *uint, pkt []byte) ([]byte, error) {
+ // 14 bytes
+ for i := 1; i <= 14; i++ {
+ b := byte(' ')
+ pkt[*pos] = b
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetSerialNumber(pos *uint, pkt []byte) ([]byte, error) {
+ // 8 bytes
+ vendorid := []byte("BBSM")
+ serialhex := []byte{0x00, 0x00, 0x00, 0x01}
+ serialnumber := append(vendorid, serialhex...)
+ for _, ch := range serialnumber {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetTrafficManagementOptions(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x00
+ *pos++
+ return pkt, nil
+}
+
+func GetVpVcCrossConnectOptions(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x00
+ *pos++
+ return pkt, nil
+}
+
+func GetBatteryBackup(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x00
+ *pos++
+ return pkt, nil
+}
+
+func GetAdministrativeState(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x00
+ *pos++
+ return pkt, nil
+}
+
+func GetOperationalState(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x00
+ *pos++
+ return pkt, nil
+}
+
+func GetOntSurvivalTime(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x00
+ *pos++
+ return pkt, nil
+}
+
+func GetLogicalOnuID(pos *uint, pkt []byte) ([]byte, error) {
+ // 24 bytes
+ for i := 1; i <= 24; i++ {
+ b := byte(' ')
+ pkt[*pos] = b
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetLogicalPassword(pos *uint, pkt []byte) ([]byte, error) {
+ // 24 bytes
+ for i := 1; i <= 24; i++ {
+ b := byte(' ')
+ pkt[*pos] = b
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetCredentialsStatus(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x00
+ *pos++
+ return pkt, nil
+}
+
+func GetExtendedTcLayerOptions(pos *uint, pkt []byte) ([]byte, error) {
+ // 2 bytes
+ tcbits := []byte{0x00, 0x00}
+ for _, ch := range tcbits {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
diff --git a/vendor/github.com/opencord/omci-sim/omci_sim.go b/vendor/github.com/opencord/omci-sim/omci_sim.go
index c971d54..6195168 100644
--- a/vendor/github.com/opencord/omci-sim/omci_sim.go
+++ b/vendor/github.com/opencord/omci-sim/omci_sim.go
@@ -135,6 +135,12 @@
Packet: linkMsgDown,
}
omciCh <- msg
+
+ OnuOmciStateMapLock.Lock()
+ if OnuOmciState, ok := OnuOmciStateMap[key]; ok {
+ OnuOmciState.state = LOCKED
+ }
+ OnuOmciStateMapLock.Unlock()
}
// attribute bit 5 (admin state) in the PPTP is being set, its value is 0, unlock
@@ -158,6 +164,12 @@
Packet: linkMsgUp,
}
omciCh <- msg
+
+ OnuOmciStateMapLock.Lock()
+ if OnuOmciState, ok := OnuOmciStateMap[key]; ok {
+ OnuOmciState.state = DONE
+ }
+ OnuOmciStateMapLock.Unlock()
}
}
diff --git a/vendor/github.com/opencord/omci-sim/omci_softwareimage.go b/vendor/github.com/opencord/omci-sim/omci_softwareimage.go
new file mode 100644
index 0000000..f0d2f9e
--- /dev/null
+++ b/vendor/github.com/opencord/omci-sim/omci_softwareimage.go
@@ -0,0 +1,111 @@
+/*
+ * 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.
+ */
+
+package core
+
+type SoftwareImageAttributes int
+
+const (
+ _ = iota
+ SoftwareVersion SoftwareImageAttributes = 0x8000
+ IsCommited SoftwareImageAttributes = 0x4000
+ IsActive SoftwareImageAttributes = 0x2000
+ IsValid SoftwareImageAttributes = 0x1000
+ ProductCode SoftwareImageAttributes = 0x0800
+ ImageHash SoftwareImageAttributes = 0x0400
+)
+
+type SoftwareImageAttributeHandler func(*uint, []byte) ([]byte, error)
+
+var SoftwareImageAttributeHandlers = map[SoftwareImageAttributes]SoftwareImageAttributeHandler{
+ SoftwareVersion: GetSoftwareVersion,
+ IsCommited: GetIsCommited,
+ IsActive: GetIsActive,
+ IsValid: GetIsValid,
+ ProductCode: GetProductCode,
+ ImageHash: GetImageHash,
+}
+
+func GetSoftwareImageAttributes(pos *uint, pkt []byte, content OmciContent) ([]byte, error) {
+ AttributesMask := getAttributeMask(content)
+
+ for index := uint(16); index >= 1; index-- {
+ Attribute := 1 << (index - 1)
+ reqAttribute := Attribute & AttributesMask
+
+ if reqAttribute != 0 {
+ pkt, _ = SoftwareImageAttributeHandlers[SoftwareImageAttributes(reqAttribute)](pos, pkt)
+ }
+ }
+
+ pkt[8] = 0x00 // Command Processed Successfully
+ pkt[9] = uint8(AttributesMask >> 8)
+ pkt[10] = uint8(AttributesMask & 0x00FF)
+
+ return pkt, nil
+
+}
+
+func GetSoftwareVersion(pos *uint, pkt []byte) ([]byte, error) {
+ // 14 bytes
+ version := []byte("00000000000001")
+ for _, ch := range version {
+ pkt[*pos] = ch
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetIsCommited(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 bytes
+ pkt[*pos] = 0x01
+ *pos++
+ return pkt, nil
+}
+
+func GetIsActive(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 bytes
+ pkt[*pos] = 0x01
+ *pos++
+ return pkt, nil
+}
+
+func GetIsValid(pos *uint, pkt []byte) ([]byte, error) {
+ // 1 byte
+ pkt[*pos] = 0x01
+ *pos++
+ return pkt, nil
+}
+
+func GetProductCode(pos *uint, pkt []byte) ([]byte, error) {
+ // 25 bytes
+ // BRCM has 25 nulls
+ for i := 1; i <= 25; i++ {
+ pkt[*pos] = 0x00
+ *pos++
+ }
+ return pkt, nil
+}
+
+func GetImageHash(pos *uint, pkt []byte) ([]byte, error) {
+ // 16 bytes
+ // BRCM has 16 nulls
+ for i := 1; i <= 16; i++ {
+ pkt[*pos] = 0x00
+ *pos++
+ }
+ return pkt, nil
+}
diff --git a/vendor/github.com/opencord/omci-sim/omci_state.go b/vendor/github.com/opencord/omci-sim/omci_state.go
index eb923ba..ddb9921 100644
--- a/vendor/github.com/opencord/omci-sim/omci_state.go
+++ b/vendor/github.com/opencord/omci-sim/omci_state.go
@@ -41,6 +41,7 @@
const (
INCOMPLETE istate = iota
DONE
+ LOCKED
)
var OnuOmciStateMap = map[OnuKey]*OnuOmciState{}