[VOL-5292] Implementation for fetching the GEM port history Data from the ONT
Change-Id: I4cf22555cbd13bcd5e49e620c8aa8b67cbd2891c
Signed-off-by: Akash Reddy Kankanala <akash.kankanala@radisys.com>
diff --git a/internal/pkg/avcfg/onu_uni_tp.go b/internal/pkg/avcfg/onu_uni_tp.go
index d3492a5..0b4a204 100755
--- a/internal/pkg/avcfg/onu_uni_tp.go
+++ b/internal/pkg/avcfg/onu_uni_tp.go
@@ -1059,3 +1059,17 @@
delete(onuTP.PAniConfigFsm, k)
}
}
+
+// GetGEMportToAllocIDMappingForONU - function to get the GEM ports and corresponding alloc-id mapping for an ONU
+func (onuTP *OnuUniTechProf) GetGEMportToAllocIDMappingForONU(ctx context.Context, aDeviceID string) map[uint16]uint16 {
+ logger.Debugw(ctx, "getting GEM port to AllocID mapping for the ONU", log.Fields{"device-id": aDeviceID})
+ gemportAllocIdMap := make(map[uint16]uint16)
+ for _, tcontGemList := range onuTP.mapPonAniConfig {
+ for gemPortID := range tcontGemList.mapGemPortParams {
+ gemportAllocIdMap[gemPortID] = tcontGemList.tcontParams.allocID
+
+ }
+ }
+ logger.Debugw(ctx, "Mapping between all the GEM ports to corresponding AllocID", log.Fields{"device-id": aDeviceID, "gemportAllocIDMapping": gemportAllocIdMap})
+ return gemportAllocIdMap
+}