[VOL-4654] Adding unkown attributes to the ONU-2G ME if the flag is set
Change-Id: I26bff7aada739566a144b13cf0b14f7319e5d763
diff --git a/VERSION b/VERSION
index 6b89d58..81f3632 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.12.2
+1.12.3
diff --git a/cmd/bbsim/bbsim.go b/cmd/bbsim/bbsim.go
index 2c34e64..294e055 100644
--- a/cmd/bbsim/bbsim.go
+++ b/cmd/bbsim/bbsim.go
@@ -162,6 +162,7 @@
"AuthRetry": common.Config.BBSim.AuthRetry,
"OltRebootDelay": common.Config.Olt.OltRebootDelay,
"OmciResponseRate": common.Config.Olt.OmciResponseRate,
+ "injectOmciUnknownMe": common.Config.BBSim.InjectOmciUnknownMe,
"injectOmciUnknownAttributes": common.Config.BBSim.InjectOmciUnknownAttributes,
}).Info("BroadBand Simulator is on")
diff --git a/internal/common/omci/onu_mib_db.go b/internal/common/omci/onu_mib_db.go
index 23d2e99..08322ca 100644
--- a/internal/common/omci/onu_mib_db.go
+++ b/internal/common/omci/onu_mib_db.go
@@ -467,24 +467,42 @@
}
// ONU-2g
- mibDb.items = append(mibDb.items, MibDbEntry{
+
+ onu2g := MibDbEntry{
me.Onu2GClassID,
EntityID{0x00, 0x00},
me.AttributeValueMap{
- me.Onu2G_ConnectivityCapability: 127,
- me.Onu2G_CurrentConnectivityMode: 0,
- me.Onu2G_Deprecated: 1,
- me.Onu2G_PriorityQueueScaleFactor: 1,
- me.Onu2G_QualityOfServiceQosConfigurationFlexibility: 63,
- me.Onu2G_Sysuptime: 0,
- me.Onu2G_TotalGemPortIdNumber: 8,
+ //me.Onu2G_EquipmentId: 1,
+ //me.Onu2G_OpticalNetworkUnitManagementAndControlChannelOmccVersion: 2,
+ //me.Onu2G_VendorProductCode: 3,
+ //me.Onu2G_SecurityCapability: 4,
+ //me.Onu2G_SecurityMode: 5,
+
me.Onu2G_TotalPriorityQueueNumber: 64,
me.Onu2G_TotalTrafficSchedulerNumber: 8,
+ me.Onu2G_Deprecated: 1,
+ me.Onu2G_TotalGemPortIdNumber: 8,
+ me.Onu2G_Sysuptime: 6,
+ me.Onu2G_ConnectivityCapability: 127,
+ me.Onu2G_CurrentConnectivityMode: 7,
+ me.Onu2G_QualityOfServiceQosConfigurationFlexibility: 63,
+ me.Onu2G_PriorityQueueScaleFactor: 1,
},
nil,
- })
+ }
if common.Config.BBSim.InjectOmciUnknownAttributes {
+ onu2g = MibDbEntry{
+ me.Onu2GClassID,
+ nil,
+ me.AttributeValueMap{},
+ []byte{129, 41, 46, 10, 0, 2, 0, 0, 1, 1, 0, 0, 7, 253, 0, 64, 8, 1, 0, 8, 0, 0, 0, 6, 0, 127, 7, 0, 63, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 40},
+ }
+ }
+
+ mibDb.items = append(mibDb.items, onu2g)
+
+ if common.Config.BBSim.InjectOmciUnknownMe {
// NOTE the TxID is actually replaced
// by SetTxIdInEncodedPacket in CreateMibUploadNextResponse
txId := uint16(33066)
diff --git a/internal/common/omci/onu_mib_db_test.go b/internal/common/omci/onu_mib_db_test.go
index 7a589ad..e1c1213 100644
--- a/internal/common/omci/onu_mib_db_test.go
+++ b/internal/common/omci/onu_mib_db_test.go
@@ -146,7 +146,7 @@
common.Config = &common.GlobalConfig{
BBSim: common.BBSimConfig{
- InjectOmciUnknownAttributes: true,
+ InjectOmciUnknownMe: true,
},
}
diff --git a/internal/common/options.go b/internal/common/options.go
index 44b571a..318e29f 100644
--- a/internal/common/options.go
+++ b/internal/common/options.go
@@ -188,6 +188,7 @@
KafkaEventTopic string `yaml:"kafka_event_topic"`
DmiServerAddress string `yaml:"dmi_server_address"`
BandwidthProfileFormat string `yaml:"bp_format"`
+ InjectOmciUnknownMe bool `yaml:"inject_omci_unknown_me"`
InjectOmciUnknownAttributes bool `yaml:"inject_omci_unknown_attributes"`
}
@@ -358,7 +359,8 @@
kafkaEventTopic := flag.String("kafkaEventTopic", conf.BBSim.KafkaEventTopic, "Ability to configure the topic on which BBSim publishes events on Kafka")
dhcpRetry := flag.Bool("dhcpRetry", conf.BBSim.DhcpRetry, "Set this flag if BBSim should retry DHCP upon failure until success")
authRetry := flag.Bool("authRetry", conf.BBSim.AuthRetry, "Set this flag if BBSim should retry EAPOL (Authentication) upon failure until success")
- injectOmciUnknownAttributes := flag.Bool("injectOmciUnknownAttributes", conf.BBSim.InjectOmciUnknownAttributes, "Generate a MibDB packet with Unknown Attributes")
+ injectOmciUnknownMe := flag.Bool("injectOmciUnknownMe", conf.BBSim.InjectOmciUnknownMe, "Generate an extra MibDB packet with ClassID 37 (Intentionally left blank)")
+ injectOmciUnknownAttributes := flag.Bool("injectOmciUnknownAttributes", conf.BBSim.InjectOmciUnknownAttributes, "Modifies the ONU2-G MibDB packet to add Unknown Attributes")
flag.Parse()
@@ -390,6 +392,7 @@
conf.BBSim.AuthRetry = *authRetry
conf.BBSim.DhcpRetry = *dhcpRetry
conf.BBSim.DmiServerAddress = *dmi_server_address
+ conf.BBSim.InjectOmciUnknownMe = *injectOmciUnknownMe
conf.BBSim.InjectOmciUnknownAttributes = *injectOmciUnknownAttributes
// update device id if not set
@@ -435,6 +438,7 @@
AuthRetry: false,
DmiServerAddress: ":50075",
BandwidthProfileFormat: BP_FORMAT_MEF,
+ InjectOmciUnknownMe: false,
InjectOmciUnknownAttributes: false,
},
OltConfig{