[VOL-4627] Add COMBO pon support with configuration file
Change-Id: Ib7eec5640dfd5e5eb39e722ec7d2c8ee2b59f060
diff --git a/internal/common/omci/onu_mib_db.go b/internal/common/omci/onu_mib_db.go
index e9fabed..2902fd2 100644
--- a/internal/common/omci/onu_mib_db.go
+++ b/internal/common/omci/onu_mib_db.go
@@ -21,6 +21,7 @@
"encoding/binary"
"encoding/hex"
+ "github.com/opencord/bbsim/internal/common"
me "github.com/opencord/omci-lib-go/v2/generated"
)
@@ -70,6 +71,7 @@
cardHolderOnuType byte = 0x01 // ONU is a single piece of integrated equipment
ethernetUnitType byte = 0x2f // Ethernet BASE-T
xgsPonUnitType byte = 0xee // XG-PON10G10
+ gPonUnitType byte = 0xf5 // GPON12441244
potsUnitType byte = 0x20 // POTS
cardHolderSlotID byte = 0x01
tcontSlotId byte = 0x80 // why is this not the same as the cardHolderSlotID, it does not point to anything
@@ -92,7 +94,7 @@
// creates a MIB database for a ONU
// CircuitPack and CardHolder are static, everything else can be configured
-func GenerateMibDatabase(ethUniPortCount int, potsUniPortCount int) (*MibDb, error) {
+func GenerateMibDatabase(ethUniPortCount int, potsUniPortCount int, technology common.PonTechnology) (*MibDb, error) {
mibDb := MibDb{
items: []MibDbEntry{},
@@ -116,12 +118,21 @@
// },
//})
- // circuitPack XG-PON10G10
+ // ANI circuitPack
+ var aniCPType byte
+
+ switch technology {
+ case common.XGSPON:
+ aniCPType = xgsPonUnitType
+ case common.GPON:
+ aniCPType = gPonUnitType
+ }
+
mibDb.items = append(mibDb.items, MibDbEntry{
me.CircuitPackClassID,
circuitPackEntityID,
me.AttributeValueMap{
- me.CircuitPack_Type: xgsPonUnitType,
+ me.CircuitPack_Type: aniCPType,
me.CircuitPack_NumberOfPorts: 1, // NOTE is this the ANI port? must be
me.CircuitPack_SerialNumber: ToOctets("BBSM-Circuit-Pack-ani", 20),
me.CircuitPack_Version: ToOctets("v0.0.1", 20),
diff --git a/internal/common/omci/onu_mib_db_test.go b/internal/common/omci/onu_mib_db_test.go
index 378ac6e..2794aa4 100644
--- a/internal/common/omci/onu_mib_db_test.go
+++ b/internal/common/omci/onu_mib_db_test.go
@@ -19,6 +19,7 @@
import (
"testing"
+ "github.com/opencord/bbsim/internal/common"
"github.com/opencord/omci-lib-go/v2"
me "github.com/opencord/omci-lib-go/v2/generated"
"github.com/stretchr/testify/assert"
@@ -56,7 +57,7 @@
func Test_GenerateMibDatabase(t *testing.T) {
const uniPortCount = 4
- mibDb, err := GenerateMibDatabase(uniPortCount, 0)
+ mibDb, err := GenerateMibDatabase(uniPortCount, 0, common.XGSPON)
expectedItems := 9 //ONU-G + 2 Circuit Packs (4 messages each)
expectedItems += 2 * uniPortCount // 1 PPTP and 1 UniG per UNI
@@ -94,7 +95,7 @@
func Test_GenerateMibDatabase_withPots(t *testing.T) {
const uniPortCount = 4
const potsPortCount = 1
- mibDb, err := GenerateMibDatabase(uniPortCount, potsPortCount)
+ mibDb, err := GenerateMibDatabase(uniPortCount, potsPortCount, common.XGSPON)
expectedItems := 13 //ONU-G + 3 Circuit Packs (4 messages each)
expectedItems += 2 * (uniPortCount + potsPortCount) // 1 PPTP and 1 UniG per UNI