[VOL-4619] Additional debug logs for EAPOL and DHCP
Change-Id: I2d3a807d24c4792681693d0375243225f338e093
diff --git a/internal/bbsim/devices/onu.go b/internal/bbsim/devices/onu.go
index e6e4e58..174d943 100644
--- a/internal/bbsim/devices/onu.go
+++ b/internal/bbsim/devices/onu.go
@@ -1397,10 +1397,27 @@
uni.StorePortNo(msg.Flow.PortNo)
if msg.Flow.Classifier.EthType == uint32(layers.EthernetTypeEAPOL) && msg.Flow.Classifier.OVid == 4091 {
+ onuLogger.WithFields(log.Fields{
+ "IntfId": o.PonPortID,
+ "OnuId": o.ID,
+ "UniId": msg.Flow.UniId,
+ "PortNo": msg.Flow.PortNo,
+ "SerialNumber": o.Sn(),
+ "FlowId": msg.Flow.FlowId,
+ }).Debug("EAPOL flow detected")
uni.HandleAuth()
} else if msg.Flow.Classifier.EthType == uint32(layers.EthernetTypeIPv4) &&
msg.Flow.Classifier.SrcPort == uint32(68) &&
msg.Flow.Classifier.DstPort == uint32(67) {
+ onuLogger.WithFields(log.Fields{
+ "IntfId": o.PonPortID,
+ "OnuId": o.ID,
+ "UniId": msg.Flow.UniId,
+ "PortNo": msg.Flow.PortNo,
+ "SerialNumber": o.Sn(),
+ "FlowId": msg.Flow.FlowId,
+ "FlowType": msg.Flow.FlowType,
+ }).Debug("DHCP flow detected")
uni.HandleDhcp(uint8(msg.Flow.Classifier.OPbits), int(msg.Flow.Classifier.OVid))
}
}
diff --git a/internal/bbsim/devices/services.go b/internal/bbsim/devices/services.go
index b5645b8..c540e60 100644
--- a/internal/bbsim/devices/services.go
+++ b/internal/bbsim/devices/services.go
@@ -183,7 +183,9 @@
for {
select {
case <-service.UniPort.Onu.PonPort.Olt.enableContext.Done():
- // if the OLT is disabled, then cancel
+ serviceLogger.WithFields(log.Fields{
+ "context": service.UniPort.Onu.PonPort.Olt.enableContext,
+ }).Debug("EAPOL cancelled, OLT is disabled")
return
case <-time.After(eapolWaitTime):
if service.EapolState.Current() != eapol.StateResponseSuccessReceived {
@@ -237,7 +239,9 @@
for {
select {
case <-service.UniPort.Onu.PonPort.Olt.enableContext.Done():
- // if the OLT is disabled, then cancel
+ serviceLogger.WithFields(log.Fields{
+ "context": service.UniPort.Onu.PonPort.Olt.enableContext,
+ }).Debug("DHCP cancelled, OLT is disabled")
return
case <-time.After(dhcpWaitTime):
if service.DHCPState.Current() != "dhcp_ack_received" {
@@ -331,6 +335,15 @@
return
}
+ serviceLogger.WithFields(log.Fields{
+ "OnuId": s.UniPort.Onu.ID,
+ "IntfId": s.UniPort.Onu.PonPortID,
+ "OnuSn": s.UniPort.Onu.Sn(),
+ "PortNo": s.UniPort.PortNo,
+ "UniId": s.UniPort.ID,
+ "Name": s.Name,
+ "NeedsEapol": s.NeedsEapol,
+ }).Debug("Starting EAPOL for the service")
if err := s.EapolState.Event(eapol.EventStartAuth); err != nil {
serviceLogger.WithFields(log.Fields{
"OnuId": s.UniPort.Onu.ID,
@@ -376,8 +389,15 @@
return
}
- // TODO check if the DHCP flow was received before starting DHCP
-
+ serviceLogger.WithFields(log.Fields{
+ "OnuId": s.UniPort.Onu.ID,
+ "IntfId": s.UniPort.Onu.PonPortID,
+ "OnuSn": s.UniPort.Onu.Sn(),
+ "PortNo": s.UniPort.PortNo,
+ "UniId": s.UniPort.ID,
+ "Name": s.Name,
+ "NeedsEapol": s.NeedsEapol,
+ }).Debug("Starting DHCP for the service")
if err := s.DHCPState.Event("start_dhcp"); err != nil {
serviceLogger.WithFields(log.Fields{
"OnuId": s.UniPort.Onu.ID,