implement ns-o-ran ASN1 definition to kpimon using libe2proto
This commit is contained in:
parent
458d4bee5a
commit
ba8e17688f
49
Dockerfile
49
Dockerfile
@ -28,25 +28,37 @@ RUN cd xapp-frame && \
|
|||||||
WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon
|
WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon
|
||||||
COPY control/ control/
|
COPY control/ control/
|
||||||
COPY cmd/ cmd/
|
COPY cmd/ cmd/
|
||||||
COPY e2ap/ e2ap/
|
|
||||||
COPY e2sm/ e2sm/
|
|
||||||
|
|
||||||
# "COMPILING E2AP Wrapper"
|
# # "COMPILING E2AP Wrapper"
|
||||||
RUN cd e2ap && \
|
# RUN cd e2ap && \
|
||||||
gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \
|
# gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \
|
||||||
gcc *.o -shared -o libe2apwrapper.so && \
|
# gcc *.o -shared -o libe2apwrapper.so && \
|
||||||
cp libe2apwrapper.so /usr/local/lib/ && \
|
# cp libe2apwrapper.so /usr/local/lib/ && \
|
||||||
mkdir /usr/local/include/e2ap && \
|
# mkdir /usr/local/include/e2ap && \
|
||||||
cp wrapper.h headers/*.h /usr/local/include/e2ap && \
|
# cp wrapper.h headers/*.h /usr/local/include/e2ap && \
|
||||||
ldconfig
|
# ldconfig
|
||||||
|
|
||||||
# "COMPILING E2SM Wrapper"
|
# # "COMPILING E2SM Wrapper"
|
||||||
RUN cd e2sm && \
|
# RUN cd e2sm && \
|
||||||
gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \
|
# gcc -c -fPIC -Iheaders/ lib/*.c wrapper.c && \
|
||||||
gcc *.o -shared -o libe2smwrapper.so && \
|
# gcc *.o -shared -o libe2smwrapper.so && \
|
||||||
cp libe2smwrapper.so /usr/local/lib/ && \
|
# cp libe2smwrapper.so /usr/local/lib/ && \
|
||||||
mkdir /usr/local/include/e2sm && \
|
# mkdir /usr/local/include/e2sm && \
|
||||||
cp wrapper.h headers/*.h /usr/local/include/e2sm && \
|
# cp wrapper.h headers/*.h /usr/local/include/e2sm && \
|
||||||
|
# ldconfig
|
||||||
|
|
||||||
|
RUN git clone -b ns-o-ran https://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@github.com/wineslab/libe2proto
|
||||||
|
|
||||||
|
WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon/libe2proto
|
||||||
|
|
||||||
|
RUN cmake .
|
||||||
|
RUN make
|
||||||
|
RUN make install
|
||||||
|
|
||||||
|
RUN mkdir /usr/local/include/libe2proto && \
|
||||||
|
cp src/wrapper/wrapper.h /usr/local/include/libe2proto && \
|
||||||
|
cp src/e2ap/*.h /usr/local/include/libe2proto && \
|
||||||
|
cp src/e2sm/*.h /usr/local/include/libe2proto && \
|
||||||
ldconfig
|
ldconfig
|
||||||
|
|
||||||
WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon
|
WORKDIR /go/src/gerrit.o-ran-sc.org/r/scp/ric-app/kpimon
|
||||||
@ -66,8 +78,7 @@ ENV RMR_SEED_RT /opt/routes.txt
|
|||||||
COPY routes.txt /opt/routes.txt
|
COPY routes.txt /opt/routes.txt
|
||||||
|
|
||||||
COPY --from=kpimonbuild /usr/local/lib /usr/local/lib
|
COPY --from=kpimonbuild /usr/local/lib /usr/local/lib
|
||||||
COPY --from=kpimonbuild /usr/local/include/e2ap/*.h /usr/local/include/e2ap/
|
COPY --from=kpimonbuild /usr/local/include/libe2proto/*.h /usr/local/include/libe2proto/
|
||||||
COPY --from=kpimonbuild /usr/local/include/e2sm/*.h /usr/local/include/e2sm/
|
|
||||||
RUN ldconfig
|
RUN ldconfig
|
||||||
WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/config/
|
WORKDIR /go/src/gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/config/
|
||||||
COPY --from=kpimonbuild /go/src/gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/config/config-file.yaml .
|
COPY --from=kpimonbuild /go/src/gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/config/config-file.yaml .
|
||||||
|
@ -257,75 +257,81 @@ func (c *Control) handleIndication(params *xapp.RMRParams) (err error) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if indHdrFormat1.NRCGI != nil {
|
if indHdrFormat1.CollectionStartTime != nil {
|
||||||
|
log.Printf("CollectionStartTime: %x", indHdrFormat1.CollectionStartTime.Buf)
|
||||||
log.Printf("nRCGI.PlmnID: %x", indHdrFormat1.NRCGI.PlmnID.Buf)
|
|
||||||
log.Printf("nRCGI.NRCellID ID: %x, Unused: %d", indHdrFormat1.NRCGI.NRCellID.Buf, indHdrFormat1.NRCGI.NRCellID.BitsUnused)
|
|
||||||
|
|
||||||
cellIDHdr, err = e2sm.ParseNRCGI(*indHdrFormat1.NRCGI)
|
|
||||||
if err != nil {
|
|
||||||
xapp.Logger.Error("Failed to parse NRCGI in RIC Indication Header: %v", err)
|
|
||||||
log.Printf("Failed to parse NRCGI in RIC Indication Header: %v", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
cellIDHdr = ""
|
log.Printf("No Collection Start Time")
|
||||||
}
|
}
|
||||||
|
|
||||||
if indHdrFormat1.PlmnID != nil {
|
// if indHdrFormat1.NRCGI != nil {
|
||||||
log.Printf("PlmnID: %x", indHdrFormat1.PlmnID.Buf)
|
|
||||||
|
|
||||||
plmnIDHdr, err = e2sm.ParsePLMNIdentity(indHdrFormat1.PlmnID.Buf, indHdrFormat1.PlmnID.Size)
|
// log.Printf("nRCGI.PlmnID: %x", indHdrFormat1.NRCGI.PlmnID.Buf)
|
||||||
if err != nil {
|
// log.Printf("nRCGI.NRCellID ID: %x, Unused: %d", indHdrFormat1.NRCGI.NRCellID.Buf, indHdrFormat1.NRCGI.NRCellID.BitsUnused)
|
||||||
xapp.Logger.Error("Failed to parse PlmnID in RIC Indication Header: %v", err)
|
|
||||||
log.Printf("Failed to parse PlmnID in RIC Indication Header: %v", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
plmnIDHdr = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
if indHdrFormat1.SliceID != nil {
|
// cellIDHdr, err = e2sm.ParseNRCGI(*indHdrFormat1.NRCGI)
|
||||||
log.Printf("SST: %x", indHdrFormat1.SliceID.SST.Buf)
|
// if err != nil {
|
||||||
|
// xapp.Logger.Error("Failed to parse NRCGI in RIC Indication Header: %v", err)
|
||||||
|
// log.Printf("Failed to parse NRCGI in RIC Indication Header: %v", err)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// cellIDHdr = ""
|
||||||
|
// }
|
||||||
|
|
||||||
if indHdrFormat1.SliceID.SD != nil {
|
// if indHdrFormat1.PlmnID != nil {
|
||||||
log.Printf("SD: %x", indHdrFormat1.SliceID.SD.Buf)
|
// log.Printf("PlmnID: %x", indHdrFormat1.PlmnID.Buf)
|
||||||
}
|
|
||||||
|
|
||||||
sliceIDHdr, err = e2sm.ParseSliceID(*indHdrFormat1.SliceID)
|
// plmnIDHdr, err = e2sm.ParsePLMNIdentity(indHdrFormat1.PlmnID.Buf, indHdrFormat1.PlmnID.Size)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
xapp.Logger.Error("Failed to parse SliceID in RIC Indication Header: %v", err)
|
// xapp.Logger.Error("Failed to parse PlmnID in RIC Indication Header: %v", err)
|
||||||
log.Printf("Failed to parse SliceID in RIC Indication Header: %v", err)
|
// log.Printf("Failed to parse PlmnID in RIC Indication Header: %v", err)
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
sliceIDHdr = -1
|
// plmnIDHdr = ""
|
||||||
}
|
// }
|
||||||
|
|
||||||
if indHdrFormat1.FiveQI != -1 {
|
// if indHdrFormat1.SliceID != nil {
|
||||||
log.Printf("5QI: %d", indHdrFormat1.FiveQI)
|
// log.Printf("SST: %x", indHdrFormat1.SliceID.SST.Buf)
|
||||||
}
|
|
||||||
fiveQIHdr = indHdrFormat1.FiveQI
|
|
||||||
|
|
||||||
if indHdrFormat1.Qci != -1 {
|
// if indHdrFormat1.SliceID.SD != nil {
|
||||||
log.Printf("QCI: %d", indHdrFormat1.Qci)
|
// log.Printf("SD: %x", indHdrFormat1.SliceID.SD.Buf)
|
||||||
}
|
// }
|
||||||
|
|
||||||
if indHdrFormat1.UeMessageType != -1 {
|
// sliceIDHdr, err = e2sm.ParseSliceID(*indHdrFormat1.SliceID)
|
||||||
log.Printf("Ue Report type: %d", indHdrFormat1.UeMessageType)
|
// if err != nil {
|
||||||
}
|
// xapp.Logger.Error("Failed to parse SliceID in RIC Indication Header: %v", err)
|
||||||
|
// log.Printf("Failed to parse SliceID in RIC Indication Header: %v", err)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// sliceIDHdr = -1
|
||||||
|
// }
|
||||||
|
|
||||||
if indHdrFormat1.GnbDUID != nil {
|
// if indHdrFormat1.FiveQI != -1 {
|
||||||
log.Printf("gNB-DU-ID: %x", indHdrFormat1.GnbDUID.Buf)
|
// log.Printf("5QI: %d", indHdrFormat1.FiveQI)
|
||||||
}
|
// }
|
||||||
|
// fiveQIHdr = indHdrFormat1.FiveQI
|
||||||
|
|
||||||
if indHdrFormat1.GnbNameType == 1 {
|
// if indHdrFormat1.Qci != -1 {
|
||||||
log.Printf("gNB-DU-Name: %x", (indHdrFormat1.GnbName.(*GNB_DU_Name)).Buf)
|
// log.Printf("QCI: %d", indHdrFormat1.Qci)
|
||||||
} else if indHdrFormat1.GnbNameType == 2 {
|
// }
|
||||||
log.Printf("gNB-CU-CP-Name: %x", (indHdrFormat1.GnbName.(*GNB_CU_CP_Name)).Buf)
|
|
||||||
} else if indHdrFormat1.GnbNameType == 3 {
|
// if indHdrFormat1.UeMessageType != -1 {
|
||||||
log.Printf("gNB-CU-UP-Name: %x", (indHdrFormat1.GnbName.(*GNB_CU_UP_Name)).Buf)
|
// log.Printf("Ue Report type: %d", indHdrFormat1.UeMessageType)
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
// if indHdrFormat1.GnbDUID != nil {
|
||||||
|
// log.Printf("gNB-DU-ID: %x", indHdrFormat1.GnbDUID.Buf)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if indHdrFormat1.GnbNameType == 1 {
|
||||||
|
// log.Printf("gNB-DU-Name: %x", (indHdrFormat1.GnbName.(*GNB_DU_Name)).Buf)
|
||||||
|
// } else if indHdrFormat1.GnbNameType == 2 {
|
||||||
|
// log.Printf("gNB-CU-CP-Name: %x", (indHdrFormat1.GnbName.(*GNB_CU_CP_Name)).Buf)
|
||||||
|
// } else if indHdrFormat1.GnbNameType == 3 {
|
||||||
|
// log.Printf("gNB-CU-UP-Name: %x", (indHdrFormat1.GnbName.(*GNB_CU_UP_Name)).Buf)
|
||||||
|
// }
|
||||||
|
|
||||||
if indHdrFormat1.GlobalgNBID != nil {
|
if indHdrFormat1.GlobalgNBID != nil {
|
||||||
log.Printf("PlmnID: %x", indHdrFormat1.GlobalgNBID.PlmnID.Buf)
|
log.Printf("PlmnID: %x", indHdrFormat1.GlobalgNBID.PlmnID.Buf)
|
||||||
@ -359,7 +365,7 @@ func (c *Control) handleIndication(params *xapp.RMRParams) (err error) {
|
|||||||
var availPRBUL int64
|
var availPRBUL int64
|
||||||
|
|
||||||
log.Printf("-----------RIC Indication Message-----------")
|
log.Printf("-----------RIC Indication Message-----------")
|
||||||
log.Printf("StyleType: %d", indMsg.StyleType)
|
// log.Printf("StyleType: %d", indMsg.StyleType)
|
||||||
if indMsg.IndMsgType == 1 {
|
if indMsg.IndMsgType == 1 {
|
||||||
log.Printf("RIC Indication Message Format: %d", indMsg.IndMsgType)
|
log.Printf("RIC Indication Message Format: %d", indMsg.IndMsgType)
|
||||||
|
|
||||||
@ -479,9 +485,9 @@ func (c *Control) handleIndication(params *xapp.RMRParams) (err error) {
|
|||||||
|
|
||||||
oCUCP := pmContainer.PFContainer.Container.(*OCUCPPFContainerType)
|
oCUCP := pmContainer.PFContainer.Container.(*OCUCPPFContainerType)
|
||||||
|
|
||||||
if oCUCP.GNBCUCPName != nil {
|
// if oCUCP.GNBCUCPName != nil {
|
||||||
log.Printf("gNB-CU-CP Name: %x", oCUCP.GNBCUCPName.Buf)
|
// log.Printf("gNB-CU-CP Name: %x", oCUCP.GNBCUCPName.Buf)
|
||||||
}
|
// }
|
||||||
|
|
||||||
log.Printf("NumberOfActiveUEs: %d", oCUCP.CUCPResourceStatus.NumberOfActiveUEs)
|
log.Printf("NumberOfActiveUEs: %d", oCUCP.CUCPResourceStatus.NumberOfActiveUEs)
|
||||||
} else if containerType == 3 {
|
} else if containerType == 3 {
|
||||||
@ -489,9 +495,9 @@ func (c *Control) handleIndication(params *xapp.RMRParams) (err error) {
|
|||||||
|
|
||||||
oCUUP := pmContainer.PFContainer.Container.(*OCUUPPFContainerType)
|
oCUUP := pmContainer.PFContainer.Container.(*OCUUPPFContainerType)
|
||||||
|
|
||||||
if oCUUP.GNBCUUPName != nil {
|
// if oCUUP.GNBCUUPName != nil {
|
||||||
log.Printf("gNB-CU-UP Name: %x", oCUUP.GNBCUUPName.Buf)
|
// log.Printf("gNB-CU-UP Name: %x", oCUUP.GNBCUUPName.Buf)
|
||||||
}
|
// }
|
||||||
|
|
||||||
cuUPPFContainerItemCount := oCUUP.CUUPPFContainerItemCount
|
cuUPPFContainerItemCount := oCUUP.CUUPPFContainerItemCount
|
||||||
log.Printf("CU-UP PF Container Item Count: %d", cuUPPFContainerItemCount)
|
log.Printf("CU-UP PF Container Item Count: %d", cuUPPFContainerItemCount)
|
||||||
@ -614,316 +620,320 @@ func (c *Control) handleIndication(params *xapp.RMRParams) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if pmContainer.RANContainer != nil {
|
if pmContainer.RANContainer != nil {
|
||||||
log.Printf("RANContainer: %x", pmContainer.RANContainer.Timestamp.Buf)
|
// log.Printf("RANContainer: %x", pmContainer.RANContainer.Timestamp.Buf)
|
||||||
|
log.Printf("RANContainer: %x", pmContainer.RANContainer.Buf)
|
||||||
|
// TODO parse RANContainer octect string
|
||||||
|
|
||||||
timestamp, _ := e2sm.ParseTimestamp(pmContainer.RANContainer.Timestamp.Buf, pmContainer.RANContainer.Timestamp.Size)
|
// timestamp, _ := e2sm.ParseTimestamp(pmContainer.RANContainer.Timestamp.Buf, pmContainer.RANContainer.Timestamp.Size)
|
||||||
log.Printf("Timestamp=[sec: %d, nsec: %d]", timestamp.TVsec, timestamp.TVnsec)
|
// log.Printf("Timestamp=[sec: %d, nsec: %d]", timestamp.TVsec, timestamp.TVnsec)
|
||||||
|
|
||||||
containerType = pmContainer.RANContainer.ContainerType
|
// TODO given the result of ran container log
|
||||||
if containerType == 1 {
|
// containerType = pmContainer.RANContainer.ContainerType
|
||||||
log.Printf("DU Usage Report: ")
|
// containerType = -1
|
||||||
|
// if containerType == 1 {
|
||||||
|
// log.Printf("DU Usage Report: ")
|
||||||
|
|
||||||
oDUUE := pmContainer.RANContainer.Container.(*DUUsageReportType)
|
// oDUUE := pmContainer.RANContainer.Container.(*DUUsageReportType)
|
||||||
|
|
||||||
for j := 0; j < oDUUE.CellResourceReportItemCount; j++ {
|
// for j := 0; j < oDUUE.CellResourceReportItemCount; j++ {
|
||||||
cellResourceReportItem := oDUUE.CellResourceReportItems[j]
|
// cellResourceReportItem := oDUUE.CellResourceReportItems[j]
|
||||||
|
|
||||||
log.Printf("nRCGI.PlmnID: %x", cellResourceReportItem.NRCGI.PlmnID.Buf)
|
// log.Printf("nRCGI.PlmnID: %x", cellResourceReportItem.NRCGI.PlmnID.Buf)
|
||||||
log.Printf("nRCGI.NRCellID: %x, Unused: %d", cellResourceReportItem.NRCGI.NRCellID.Buf, cellResourceReportItem.NRCGI.NRCellID.BitsUnused)
|
// log.Printf("nRCGI.NRCellID: %x, Unused: %d", cellResourceReportItem.NRCGI.NRCellID.Buf, cellResourceReportItem.NRCGI.NRCellID.BitsUnused)
|
||||||
|
|
||||||
servingCellID, err := e2sm.ParseNRCGI(cellResourceReportItem.NRCGI)
|
// servingCellID, err := e2sm.ParseNRCGI(cellResourceReportItem.NRCGI)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
xapp.Logger.Error("Failed to parse NRCGI in DU Usage Report: %v", err)
|
// xapp.Logger.Error("Failed to parse NRCGI in DU Usage Report: %v", err)
|
||||||
log.Printf("Failed to parse NRCGI in DU Usage Report: %v", err)
|
// log.Printf("Failed to parse NRCGI in DU Usage Report: %v", err)
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
|
|
||||||
for k := 0; k < cellResourceReportItem.UeResourceReportItemCount; k++ {
|
// for k := 0; k < cellResourceReportItem.UeResourceReportItemCount; k++ {
|
||||||
ueResourceReportItem := cellResourceReportItem.UeResourceReportItems[k]
|
// ueResourceReportItem := cellResourceReportItem.UeResourceReportItems[k]
|
||||||
|
|
||||||
log.Printf("C-RNTI: %x", ueResourceReportItem.CRNTI.Buf)
|
// log.Printf("C-RNTI: %x", ueResourceReportItem.CRNTI.Buf)
|
||||||
|
|
||||||
ueID, err := e2sm.ParseInteger(ueResourceReportItem.CRNTI.Buf, ueResourceReportItem.CRNTI.Size)
|
// ueID, err := e2sm.ParseInteger(ueResourceReportItem.CRNTI.Buf, ueResourceReportItem.CRNTI.Size)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
xapp.Logger.Error("Failed to parse C-RNTI in DU Usage Report with Serving Cell ID [%s]: %v", servingCellID, err)
|
// xapp.Logger.Error("Failed to parse C-RNTI in DU Usage Report with Serving Cell ID [%s]: %v", servingCellID, err)
|
||||||
log.Printf("Failed to parse C-RNTI in DU Usage Report with Serving Cell ID [%s]: %v", servingCellID, err)
|
// log.Printf("Failed to parse C-RNTI in DU Usage Report with Serving Cell ID [%s]: %v", servingCellID, err)
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
|
|
||||||
var ueMetrics UeMetricsEntry
|
// var ueMetrics UeMetricsEntry
|
||||||
|
|
||||||
retStr, err := c.sdl.Get([]string{"{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)})
|
// retStr, err := c.sdl.Get([]string{"{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)})
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
panic(err)
|
// panic(err)
|
||||||
xapp.Logger.Error("Failed to get ueMetrics from Redis!")
|
// xapp.Logger.Error("Failed to get ueMetrics from Redis!")
|
||||||
log.Printf("Failed to get ueMetrics from Redis!")
|
// log.Printf("Failed to get ueMetrics from Redis!")
|
||||||
} else {
|
// } else {
|
||||||
if retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)] != nil {
|
// if retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)] != nil {
|
||||||
ueJsonStr := retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)].(string)
|
// ueJsonStr := retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)].(string)
|
||||||
json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//if isUeExist, _ := c.client.Exists("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
|
|
||||||
// ueJsonStr, _ := c.client.Get("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result()
|
|
||||||
// json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
// json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
||||||
//}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
ueMetrics.UeID = ueID
|
// //if isUeExist, _ := c.client.Exists("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
|
||||||
log.Printf("UeID: %d", ueMetrics.UeID)
|
// // ueJsonStr, _ := c.client.Get("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result()
|
||||||
ueMetrics.ServingCellID = servingCellID
|
// // json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
||||||
log.Printf("ServingCellID: %s", ueMetrics.ServingCellID)
|
// //}
|
||||||
ueMetrics.MeasPeriodRF = 20
|
|
||||||
|
|
||||||
if flag {
|
// ueMetrics.UeID = ueID
|
||||||
timestampPRB = timestamp
|
// log.Printf("UeID: %d", ueMetrics.UeID)
|
||||||
}
|
// ueMetrics.ServingCellID = servingCellID
|
||||||
|
// log.Printf("ServingCellID: %s", ueMetrics.ServingCellID)
|
||||||
|
// ueMetrics.MeasPeriodRF = 20
|
||||||
|
|
||||||
ueMetrics.MeasTimestampPRB.TVsec = timestamp.TVsec
|
// if flag {
|
||||||
ueMetrics.MeasTimestampPRB.TVnsec = timestamp.TVnsec
|
// timestampPRB = timestamp
|
||||||
|
// }
|
||||||
|
|
||||||
if ueResourceReportItem.PRBUsageDL != -1 {
|
// ueMetrics.MeasTimestampPRB.TVsec = timestamp.TVsec
|
||||||
ueMetrics.PRBUsageDL = ueResourceReportItem.PRBUsageDL
|
// ueMetrics.MeasTimestampPRB.TVnsec = timestamp.TVnsec
|
||||||
log.Printf("PRBUsageDL: %d", ueMetrics.PRBUsageDL)
|
|
||||||
}
|
|
||||||
|
|
||||||
if ueResourceReportItem.PRBUsageUL != -1 {
|
// if ueResourceReportItem.PRBUsageDL != -1 {
|
||||||
ueMetrics.PRBUsageUL = ueResourceReportItem.PRBUsageUL
|
// ueMetrics.PRBUsageDL = ueResourceReportItem.PRBUsageDL
|
||||||
log.Printf("PRBUsageUL: %d", ueMetrics.PRBUsageUL)
|
// log.Printf("PRBUsageDL: %d", ueMetrics.PRBUsageDL)
|
||||||
}
|
// }
|
||||||
|
|
||||||
newUeJsonStr, err := json.Marshal(&ueMetrics)
|
// if ueResourceReportItem.PRBUsageUL != -1 {
|
||||||
if err != nil {
|
// ueMetrics.PRBUsageUL = ueResourceReportItem.PRBUsageUL
|
||||||
xapp.Logger.Error("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
// log.Printf("PRBUsageUL: %d", ueMetrics.PRBUsageUL)
|
||||||
log.Printf("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
// }
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
err = c.sdl.Set("{TS-UE-metrics},"+strconv.FormatInt(ueID, 10), newUeJsonStr)
|
// newUeJsonStr, err := json.Marshal(&ueMetrics)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// xapp.Logger.Error("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
||||||
log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// log.Printf("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
|
|
||||||
//err = c.client.Set("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
|
// err = c.sdl.Set("{TS-UE-metrics},"+strconv.FormatInt(ueID, 10), newUeJsonStr)
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
// log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
// continue
|
// continue
|
||||||
//}
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if containerType == 2 {
|
|
||||||
log.Printf("CU-CP Usage Report: ")
|
|
||||||
|
|
||||||
oCUCPUE := pmContainer.RANContainer.Container.(*CUCPUsageReportType)
|
// //err = c.client.Set("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
|
||||||
|
// //if err != nil {
|
||||||
|
// // xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
|
// // log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
|
// // continue
|
||||||
|
// //}
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else if containerType == 2 {
|
||||||
|
// log.Printf("CU-CP Usage Report: ")
|
||||||
|
|
||||||
for j := 0; j < oCUCPUE.CellResourceReportItemCount; j++ {
|
// oCUCPUE := pmContainer.RANContainer.Container.(*CUCPUsageReportType)
|
||||||
cellResourceReportItem := oCUCPUE.CellResourceReportItems[j]
|
|
||||||
|
|
||||||
log.Printf("nRCGI.PlmnID: %x", cellResourceReportItem.NRCGI.PlmnID.Buf)
|
// for j := 0; j < oCUCPUE.CellResourceReportItemCount; j++ {
|
||||||
log.Printf("nRCGI.NRCellID: %x, Unused: %d", cellResourceReportItem.NRCGI.NRCellID.Buf, cellResourceReportItem.NRCGI.NRCellID.BitsUnused)
|
// cellResourceReportItem := oCUCPUE.CellResourceReportItems[j]
|
||||||
|
|
||||||
servingCellID, err := e2sm.ParseNRCGI(cellResourceReportItem.NRCGI)
|
// log.Printf("nRCGI.PlmnID: %x", cellResourceReportItem.NRCGI.PlmnID.Buf)
|
||||||
if err != nil {
|
// log.Printf("nRCGI.NRCellID: %x, Unused: %d", cellResourceReportItem.NRCGI.NRCellID.Buf, cellResourceReportItem.NRCGI.NRCellID.BitsUnused)
|
||||||
xapp.Logger.Error("Failed to parse NRCGI in CU-CP Usage Report: %v", err)
|
|
||||||
log.Printf("Failed to parse NRCGI in CU-CP Usage Report: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
for k := 0; k < cellResourceReportItem.UeResourceReportItemCount; k++ {
|
// servingCellID, err := e2sm.ParseNRCGI(cellResourceReportItem.NRCGI)
|
||||||
ueResourceReportItem := cellResourceReportItem.UeResourceReportItems[k]
|
// if err != nil {
|
||||||
|
// xapp.Logger.Error("Failed to parse NRCGI in CU-CP Usage Report: %v", err)
|
||||||
|
// log.Printf("Failed to parse NRCGI in CU-CP Usage Report: %v", err)
|
||||||
|
// continue
|
||||||
|
// }
|
||||||
|
|
||||||
log.Printf("C-RNTI: %x", ueResourceReportItem.CRNTI.Buf)
|
// for k := 0; k < cellResourceReportItem.UeResourceReportItemCount; k++ {
|
||||||
|
// ueResourceReportItem := cellResourceReportItem.UeResourceReportItems[k]
|
||||||
|
|
||||||
ueID, err := e2sm.ParseInteger(ueResourceReportItem.CRNTI.Buf, ueResourceReportItem.CRNTI.Size)
|
// log.Printf("C-RNTI: %x", ueResourceReportItem.CRNTI.Buf)
|
||||||
if err != nil {
|
|
||||||
xapp.Logger.Error("Failed to parse C-RNTI in CU-CP Usage Report with Serving Cell ID [%s]: %v", err)
|
|
||||||
log.Printf("Failed to parse C-RNTI in CU-CP Usage Report with Serving Cell ID [%s]: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
var ueMetrics UeMetricsEntry
|
// ueID, err := e2sm.ParseInteger(ueResourceReportItem.CRNTI.Buf, ueResourceReportItem.CRNTI.Size)
|
||||||
|
// if err != nil {
|
||||||
|
// xapp.Logger.Error("Failed to parse C-RNTI in CU-CP Usage Report with Serving Cell ID [%s]: %v", err)
|
||||||
|
// log.Printf("Failed to parse C-RNTI in CU-CP Usage Report with Serving Cell ID [%s]: %v", err)
|
||||||
|
// continue
|
||||||
|
// }
|
||||||
|
|
||||||
retStr, err := c.sdl.Get([]string{"{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)})
|
// var ueMetrics UeMetricsEntry
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
xapp.Logger.Error("Failed to get ueMetrics from Redis!")
|
|
||||||
log.Printf("Failed to get ueMetrics from Redis!")
|
|
||||||
} else {
|
|
||||||
if retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)] != nil {
|
|
||||||
ueJsonStr := retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)].(string)
|
|
||||||
json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//if isUeExist, _ := c.client.Exists("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
|
// retStr, err := c.sdl.Get([]string{"{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)})
|
||||||
// ueJsonStr, _ := c.client.Get("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result()
|
// if err != nil {
|
||||||
|
// panic(err)
|
||||||
|
// xapp.Logger.Error("Failed to get ueMetrics from Redis!")
|
||||||
|
// log.Printf("Failed to get ueMetrics from Redis!")
|
||||||
|
// } else {
|
||||||
|
// if retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)] != nil {
|
||||||
|
// ueJsonStr := retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)].(string)
|
||||||
// json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
// json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
||||||
//}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
ueMetrics.UeID = ueID
|
// //if isUeExist, _ := c.client.Exists("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
|
||||||
log.Printf("UeID: %d", ueMetrics.UeID)
|
// // ueJsonStr, _ := c.client.Get("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result()
|
||||||
ueMetrics.ServingCellID = servingCellID
|
// // json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
||||||
log.Printf("ServingCellID: %s", ueMetrics.ServingCellID)
|
// //}
|
||||||
|
|
||||||
ueMetrics.MeasTimeRF.TVsec = timestamp.TVsec
|
// ueMetrics.UeID = ueID
|
||||||
ueMetrics.MeasTimeRF.TVnsec = timestamp.TVnsec
|
// log.Printf("UeID: %d", ueMetrics.UeID)
|
||||||
|
// ueMetrics.ServingCellID = servingCellID
|
||||||
|
// log.Printf("ServingCellID: %s", ueMetrics.ServingCellID)
|
||||||
|
|
||||||
ueMetrics.MeasPeriodPDCP = 20
|
// ueMetrics.MeasTimeRF.TVsec = timestamp.TVsec
|
||||||
ueMetrics.MeasPeriodPRB = 20
|
// ueMetrics.MeasTimeRF.TVnsec = timestamp.TVnsec
|
||||||
|
|
||||||
if ueResourceReportItem.ServingCellRF != nil {
|
// ueMetrics.MeasPeriodPDCP = 20
|
||||||
err = json.Unmarshal(ueResourceReportItem.ServingCellRF.Buf, &ueMetrics.ServingCellRF)
|
// ueMetrics.MeasPeriodPRB = 20
|
||||||
log.Printf("ueMetrics.ServingCellRF: %+v", ueMetrics.ServingCellRF)
|
|
||||||
if err != nil {
|
|
||||||
xapp.Logger.Error("Failed to Unmarshal ServingCellRF in CU-CP Usage Report with UE ID [%d]: %v", ueID, err)
|
|
||||||
log.Printf("Failed to Unmarshal ServingCellRF in CU-CP Usage Report with UE ID [%d]: %v", ueID, err)
|
|
||||||
log.Printf("ServingCellRF raw data: %x", ueResourceReportItem.ServingCellRF.Buf)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ueResourceReportItem.NeighborCellRF != nil {
|
// if ueResourceReportItem.ServingCellRF != nil {
|
||||||
err = json.Unmarshal(ueResourceReportItem.NeighborCellRF.Buf, &ueMetrics.NeighborCellsRF)
|
// err = json.Unmarshal(ueResourceReportItem.ServingCellRF.Buf, &ueMetrics.ServingCellRF)
|
||||||
log.Printf("ueMetrics.NeighborCellsRF: %+v", ueMetrics.NeighborCellsRF)
|
// log.Printf("ueMetrics.ServingCellRF: %+v", ueMetrics.ServingCellRF)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
xapp.Logger.Error("Failed to Unmarshal NeighborCellRF in CU-CP Usage Report with UE ID [%d]: %v", ueID, err)
|
// xapp.Logger.Error("Failed to Unmarshal ServingCellRF in CU-CP Usage Report with UE ID [%d]: %v", ueID, err)
|
||||||
log.Printf("Failed to Unmarshal NeighborCellRF in CU-CP Usage Report with UE ID [%d]: %v", ueID, err)
|
// log.Printf("Failed to Unmarshal ServingCellRF in CU-CP Usage Report with UE ID [%d]: %v", ueID, err)
|
||||||
log.Printf("NeighborCellRF raw data: %x", ueResourceReportItem.NeighborCellRF.Buf)
|
// log.Printf("ServingCellRF raw data: %x", ueResourceReportItem.ServingCellRF.Buf)
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
newUeJsonStr, err := json.Marshal(&ueMetrics)
|
// if ueResourceReportItem.NeighborCellRF != nil {
|
||||||
if err != nil {
|
// err = json.Unmarshal(ueResourceReportItem.NeighborCellRF.Buf, &ueMetrics.NeighborCellsRF)
|
||||||
xapp.Logger.Error("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
// log.Printf("ueMetrics.NeighborCellsRF: %+v", ueMetrics.NeighborCellsRF)
|
||||||
log.Printf("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
// if err != nil {
|
||||||
continue
|
// xapp.Logger.Error("Failed to Unmarshal NeighborCellRF in CU-CP Usage Report with UE ID [%d]: %v", ueID, err)
|
||||||
}
|
// log.Printf("Failed to Unmarshal NeighborCellRF in CU-CP Usage Report with UE ID [%d]: %v", ueID, err)
|
||||||
|
// log.Printf("NeighborCellRF raw data: %x", ueResourceReportItem.NeighborCellRF.Buf)
|
||||||
|
// continue
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
err = c.sdl.Set("{TS-UE-metrics},"+strconv.FormatInt(ueID, 10), newUeJsonStr)
|
// newUeJsonStr, err := json.Marshal(&ueMetrics)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// xapp.Logger.Error("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
||||||
log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// log.Printf("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
|
|
||||||
//err = c.client.Set("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
|
// err = c.sdl.Set("{TS-UE-metrics},"+strconv.FormatInt(ueID, 10), newUeJsonStr)
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
// log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
// continue
|
// continue
|
||||||
//}
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if containerType == 3 {
|
|
||||||
log.Printf("CU-UP Usage Report: ")
|
|
||||||
|
|
||||||
oCUUPUE := pmContainer.RANContainer.Container.(*CUUPUsageReportType)
|
// //err = c.client.Set("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
|
||||||
|
// //if err != nil {
|
||||||
|
// // xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
|
// // log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
|
// // continue
|
||||||
|
// //}
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else if containerType == 3 {
|
||||||
|
// log.Printf("CU-UP Usage Report: ")
|
||||||
|
|
||||||
for j := 0; j < oCUUPUE.CellResourceReportItemCount; j++ {
|
// oCUUPUE := pmContainer.RANContainer.Container.(*CUUPUsageReportType)
|
||||||
cellResourceReportItem := oCUUPUE.CellResourceReportItems[j]
|
|
||||||
|
|
||||||
log.Printf("nRCGI.PlmnID: %x", cellResourceReportItem.NRCGI.PlmnID.Buf)
|
// for j := 0; j < oCUUPUE.CellResourceReportItemCount; j++ {
|
||||||
log.Printf("nRCGI.NRCellID: %x, Unused: %d", cellResourceReportItem.NRCGI.NRCellID.Buf, cellResourceReportItem.NRCGI.NRCellID.BitsUnused)
|
// cellResourceReportItem := oCUUPUE.CellResourceReportItems[j]
|
||||||
|
|
||||||
servingCellID, err := e2sm.ParseNRCGI(cellResourceReportItem.NRCGI)
|
// log.Printf("nRCGI.PlmnID: %x", cellResourceReportItem.NRCGI.PlmnID.Buf)
|
||||||
if err != nil {
|
// log.Printf("nRCGI.NRCellID: %x, Unused: %d", cellResourceReportItem.NRCGI.NRCellID.Buf, cellResourceReportItem.NRCGI.NRCellID.BitsUnused)
|
||||||
xapp.Logger.Error("Failed to parse NRCGI in CU-UP Usage Report: %v", err)
|
|
||||||
log.Printf("Failed to parse NRCGI in CU-UP Usage Report: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
for k := 0; k < cellResourceReportItem.UeResourceReportItemCount; k++ {
|
// servingCellID, err := e2sm.ParseNRCGI(cellResourceReportItem.NRCGI)
|
||||||
ueResourceReportItem := cellResourceReportItem.UeResourceReportItems[k]
|
// if err != nil {
|
||||||
|
// xapp.Logger.Error("Failed to parse NRCGI in CU-UP Usage Report: %v", err)
|
||||||
|
// log.Printf("Failed to parse NRCGI in CU-UP Usage Report: %v", err)
|
||||||
|
// continue
|
||||||
|
// }
|
||||||
|
|
||||||
log.Printf("C-RNTI: %x", ueResourceReportItem.CRNTI.Buf)
|
// for k := 0; k < cellResourceReportItem.UeResourceReportItemCount; k++ {
|
||||||
|
// ueResourceReportItem := cellResourceReportItem.UeResourceReportItems[k]
|
||||||
|
|
||||||
ueID, err := e2sm.ParseInteger(ueResourceReportItem.CRNTI.Buf, ueResourceReportItem.CRNTI.Size)
|
// log.Printf("C-RNTI: %x", ueResourceReportItem.CRNTI.Buf)
|
||||||
if err != nil {
|
|
||||||
xapp.Logger.Error("Failed to parse C-RNTI in CU-UP Usage Report Serving Cell ID [%s]: %v", servingCellID, err)
|
|
||||||
log.Printf("Failed to parse C-RNTI in CU-UP Usage Report Serving Cell ID [%s]: %v", servingCellID, err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
var ueMetrics UeMetricsEntry
|
// ueID, err := e2sm.ParseInteger(ueResourceReportItem.CRNTI.Buf, ueResourceReportItem.CRNTI.Size)
|
||||||
|
// if err != nil {
|
||||||
|
// xapp.Logger.Error("Failed to parse C-RNTI in CU-UP Usage Report Serving Cell ID [%s]: %v", servingCellID, err)
|
||||||
|
// log.Printf("Failed to parse C-RNTI in CU-UP Usage Report Serving Cell ID [%s]: %v", servingCellID, err)
|
||||||
|
// continue
|
||||||
|
// }
|
||||||
|
|
||||||
retStr, err := c.sdl.Get([]string{"{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)})
|
// var ueMetrics UeMetricsEntry
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
xapp.Logger.Error("Failed to get ueMetrics from Redis!")
|
|
||||||
log.Printf("Failed to get ueMetrics from Redis!")
|
|
||||||
} else {
|
|
||||||
if retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)] != nil {
|
|
||||||
ueJsonStr := retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)].(string)
|
|
||||||
json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//if isUeExist, _ := c.client.Exists("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
|
// retStr, err := c.sdl.Get([]string{"{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)})
|
||||||
// ueJsonStr, _ := c.client.Get("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result()
|
// if err != nil {
|
||||||
|
// panic(err)
|
||||||
|
// xapp.Logger.Error("Failed to get ueMetrics from Redis!")
|
||||||
|
// log.Printf("Failed to get ueMetrics from Redis!")
|
||||||
|
// } else {
|
||||||
|
// if retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)] != nil {
|
||||||
|
// ueJsonStr := retStr["{TS-UE-metrics},"+strconv.FormatInt(ueID, 10)].(string)
|
||||||
// json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
// json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
||||||
//}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
ueMetrics.UeID = ueID
|
// //if isUeExist, _ := c.client.Exists("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result(); isUeExist == 1 {
|
||||||
log.Printf("UeID: %d", ueMetrics.UeID)
|
// // ueJsonStr, _ := c.client.Get("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10)).Result()
|
||||||
ueMetrics.ServingCellID = servingCellID
|
// // json.Unmarshal([]byte(ueJsonStr), &ueMetrics)
|
||||||
log.Printf("ServingCellID: %s", ueMetrics.ServingCellID)
|
// //}
|
||||||
|
|
||||||
if flag {
|
// ueMetrics.UeID = ueID
|
||||||
timestampPDCPBytes = timestamp
|
// log.Printf("UeID: %d", ueMetrics.UeID)
|
||||||
}
|
// ueMetrics.ServingCellID = servingCellID
|
||||||
|
// log.Printf("ServingCellID: %s", ueMetrics.ServingCellID)
|
||||||
|
|
||||||
ueMetrics.MeasTimestampPDCPBytes.TVsec = timestamp.TVsec
|
// if flag {
|
||||||
ueMetrics.MeasTimestampPDCPBytes.TVnsec = timestamp.TVnsec
|
// timestampPDCPBytes = timestamp
|
||||||
|
// }
|
||||||
|
|
||||||
if ueResourceReportItem.PDCPBytesDL != nil {
|
// ueMetrics.MeasTimestampPDCPBytes.TVsec = timestamp.TVsec
|
||||||
ueMetrics.PDCPBytesDL, err = e2sm.ParseInteger(ueResourceReportItem.PDCPBytesDL.Buf, ueResourceReportItem.PDCPBytesDL.Size)
|
// ueMetrics.MeasTimestampPDCPBytes.TVnsec = timestamp.TVnsec
|
||||||
if err != nil {
|
|
||||||
xapp.Logger.Error("Failed to parse PDCPBytesDL in CU-UP Usage Report with UE ID [%d]: %v", ueID, err)
|
|
||||||
log.Printf("Failed to parse PDCPBytesDL in CU-UP Usage Report with UE ID [%d]: %v", ueID, err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ueResourceReportItem.PDCPBytesUL != nil {
|
// if ueResourceReportItem.PDCPBytesDL != nil {
|
||||||
ueMetrics.PDCPBytesUL, err = e2sm.ParseInteger(ueResourceReportItem.PDCPBytesUL.Buf, ueResourceReportItem.PDCPBytesUL.Size)
|
// ueMetrics.PDCPBytesDL, err = e2sm.ParseInteger(ueResourceReportItem.PDCPBytesDL.Buf, ueResourceReportItem.PDCPBytesDL.Size)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
xapp.Logger.Error("Failed to parse PDCPBytesUL in CU-UP Usage Report with UE ID [%d]: %v", ueID, err)
|
// xapp.Logger.Error("Failed to parse PDCPBytesDL in CU-UP Usage Report with UE ID [%d]: %v", ueID, err)
|
||||||
log.Printf("Failed to parse PDCPBytesUL in CU-UP Usage Report with UE ID [%d]: %v", ueID, err)
|
// log.Printf("Failed to parse PDCPBytesDL in CU-UP Usage Report with UE ID [%d]: %v", ueID, err)
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
newUeJsonStr, err := json.Marshal(&ueMetrics)
|
// if ueResourceReportItem.PDCPBytesUL != nil {
|
||||||
if err != nil {
|
// ueMetrics.PDCPBytesUL, err = e2sm.ParseInteger(ueResourceReportItem.PDCPBytesUL.Buf, ueResourceReportItem.PDCPBytesUL.Size)
|
||||||
xapp.Logger.Error("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
// if err != nil {
|
||||||
log.Printf("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
// xapp.Logger.Error("Failed to parse PDCPBytesUL in CU-UP Usage Report with UE ID [%d]: %v", ueID, err)
|
||||||
continue
|
// log.Printf("Failed to parse PDCPBytesUL in CU-UP Usage Report with UE ID [%d]: %v", ueID, err)
|
||||||
}
|
// continue
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
err = c.sdl.Set("{TS-UE-metrics},"+strconv.FormatInt(ueID, 10), newUeJsonStr)
|
// newUeJsonStr, err := json.Marshal(&ueMetrics)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// xapp.Logger.Error("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
||||||
log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// log.Printf("Failed to marshal UeMetrics with UE ID [%d]: %v", ueID, err)
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
|
|
||||||
//err = c.client.Set("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
|
// err = c.sdl.Set("{TS-UE-metrics},"+strconv.FormatInt(ueID, 10), newUeJsonStr)
|
||||||
//if err != nil {
|
// if err != nil {
|
||||||
// xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
// log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
// log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
// continue
|
// continue
|
||||||
//}
|
// }
|
||||||
}
|
|
||||||
}
|
// //err = c.client.Set("{TS-UE-metrics}," + strconv.FormatInt(ueID, 10), newUeJsonStr, 0).Err()
|
||||||
} else {
|
// //if err != nil {
|
||||||
xapp.Logger.Error("Unknown PF Container Type: %d", containerType)
|
// // xapp.Logger.Error("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
log.Printf("Unknown PF Container Type: %d", containerType)
|
// // log.Printf("Failed to set UeMetrics into redis with UE ID [%d]: %v", ueID, err)
|
||||||
continue
|
// // continue
|
||||||
}
|
// //}
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// xapp.Logger.Error("Unknown PF Container Type: %d", containerType)
|
||||||
|
// log.Printf("Unknown PF Container Type: %d", containerType)
|
||||||
|
// continue
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
if flag {
|
if flag {
|
||||||
|
@ -21,9 +21,9 @@ package control
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <e2ap/wrapper.h>
|
#include <libe2proto/wrapper.h>
|
||||||
#cgo LDFLAGS: -le2apwrapper
|
#cgo LDFLAGS: -le2proto -lm
|
||||||
#cgo CFLAGS: -I/usr/local/include/e2ap
|
#cgo CFLAGS: -I/usr/local/include/libe2proto
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ func (c *E2ap) GetSubscriptionRequestSequenceNumber(payload []byte) (subId uint1
|
|||||||
cptr := unsafe.Pointer(&payload[0])
|
cptr := unsafe.Pointer(&payload[0])
|
||||||
cret := C.e2ap_get_ric_subscription_request_sequence_number(cptr, C.size_t(len(payload)))
|
cret := C.e2ap_get_ric_subscription_request_sequence_number(cptr, C.size_t(len(payload)))
|
||||||
if cret < 0 {
|
if cret < 0 {
|
||||||
return 0, errors.New("e2ap wrapper is unable to get Subscirption Request Sequence Number due to wrong or invalid payload")
|
return 0, errors.New("e2ap wrapper is unable to get Subscription Request Sequence Number due to wrong or invalid payload")
|
||||||
}
|
}
|
||||||
subId = uint16(cret)
|
subId = uint16(cret)
|
||||||
return
|
return
|
||||||
|
446
control/e2sm.go
446
control/e2sm.go
@ -20,9 +20,9 @@
|
|||||||
package control
|
package control
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#include <e2sm/wrapper.h>
|
#include <libe2proto/wrapper.h>
|
||||||
#cgo LDFLAGS: -le2smwrapper
|
#cgo LDFLAGS: -le2proto -lm
|
||||||
#cgo CFLAGS: -I/usr/local/include/e2sm
|
#cgo CFLAGS: -I/usr/local/include/libe2proto
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
@ -72,8 +72,9 @@ func (c *E2sm) GetIndicationHeader(buffer []byte) (indHdr *IndicationHeader, err
|
|||||||
indHdrFormat1 := &IndicationHeaderFormat1{}
|
indHdrFormat1 := &IndicationHeaderFormat1{}
|
||||||
indHdrFormat1_C := *(**C.E2SM_KPM_IndicationHeader_Format1_t)(unsafe.Pointer(&decodedHdr.choice[0]))
|
indHdrFormat1_C := *(**C.E2SM_KPM_IndicationHeader_Format1_t)(unsafe.Pointer(&decodedHdr.choice[0]))
|
||||||
|
|
||||||
if indHdrFormat1_C.id_GlobalKPMnode_ID != nil {
|
// Decode and analysis of GlobalE2node_ID
|
||||||
globalKPMnodeID_C := (*C.GlobalKPMnode_ID_t)(indHdrFormat1_C.id_GlobalKPMnode_ID)
|
if uintptr(unsafe.Pointer(&indHdrFormat1_C.id_GlobalE2node_ID)) != uintptr(0) {
|
||||||
|
globalKPMnodeID_C := (C.GlobalE2node_ID_t)(indHdrFormat1_C.id_GlobalE2node_ID)
|
||||||
|
|
||||||
indHdrFormat1.GlobalKPMnodeIDType = int32(globalKPMnodeID_C.present)
|
indHdrFormat1.GlobalKPMnodeIDType = int32(globalKPMnodeID_C.present)
|
||||||
if indHdrFormat1.GlobalKPMnodeIDType == 1 {
|
if indHdrFormat1.GlobalKPMnodeIDType == 1 {
|
||||||
@ -226,118 +227,126 @@ func (c *E2sm) GetIndicationHeader(buffer []byte) (indHdr *IndicationHeader, err
|
|||||||
indHdrFormat1.GlobalKPMnodeIDType = 0
|
indHdrFormat1.GlobalKPMnodeIDType = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if indHdrFormat1_C.nRCGI != nil {
|
// Decode and analysis of CollectionStartTime
|
||||||
indHdrFormat1.NRCGI = &NRCGIType{}
|
if uintptr(unsafe.Pointer(&indHdrFormat1_C.collectionStartTime)) != uintptr(0) {
|
||||||
|
indHdrFormat1.CollectionStartTime = &OctetString{}
|
||||||
|
|
||||||
plmnID := indHdrFormat1_C.nRCGI.pLMN_Identity
|
indHdrFormat1.CollectionStartTime.Buf = C.GoBytes(unsafe.Pointer(indHdrFormat1_C.collectionStartTime.buf), C.int(indHdrFormat1_C.collectionStartTime.size))
|
||||||
indHdrFormat1.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID.buf), C.int(plmnID.size))
|
indHdrFormat1.CollectionStartTime.Size = int(indHdrFormat1_C.collectionStartTime.size)
|
||||||
indHdrFormat1.NRCGI.PlmnID.Size = int(plmnID.size)
|
|
||||||
|
|
||||||
nRCellID := indHdrFormat1_C.nRCGI.nRCellIdentity
|
|
||||||
indHdrFormat1.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(nRCellID.buf), C.int(nRCellID.size))
|
|
||||||
indHdrFormat1.NRCGI.NRCellID.Size = int(nRCellID.size)
|
|
||||||
indHdrFormat1.NRCGI.NRCellID.BitsUnused = int(nRCellID.bits_unused)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if indHdrFormat1_C.pLMN_Identity != nil {
|
// if indHdrFormat1_C.nRCGI != nil {
|
||||||
indHdrFormat1.PlmnID = &OctetString{}
|
// indHdrFormat1.NRCGI = &NRCGIType{}
|
||||||
|
|
||||||
indHdrFormat1.PlmnID.Buf = C.GoBytes(unsafe.Pointer(indHdrFormat1_C.pLMN_Identity.buf), C.int(indHdrFormat1_C.pLMN_Identity.size))
|
// plmnID := indHdrFormat1_C.nRCGI.pLMN_Identity
|
||||||
indHdrFormat1.PlmnID.Size = int(indHdrFormat1_C.pLMN_Identity.size)
|
// indHdrFormat1.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID.buf), C.int(plmnID.size))
|
||||||
}
|
// indHdrFormat1.NRCGI.PlmnID.Size = int(plmnID.size)
|
||||||
|
|
||||||
if indHdrFormat1_C.sliceID != nil {
|
// nRCellID := indHdrFormat1_C.nRCGI.nRCellIdentity
|
||||||
indHdrFormat1.SliceID = &SliceIDType{}
|
// indHdrFormat1.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(nRCellID.buf), C.int(nRCellID.size))
|
||||||
|
// indHdrFormat1.NRCGI.NRCellID.Size = int(nRCellID.size)
|
||||||
|
// indHdrFormat1.NRCGI.NRCellID.BitsUnused = int(nRCellID.bits_unused)
|
||||||
|
// }
|
||||||
|
|
||||||
sST := indHdrFormat1_C.sliceID.sST
|
// if indHdrFormat1_C.pLMN_Identity != nil {
|
||||||
indHdrFormat1.SliceID.SST.Buf = C.GoBytes(unsafe.Pointer(sST.buf), C.int(sST.size))
|
// indHdrFormat1.PlmnID = &OctetString{}
|
||||||
indHdrFormat1.SliceID.SST.Size = int(sST.size)
|
|
||||||
|
|
||||||
if indHdrFormat1_C.sliceID.sD != nil {
|
// indHdrFormat1.PlmnID.Buf = C.GoBytes(unsafe.Pointer(indHdrFormat1_C.pLMN_Identity.buf), C.int(indHdrFormat1_C.pLMN_Identity.size))
|
||||||
indHdrFormat1.SliceID.SD = &OctetString{}
|
// indHdrFormat1.PlmnID.Size = int(indHdrFormat1_C.pLMN_Identity.size)
|
||||||
|
// }
|
||||||
|
|
||||||
sD := indHdrFormat1_C.sliceID.sD
|
// if indHdrFormat1_C.sliceID != nil {
|
||||||
indHdrFormat1.SliceID.SD.Buf = C.GoBytes(unsafe.Pointer(sD.buf), C.int(sD.size))
|
// indHdrFormat1.SliceID = &SliceIDType{}
|
||||||
indHdrFormat1.SliceID.SD.Size = int(sD.size)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if indHdrFormat1_C.fiveQI != nil {
|
// sST := indHdrFormat1_C.sliceID.sST
|
||||||
indHdrFormat1.FiveQI = int64(*indHdrFormat1_C.fiveQI)
|
// indHdrFormat1.SliceID.SST.Buf = C.GoBytes(unsafe.Pointer(sST.buf), C.int(sST.size))
|
||||||
} else {
|
// indHdrFormat1.SliceID.SST.Size = int(sST.size)
|
||||||
indHdrFormat1.FiveQI = -1
|
|
||||||
}
|
|
||||||
|
|
||||||
if indHdrFormat1_C.qci != nil {
|
// if indHdrFormat1_C.sliceID.sD != nil {
|
||||||
indHdrFormat1.Qci = int64(*indHdrFormat1_C.qci)
|
// indHdrFormat1.SliceID.SD = &OctetString{}
|
||||||
} else {
|
|
||||||
indHdrFormat1.Qci = -1
|
|
||||||
}
|
|
||||||
|
|
||||||
if indHdrFormat1_C.message_Type != nil {
|
// sD := indHdrFormat1_C.sliceID.sD
|
||||||
indHdrFormat1.UeMessageType = int32(*indHdrFormat1_C.message_Type)
|
// indHdrFormat1.SliceID.SD.Buf = C.GoBytes(unsafe.Pointer(sD.buf), C.int(sD.size))
|
||||||
} else {
|
// indHdrFormat1.SliceID.SD.Size = int(sD.size)
|
||||||
indHdrFormat1.UeMessageType = -1
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if indHdrFormat1_C.gNB_DU_ID != nil {
|
// if indHdrFormat1_C.fiveQI != nil {
|
||||||
indHdrFormat1.GnbDUID = &Integer{}
|
// indHdrFormat1.FiveQI = int64(*indHdrFormat1_C.fiveQI)
|
||||||
|
// } else {
|
||||||
|
// indHdrFormat1.FiveQI = -1
|
||||||
|
// }
|
||||||
|
|
||||||
indHdrFormat1.GnbDUID.Buf = C.GoBytes(unsafe.Pointer(indHdrFormat1_C.gNB_DU_ID.buf), C.int(indHdrFormat1_C.gNB_DU_ID.size))
|
// if indHdrFormat1_C.qci != nil {
|
||||||
indHdrFormat1.GnbDUID.Size = int(indHdrFormat1_C.gNB_DU_ID.size)
|
// indHdrFormat1.Qci = int64(*indHdrFormat1_C.qci)
|
||||||
}
|
// } else {
|
||||||
|
// indHdrFormat1.Qci = -1
|
||||||
|
// }
|
||||||
|
|
||||||
if indHdrFormat1_C.gNB_Name != nil {
|
// if indHdrFormat1_C.message_Type != nil {
|
||||||
indHdrFormat1.GnbNameType = int32(indHdrFormat1_C.gNB_Name.present)
|
// indHdrFormat1.UeMessageType = int32(*indHdrFormat1_C.message_Type)
|
||||||
if indHdrFormat1.GnbNameType == 1 {
|
// } else {
|
||||||
gNBName := &GNB_DU_Name{}
|
// indHdrFormat1.UeMessageType = -1
|
||||||
gNBName_C := (*C.GNB_DU_Name_t)(unsafe.Pointer(&indHdrFormat1_C.gNB_Name.choice[0]))
|
// }
|
||||||
|
|
||||||
gNBName.Buf = C.GoBytes(unsafe.Pointer(gNBName_C.buf), C.int(gNBName_C.size))
|
// if indHdrFormat1_C.gNB_DU_ID != nil {
|
||||||
gNBName.Size = int(gNBName_C.size)
|
// indHdrFormat1.GnbDUID = &Integer{}
|
||||||
|
|
||||||
indHdrFormat1.GnbName = gNBName
|
// indHdrFormat1.GnbDUID.Buf = C.GoBytes(unsafe.Pointer(indHdrFormat1_C.gNB_DU_ID.buf), C.int(indHdrFormat1_C.gNB_DU_ID.size))
|
||||||
} else if indHdrFormat1.GnbNameType == 2 {
|
// indHdrFormat1.GnbDUID.Size = int(indHdrFormat1_C.gNB_DU_ID.size)
|
||||||
gNBName := &GNB_CU_CP_Name{}
|
// }
|
||||||
gNBName_C := (*C.GNB_CU_CP_Name_t)(unsafe.Pointer(&indHdrFormat1_C.gNB_Name.choice[0]))
|
|
||||||
|
|
||||||
gNBName.Buf = C.GoBytes(unsafe.Pointer(gNBName_C.buf), C.int(gNBName_C.size))
|
// if indHdrFormat1_C.gNB_Name != nil {
|
||||||
gNBName.Size = int(gNBName_C.size)
|
// indHdrFormat1.GnbNameType = int32(indHdrFormat1_C.gNB_Name.present)
|
||||||
|
// if indHdrFormat1.GnbNameType == 1 {
|
||||||
|
// gNBName := &GNB_DU_Name{}
|
||||||
|
// gNBName_C := (*C.GNB_DU_Name_t)(unsafe.Pointer(&indHdrFormat1_C.gNB_Name.choice[0]))
|
||||||
|
|
||||||
indHdrFormat1.GnbName = gNBName
|
// gNBName.Buf = C.GoBytes(unsafe.Pointer(gNBName_C.buf), C.int(gNBName_C.size))
|
||||||
} else if indHdrFormat1.GnbNameType == 3 {
|
// gNBName.Size = int(gNBName_C.size)
|
||||||
gNBName := &GNB_CU_UP_Name{}
|
|
||||||
gNBName_C := (*C.GNB_CU_UP_Name_t)(unsafe.Pointer(&indHdrFormat1_C.gNB_Name.choice[0]))
|
|
||||||
|
|
||||||
gNBName.Buf = C.GoBytes(unsafe.Pointer(gNBName_C.buf), C.int(gNBName_C.size))
|
// indHdrFormat1.GnbName = gNBName
|
||||||
gNBName.Size = int(gNBName_C.size)
|
// } else if indHdrFormat1.GnbNameType == 2 {
|
||||||
|
// gNBName := &GNB_CU_CP_Name{}
|
||||||
|
// gNBName_C := (*C.GNB_CU_CP_Name_t)(unsafe.Pointer(&indHdrFormat1_C.gNB_Name.choice[0]))
|
||||||
|
|
||||||
indHdrFormat1.GnbName = gNBName
|
// gNBName.Buf = C.GoBytes(unsafe.Pointer(gNBName_C.buf), C.int(gNBName_C.size))
|
||||||
}
|
// gNBName.Size = int(gNBName_C.size)
|
||||||
} else {
|
|
||||||
indHdrFormat1.GnbNameType = -1
|
|
||||||
}
|
|
||||||
|
|
||||||
if indHdrFormat1_C.global_GNB_ID != nil {
|
// indHdrFormat1.GnbName = gNBName
|
||||||
indHdrFormat1.GlobalgNBID = &GlobalgNBIDType{}
|
// } else if indHdrFormat1.GnbNameType == 3 {
|
||||||
|
// gNBName := &GNB_CU_UP_Name{}
|
||||||
|
// gNBName_C := (*C.GNB_CU_UP_Name_t)(unsafe.Pointer(&indHdrFormat1_C.gNB_Name.choice[0]))
|
||||||
|
|
||||||
plmnID_C := indHdrFormat1_C.global_GNB_ID.plmn_id
|
// gNBName.Buf = C.GoBytes(unsafe.Pointer(gNBName_C.buf), C.int(gNBName_C.size))
|
||||||
indHdrFormat1.GlobalgNBID.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID_C.buf), C.int(plmnID_C.size))
|
// gNBName.Size = int(gNBName_C.size)
|
||||||
indHdrFormat1.GlobalgNBID.PlmnID.Size = int(plmnID_C.size)
|
|
||||||
|
|
||||||
globalgNBID_gNBID_C := indHdrFormat1_C.global_GNB_ID.gnb_id
|
// indHdrFormat1.GnbName = gNBName
|
||||||
indHdrFormat1.GlobalgNBID.GnbIDType = int(globalgNBID_gNBID_C.present)
|
// }
|
||||||
if indHdrFormat1.GlobalgNBID.GnbIDType == 1 {
|
// } else {
|
||||||
gNBID := &GNBID{}
|
// indHdrFormat1.GnbNameType = -1
|
||||||
gNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globalgNBID_gNBID_C.choice[0]))
|
// }
|
||||||
|
|
||||||
gNBID.Buf = C.GoBytes(unsafe.Pointer(gNBID_C.buf), C.int(gNBID_C.size))
|
// if indHdrFormat1_C.global_GNB_ID != nil {
|
||||||
gNBID.Size = int(gNBID_C.size)
|
// indHdrFormat1.GlobalgNBID = &GlobalgNBIDType{}
|
||||||
gNBID.BitsUnused = int(gNBID_C.bits_unused)
|
|
||||||
|
|
||||||
indHdrFormat1.GlobalgNBID.GnbID = gNBID
|
// plmnID_C := indHdrFormat1_C.global_GNB_ID.plmn_id
|
||||||
}
|
// indHdrFormat1.GlobalgNBID.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID_C.buf), C.int(plmnID_C.size))
|
||||||
}
|
// indHdrFormat1.GlobalgNBID.PlmnID.Size = int(plmnID_C.size)
|
||||||
|
|
||||||
|
// globalgNBID_gNBID_C := indHdrFormat1_C.global_GNB_ID.gnb_id
|
||||||
|
// indHdrFormat1.GlobalgNBID.GnbIDType = int(globalgNBID_gNBID_C.present)
|
||||||
|
// if indHdrFormat1.GlobalgNBID.GnbIDType == 1 {
|
||||||
|
// gNBID := &GNBID{}
|
||||||
|
// gNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globalgNBID_gNBID_C.choice[0]))
|
||||||
|
|
||||||
|
// gNBID.Buf = C.GoBytes(unsafe.Pointer(gNBID_C.buf), C.int(gNBID_C.size))
|
||||||
|
// gNBID.Size = int(gNBID_C.size)
|
||||||
|
// gNBID.BitsUnused = int(gNBID_C.bits_unused)
|
||||||
|
|
||||||
|
// indHdrFormat1.GlobalgNBID.GnbID = gNBID
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
indHdr.IndHdr = indHdrFormat1
|
indHdr.IndHdr = indHdrFormat1
|
||||||
} else {
|
} else {
|
||||||
@ -350,19 +359,19 @@ func (c *E2sm) GetIndicationHeader(buffer []byte) (indHdr *IndicationHeader, err
|
|||||||
func (c *E2sm) GetIndicationMessage(buffer []byte) (indMsg *IndicationMessage, err error) {
|
func (c *E2sm) GetIndicationMessage(buffer []byte) (indMsg *IndicationMessage, err error) {
|
||||||
cptr := unsafe.Pointer(&buffer[0])
|
cptr := unsafe.Pointer(&buffer[0])
|
||||||
indMsg = &IndicationMessage{}
|
indMsg = &IndicationMessage{}
|
||||||
decodedMsg := C.e2sm_decode_ric_indication_message(cptr, C.size_t(len(buffer)))
|
decodedIndicationMsg := C.e2sm_decode_ric_indication_message(cptr, C.size_t(len(buffer)))
|
||||||
if decodedMsg == nil {
|
if decodedIndicationMsg == nil {
|
||||||
return indMsg, errors.New("e2sm wrapper is unable to get IndicationMessage due to wrong or invalid input")
|
return indMsg, errors.New("e2sm wrapper is unable to get IndicationMessage due to wrong or invalid input")
|
||||||
}
|
}
|
||||||
defer C.e2sm_free_ric_indication_message(decodedMsg)
|
defer C.e2sm_free_ric_indication_message(decodedIndicationMsg)
|
||||||
|
|
||||||
indMsg.StyleType = int64(decodedMsg.ric_Style_Type)
|
// indMsg.StyleType = int64(decodedIndicationMsg.ric_Style_Type)
|
||||||
|
|
||||||
indMsg.IndMsgType = int32(decodedMsg.indicationMessage.present)
|
indMsg.IndMsgType = int32(decodedIndicationMsg.present)
|
||||||
|
|
||||||
if indMsg.IndMsgType == 1 {
|
if indMsg.IndMsgType == 1 {
|
||||||
indMsgFormat1 := &IndicationMessageFormat1{}
|
indMsgFormat1 := &IndicationMessageFormat1{}
|
||||||
indMsgFormat1_C := *(**C.E2SM_KPM_IndicationMessage_Format1_t)(unsafe.Pointer(&decodedMsg.indicationMessage.choice[0]))
|
indMsgFormat1_C := *(**C.E2SM_KPM_IndicationMessage_Format1_t)(unsafe.Pointer(&decodedIndicationMsg.choice[0]))
|
||||||
|
|
||||||
indMsgFormat1.PMContainerCount = int(indMsgFormat1_C.pm_Containers.list.count)
|
indMsgFormat1.PMContainerCount = int(indMsgFormat1_C.pm_Containers.list.count)
|
||||||
for i := 0; i < indMsgFormat1.PMContainerCount; i++ {
|
for i := 0; i < indMsgFormat1.PMContainerCount; i++ {
|
||||||
@ -461,11 +470,11 @@ func (c *E2sm) GetIndicationMessage(buffer []byte) (indMsg *IndicationMessage, e
|
|||||||
duPMEPC := &DUPMEPCContainerType{}
|
duPMEPC := &DUPMEPCContainerType{}
|
||||||
duPMEPC_C := (*C.EPC_DU_PM_Container_t)(servedPlmnPerCell_C.du_PM_EPC)
|
duPMEPC_C := (*C.EPC_DU_PM_Container_t)(servedPlmnPerCell_C.du_PM_EPC)
|
||||||
|
|
||||||
duPMEPC.PerQCIReportCount = int(duPMEPC_C.perQCIReportList.list.count)
|
duPMEPC.PerQCIReportCount = int(duPMEPC_C.perQCIReportList_du.list.count)
|
||||||
for l := 0; l < duPMEPC.PerQCIReportCount; l++ {
|
for l := 0; l < duPMEPC.PerQCIReportCount; l++ {
|
||||||
perQCIReport := &duPMEPC.PerQCIReports[l]
|
perQCIReport := &duPMEPC.PerQCIReports[l]
|
||||||
var sizeof_PerQCIReportListItem_t *C.PerQCIReportListItem_t
|
var sizeof_PerQCIReportListItem_t *C.PerQCIReportListItem_t
|
||||||
perQCIReport_C := *(**C.PerQCIReportListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(duPMEPC_C.perQCIReportList.list.array)) + (uintptr)(l)*unsafe.Sizeof(sizeof_PerQCIReportListItem_t)))
|
perQCIReport_C := *(**C.PerQCIReportListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(duPMEPC_C.perQCIReportList_du.list.array)) + (uintptr)(l)*unsafe.Sizeof(sizeof_PerQCIReportListItem_t)))
|
||||||
|
|
||||||
perQCIReport.QCI = int64(perQCIReport_C.qci)
|
perQCIReport.QCI = int64(perQCIReport_C.qci)
|
||||||
|
|
||||||
@ -492,11 +501,11 @@ func (c *E2sm) GetIndicationMessage(buffer []byte) (indMsg *IndicationMessage, e
|
|||||||
oCU_CP_PF := &OCUCPPFContainerType{}
|
oCU_CP_PF := &OCUCPPFContainerType{}
|
||||||
oCU_CP_PF_C := *(**C.OCUCP_PF_Container_t)(unsafe.Pointer(&pmContainer_C.performanceContainer.choice[0]))
|
oCU_CP_PF_C := *(**C.OCUCP_PF_Container_t)(unsafe.Pointer(&pmContainer_C.performanceContainer.choice[0]))
|
||||||
|
|
||||||
if oCU_CP_PF_C.gNB_CU_CP_Name != nil {
|
// if oCU_CP_PF_C.gNB_CU_CP_Name != nil {
|
||||||
oCU_CP_PF.GNBCUCPName = &PrintableString{}
|
// oCU_CP_PF.GNBCUCPName = &PrintableString{}
|
||||||
oCU_CP_PF.GNBCUCPName.Buf = C.GoBytes(unsafe.Pointer(oCU_CP_PF_C.gNB_CU_CP_Name.buf), C.int(oCU_CP_PF_C.gNB_CU_CP_Name.size))
|
// oCU_CP_PF.GNBCUCPName.Buf = C.GoBytes(unsafe.Pointer(oCU_CP_PF_C.gNB_CU_CP_Name.buf), C.int(oCU_CP_PF_C.gNB_CU_CP_Name.size))
|
||||||
oCU_CP_PF.GNBCUCPName.Size = int(oCU_CP_PF_C.gNB_CU_CP_Name.size)
|
// oCU_CP_PF.GNBCUCPName.Size = int(oCU_CP_PF_C.gNB_CU_CP_Name.size)
|
||||||
}
|
// }
|
||||||
|
|
||||||
if oCU_CP_PF_C.cu_CP_Resource_Status.numberOfActive_UEs != nil {
|
if oCU_CP_PF_C.cu_CP_Resource_Status.numberOfActive_UEs != nil {
|
||||||
oCU_CP_PF.CUCPResourceStatus.NumberOfActiveUEs = int64(*oCU_CP_PF_C.cu_CP_Resource_Status.numberOfActive_UEs)
|
oCU_CP_PF.CUCPResourceStatus.NumberOfActiveUEs = int64(*oCU_CP_PF_C.cu_CP_Resource_Status.numberOfActive_UEs)
|
||||||
@ -507,11 +516,11 @@ func (c *E2sm) GetIndicationMessage(buffer []byte) (indMsg *IndicationMessage, e
|
|||||||
oCU_UP_PF := &OCUUPPFContainerType{}
|
oCU_UP_PF := &OCUUPPFContainerType{}
|
||||||
oCU_UP_PF_C := *(**C.OCUUP_PF_Container_t)(unsafe.Pointer(&pmContainer_C.performanceContainer.choice[0]))
|
oCU_UP_PF_C := *(**C.OCUUP_PF_Container_t)(unsafe.Pointer(&pmContainer_C.performanceContainer.choice[0]))
|
||||||
|
|
||||||
if oCU_UP_PF_C.gNB_CU_UP_Name != nil {
|
// if oCU_UP_PF_C.gNB_CU_UP_Name != nil {
|
||||||
oCU_UP_PF.GNBCUUPName = &PrintableString{}
|
// oCU_UP_PF.GNBCUUPName = &PrintableString{}
|
||||||
oCU_UP_PF.GNBCUUPName.Buf = C.GoBytes(unsafe.Pointer(oCU_UP_PF_C.gNB_CU_UP_Name.buf), C.int(oCU_UP_PF_C.gNB_CU_UP_Name.size))
|
// oCU_UP_PF.GNBCUUPName.Buf = C.GoBytes(unsafe.Pointer(oCU_UP_PF_C.gNB_CU_UP_Name.buf), C.int(oCU_UP_PF_C.gNB_CU_UP_Name.size))
|
||||||
oCU_UP_PF.GNBCUUPName.Size = int(oCU_UP_PF_C.gNB_CU_UP_Name.size)
|
// oCU_UP_PF.GNBCUUPName.Size = int(oCU_UP_PF_C.gNB_CU_UP_Name.size)
|
||||||
}
|
// }
|
||||||
|
|
||||||
oCU_UP_PF.CUUPPFContainerItemCount = int(oCU_UP_PF_C.pf_ContainerList.list.count)
|
oCU_UP_PF.CUUPPFContainerItemCount = int(oCU_UP_PF_C.pf_ContainerList.list.count)
|
||||||
for j := 0; j < oCU_UP_PF.CUUPPFContainerItemCount; j++ {
|
for j := 0; j < oCU_UP_PF.CUUPPFContainerItemCount; j++ {
|
||||||
@ -578,13 +587,13 @@ func (c *E2sm) GetIndicationMessage(buffer []byte) (indMsg *IndicationMessage, e
|
|||||||
cuUPPMEPC := &CUUPPMEPCType{}
|
cuUPPMEPC := &CUUPPMEPCType{}
|
||||||
cuUPPMEPC_C := (*C.EPC_CUUP_PM_Format_t)(cuUPPlmn_C.cu_UP_PM_EPC)
|
cuUPPMEPC_C := (*C.EPC_CUUP_PM_Format_t)(cuUPPlmn_C.cu_UP_PM_EPC)
|
||||||
|
|
||||||
cuUPPMEPC.CUUPPMEPCPerQCIReportCount = int(cuUPPMEPC_C.perQCIReportList.list.count)
|
cuUPPMEPC.CUUPPMEPCPerQCIReportCount = int(cuUPPMEPC_C.perQCIReportList_cuup.list.count)
|
||||||
for l := 0; l < cuUPPMEPC.CUUPPMEPCPerQCIReportCount; l++ {
|
for l := 0; l < cuUPPMEPC.CUUPPMEPCPerQCIReportCount; l++ {
|
||||||
perQCIReport := &cuUPPMEPC.CUUPPMEPCPerQCIReports[l]
|
perQCIReport := &cuUPPMEPC.CUUPPMEPCPerQCIReports[l]
|
||||||
var sizeof_PerQCIReportListItemFormat_t *C.PerQCIReportListItemFormat_t
|
var sizeof_PerQCIReportListItemFormat_t *C.PerQCIReportListItemFormat_t
|
||||||
perQCIReport_C := *(**C.PerQCIReportListItemFormat_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cuUPPMEPC_C.perQCIReportList.list.array)) + (uintptr)(l)*unsafe.Sizeof(sizeof_PerQCIReportListItemFormat_t)))
|
perQCIReport_C := *(**C.PerQCIReportListItemFormat_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cuUPPMEPC_C.perQCIReportList_cuup.list.array)) + (uintptr)(l)*unsafe.Sizeof(sizeof_PerQCIReportListItemFormat_t)))
|
||||||
|
|
||||||
perQCIReport.QCI = int64(perQCIReport_C.qci)
|
perQCIReport.QCI = int64(perQCIReport_C.drbqci)
|
||||||
|
|
||||||
if perQCIReport_C.pDCPBytesDL != nil {
|
if perQCIReport_C.pDCPBytesDL != nil {
|
||||||
perQCIReport.PDCPBytesDL = &Integer{}
|
perQCIReport.PDCPBytesDL = &Integer{}
|
||||||
@ -615,137 +624,138 @@ func (c *E2sm) GetIndicationMessage(buffer []byte) (indMsg *IndicationMessage, e
|
|||||||
if pmContainer_C.theRANContainer != nil {
|
if pmContainer_C.theRANContainer != nil {
|
||||||
ranContainer := &RANContainerType{}
|
ranContainer := &RANContainerType{}
|
||||||
|
|
||||||
ranContainer.Timestamp.Buf = C.GoBytes(unsafe.Pointer(pmContainer_C.theRANContainer.timestamp.buf), C.int(pmContainer_C.theRANContainer.timestamp.size))
|
// TODO: parse correctly Octect String
|
||||||
ranContainer.Timestamp.Size = int(pmContainer_C.theRANContainer.timestamp.size)
|
// ranContainer.Buf = C.GoBytes(unsafe.Pointer(pmContainer_C.theRANContainer), C.int(pmContainer_C.theRANContainer.size))
|
||||||
|
// ranContainer.Size = int(pmContainer_C.theRANContainer.size)
|
||||||
|
|
||||||
ranContainer.ContainerType = int32(pmContainer_C.theRANContainer.reportContainer.present)
|
// ranContainer.ContainerType = int32(pmContainer_C.theRANContainer.reportContainer.present)
|
||||||
|
|
||||||
if ranContainer.ContainerType == 1 {
|
// if ranContainer.ContainerType == 1 {
|
||||||
oDU_UE := &DUUsageReportType{}
|
// oDU_UE := &DUUsageReportType{}
|
||||||
oDU_UE_C := *(**C.DU_Usage_Report_Per_UE_t)(unsafe.Pointer(&pmContainer_C.theRANContainer.reportContainer.choice[0]))
|
// oDU_UE_C := *(**C.DU_Usage_Report_Per_UE_t)(unsafe.Pointer(&pmContainer_C.theRANContainer.reportContainer.choice[0]))
|
||||||
|
|
||||||
oDU_UE.CellResourceReportItemCount = int(oDU_UE_C.cellResourceReportList.list.count)
|
// oDU_UE.CellResourceReportItemCount = int(oDU_UE_C.cellResourceReportList.list.count)
|
||||||
for j := 0; j < oDU_UE.CellResourceReportItemCount; j++ {
|
// for j := 0; j < oDU_UE.CellResourceReportItemCount; j++ {
|
||||||
cellResourceReport := &oDU_UE.CellResourceReportItems[j]
|
// cellResourceReport := &oDU_UE.CellResourceReportItems[j]
|
||||||
var sizeof_DU_Usage_Report_CellResourceReportItem_t *C.DU_Usage_Report_CellResourceReportItem_t
|
// var sizeof_DU_Usage_Report_CellResourceReportItem_t *C.DU_Usage_Report_CellResourceReportItem_t
|
||||||
cellResourceReport_C := *(**C.DU_Usage_Report_CellResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(oDU_UE_C.cellResourceReportList.list.array)) + (uintptr)(j)*unsafe.Sizeof(sizeof_DU_Usage_Report_CellResourceReportItem_t)))
|
// cellResourceReport_C := *(**C.DU_Usage_Report_CellResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(oDU_UE_C.cellResourceReportList.list.array)) + (uintptr)(j)*unsafe.Sizeof(sizeof_DU_Usage_Report_CellResourceReportItem_t)))
|
||||||
|
|
||||||
cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
|
// cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
|
||||||
cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
|
// cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
|
||||||
|
|
||||||
cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
|
// cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
|
||||||
cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
|
// cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
|
||||||
cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
|
// cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
|
||||||
|
|
||||||
cellResourceReport.UeResourceReportItemCount = int(cellResourceReport_C.ueResourceReportList.list.count)
|
// cellResourceReport.UeResourceReportItemCount = int(cellResourceReport_C.ueResourceReportList.list.count)
|
||||||
for k := 0; k < cellResourceReport.UeResourceReportItemCount; k++ {
|
// for k := 0; k < cellResourceReport.UeResourceReportItemCount; k++ {
|
||||||
ueResourceReport := &cellResourceReport.UeResourceReportItems[k]
|
// ueResourceReport := &cellResourceReport.UeResourceReportItems[k]
|
||||||
var sizeof_DU_Usage_Report_UeResourceReportItem_t *C.DU_Usage_Report_UeResourceReportItem_t
|
// var sizeof_DU_Usage_Report_UeResourceReportItem_t *C.DU_Usage_Report_UeResourceReportItem_t
|
||||||
ueResourceReport_C := *(**C.DU_Usage_Report_UeResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cellResourceReport_C.ueResourceReportList.list.array)) + (uintptr)(k)*unsafe.Sizeof(sizeof_DU_Usage_Report_UeResourceReportItem_t)))
|
// ueResourceReport_C := *(**C.DU_Usage_Report_UeResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cellResourceReport_C.ueResourceReportList.list.array)) + (uintptr)(k)*unsafe.Sizeof(sizeof_DU_Usage_Report_UeResourceReportItem_t)))
|
||||||
|
|
||||||
ueResourceReport.CRNTI.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.c_RNTI.buf), C.int(ueResourceReport_C.c_RNTI.size))
|
// ueResourceReport.CRNTI.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.c_RNTI.buf), C.int(ueResourceReport_C.c_RNTI.size))
|
||||||
ueResourceReport.CRNTI.Size = int(ueResourceReport_C.c_RNTI.size)
|
// ueResourceReport.CRNTI.Size = int(ueResourceReport_C.c_RNTI.size)
|
||||||
|
|
||||||
if ueResourceReport_C.dl_PRBUsage != nil {
|
// if ueResourceReport_C.dl_PRBUsage != nil {
|
||||||
ueResourceReport.PRBUsageDL = int64(*ueResourceReport_C.dl_PRBUsage)
|
// ueResourceReport.PRBUsageDL = int64(*ueResourceReport_C.dl_PRBUsage)
|
||||||
} else {
|
// } else {
|
||||||
ueResourceReport.PRBUsageDL = -1
|
// ueResourceReport.PRBUsageDL = -1
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ueResourceReport_C.ul_PRBUsage != nil {
|
// if ueResourceReport_C.ul_PRBUsage != nil {
|
||||||
ueResourceReport.PRBUsageUL = int64(*ueResourceReport_C.ul_PRBUsage)
|
// ueResourceReport.PRBUsageUL = int64(*ueResourceReport_C.ul_PRBUsage)
|
||||||
} else {
|
// } else {
|
||||||
ueResourceReport.PRBUsageUL = -1
|
// ueResourceReport.PRBUsageUL = -1
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
ranContainer.Container = oDU_UE
|
// ranContainer.Container = oDU_UE
|
||||||
} else if ranContainer.ContainerType == 2 {
|
// } else if ranContainer.ContainerType == 2 {
|
||||||
oCU_CP_UE := &CUCPUsageReportType{}
|
// oCU_CP_UE := &CUCPUsageReportType{}
|
||||||
oCU_CP_UE_C := *(**C.CU_CP_Usage_Report_Per_UE_t)(unsafe.Pointer(&pmContainer_C.theRANContainer.reportContainer.choice[0]))
|
// oCU_CP_UE_C := *(**C.CU_CP_Usage_Report_Per_UE_t)(unsafe.Pointer(&pmContainer_C.theRANContainer.reportContainer.choice[0]))
|
||||||
|
|
||||||
oCU_CP_UE.CellResourceReportItemCount = int(oCU_CP_UE_C.cellResourceReportList.list.count)
|
// oCU_CP_UE.CellResourceReportItemCount = int(oCU_CP_UE_C.cellResourceReportList.list.count)
|
||||||
for j := 0; j < oCU_CP_UE.CellResourceReportItemCount; j++ {
|
// for j := 0; j < oCU_CP_UE.CellResourceReportItemCount; j++ {
|
||||||
cellResourceReport := &oCU_CP_UE.CellResourceReportItems[j]
|
// cellResourceReport := &oCU_CP_UE.CellResourceReportItems[j]
|
||||||
var sizeof_CU_CP_Usage_Report_CellResourceReportItem_t *C.CU_CP_Usage_Report_CellResourceReportItem_t
|
// var sizeof_CU_CP_Usage_Report_CellResourceReportItem_t *C.CU_CP_Usage_Report_CellResourceReportItem_t
|
||||||
cellResourceReport_C := *(**C.CU_CP_Usage_Report_CellResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(oCU_CP_UE_C.cellResourceReportList.list.array)) + (uintptr)(j)*unsafe.Sizeof(sizeof_CU_CP_Usage_Report_CellResourceReportItem_t)))
|
// cellResourceReport_C := *(**C.CU_CP_Usage_Report_CellResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(oCU_CP_UE_C.cellResourceReportList.list.array)) + (uintptr)(j)*unsafe.Sizeof(sizeof_CU_CP_Usage_Report_CellResourceReportItem_t)))
|
||||||
|
|
||||||
cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
|
// cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
|
||||||
cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
|
// cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
|
||||||
|
|
||||||
cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
|
// cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
|
||||||
cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
|
// cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
|
||||||
cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
|
// cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
|
||||||
|
|
||||||
cellResourceReport.UeResourceReportItemCount = int(cellResourceReport_C.ueResourceReportList.list.count)
|
// cellResourceReport.UeResourceReportItemCount = int(cellResourceReport_C.ueResourceReportList.list.count)
|
||||||
for k := 0; k < cellResourceReport.UeResourceReportItemCount; k++ {
|
// for k := 0; k < cellResourceReport.UeResourceReportItemCount; k++ {
|
||||||
ueResourceReport := &cellResourceReport.UeResourceReportItems[k]
|
// ueResourceReport := &cellResourceReport.UeResourceReportItems[k]
|
||||||
var sizeof_CU_CP_Usage_Report_UeResourceReportItem_t *C.CU_CP_Usage_Report_UeResourceReportItem_t
|
// var sizeof_CU_CP_Usage_Report_UeResourceReportItem_t *C.CU_CP_Usage_Report_UeResourceReportItem_t
|
||||||
ueResourceReport_C := *(**C.CU_CP_Usage_Report_UeResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cellResourceReport_C.ueResourceReportList.list.array)) + (uintptr)(k)*unsafe.Sizeof(sizeof_CU_CP_Usage_Report_UeResourceReportItem_t)))
|
// ueResourceReport_C := *(**C.CU_CP_Usage_Report_UeResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cellResourceReport_C.ueResourceReportList.list.array)) + (uintptr)(k)*unsafe.Sizeof(sizeof_CU_CP_Usage_Report_UeResourceReportItem_t)))
|
||||||
|
|
||||||
ueResourceReport.CRNTI.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.c_RNTI.buf), C.int(ueResourceReport_C.c_RNTI.size))
|
// ueResourceReport.CRNTI.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.c_RNTI.buf), C.int(ueResourceReport_C.c_RNTI.size))
|
||||||
ueResourceReport.CRNTI.Size = int(ueResourceReport_C.c_RNTI.size)
|
// ueResourceReport.CRNTI.Size = int(ueResourceReport_C.c_RNTI.size)
|
||||||
|
|
||||||
if ueResourceReport_C.serving_Cell_RF_Type != nil {
|
// if ueResourceReport_C.serving_Cell_RF_Type != nil {
|
||||||
ueResourceReport.ServingCellRF = &OctetString{}
|
// ueResourceReport.ServingCellRF = &OctetString{}
|
||||||
ueResourceReport.ServingCellRF.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.serving_Cell_RF_Type.buf), C.int(ueResourceReport_C.serving_Cell_RF_Type.size))
|
// ueResourceReport.ServingCellRF.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.serving_Cell_RF_Type.buf), C.int(ueResourceReport_C.serving_Cell_RF_Type.size))
|
||||||
ueResourceReport.ServingCellRF.Size = int(ueResourceReport_C.serving_Cell_RF_Type.size)
|
// ueResourceReport.ServingCellRF.Size = int(ueResourceReport_C.serving_Cell_RF_Type.size)
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ueResourceReport_C.neighbor_Cell_RF != nil {
|
// if ueResourceReport_C.neighbor_Cell_RF != nil {
|
||||||
ueResourceReport.NeighborCellRF = &OctetString{}
|
// ueResourceReport.NeighborCellRF = &OctetString{}
|
||||||
ueResourceReport.NeighborCellRF.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.neighbor_Cell_RF.buf), C.int(ueResourceReport_C.neighbor_Cell_RF.size))
|
// ueResourceReport.NeighborCellRF.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.neighbor_Cell_RF.buf), C.int(ueResourceReport_C.neighbor_Cell_RF.size))
|
||||||
ueResourceReport.NeighborCellRF.Size = int(ueResourceReport_C.neighbor_Cell_RF.size)
|
// ueResourceReport.NeighborCellRF.Size = int(ueResourceReport_C.neighbor_Cell_RF.size)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
ranContainer.Container = oCU_CP_UE
|
// ranContainer.Container = oCU_CP_UE
|
||||||
} else if ranContainer.ContainerType == 3 {
|
// } else if ranContainer.ContainerType == 3 {
|
||||||
oCU_UP_UE := &CUUPUsageReportType{}
|
// oCU_UP_UE := &CUUPUsageReportType{}
|
||||||
oCU_UP_UE_C := *(**C.CU_UP_Usage_Report_Per_UE_t)(unsafe.Pointer(&pmContainer_C.theRANContainer.reportContainer.choice[0]))
|
// oCU_UP_UE_C := *(**C.CU_UP_Usage_Report_Per_UE_t)(unsafe.Pointer(&pmContainer_C.theRANContainer.reportContainer.choice[0]))
|
||||||
|
|
||||||
oCU_UP_UE.CellResourceReportItemCount = int(oCU_UP_UE_C.cellResourceReportList.list.count)
|
// oCU_UP_UE.CellResourceReportItemCount = int(oCU_UP_UE_C.cellResourceReportList.list.count)
|
||||||
for j := 0; j < oCU_UP_UE.CellResourceReportItemCount; j++ {
|
// for j := 0; j < oCU_UP_UE.CellResourceReportItemCount; j++ {
|
||||||
cellResourceReport := &oCU_UP_UE.CellResourceReportItems[j]
|
// cellResourceReport := &oCU_UP_UE.CellResourceReportItems[j]
|
||||||
var sizeof_CU_UP_Usage_Report_CellResourceReportItem_t *C.CU_UP_Usage_Report_CellResourceReportItem_t
|
// var sizeof_CU_UP_Usage_Report_CellResourceReportItem_t *C.CU_UP_Usage_Report_CellResourceReportItem_t
|
||||||
cellResourceReport_C := *(**C.CU_UP_Usage_Report_CellResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(oCU_UP_UE_C.cellResourceReportList.list.array)) + (uintptr)(j)*unsafe.Sizeof(sizeof_CU_UP_Usage_Report_CellResourceReportItem_t)))
|
// cellResourceReport_C := *(**C.CU_UP_Usage_Report_CellResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(oCU_UP_UE_C.cellResourceReportList.list.array)) + (uintptr)(j)*unsafe.Sizeof(sizeof_CU_UP_Usage_Report_CellResourceReportItem_t)))
|
||||||
|
|
||||||
cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
|
// cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
|
||||||
cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
|
// cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
|
||||||
|
|
||||||
cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
|
// cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
|
||||||
cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
|
// cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
|
||||||
cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
|
// cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
|
||||||
|
|
||||||
cellResourceReport.UeResourceReportItemCount = int(cellResourceReport_C.ueResourceReportList.list.count)
|
// cellResourceReport.UeResourceReportItemCount = int(cellResourceReport_C.ueResourceReportList.list.count)
|
||||||
for k := 0; k < cellResourceReport.UeResourceReportItemCount; k++ {
|
// for k := 0; k < cellResourceReport.UeResourceReportItemCount; k++ {
|
||||||
ueResourceReport := &cellResourceReport.UeResourceReportItems[k]
|
// ueResourceReport := &cellResourceReport.UeResourceReportItems[k]
|
||||||
var sizeof_CU_UP_Usage_Report_UeResourceReportItem_t *C.CU_UP_Usage_Report_UeResourceReportItem_t
|
// var sizeof_CU_UP_Usage_Report_UeResourceReportItem_t *C.CU_UP_Usage_Report_UeResourceReportItem_t
|
||||||
ueResourceReport_C := *(**C.CU_UP_Usage_Report_UeResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cellResourceReport_C.ueResourceReportList.list.array)) + (uintptr)(k)*unsafe.Sizeof(sizeof_CU_UP_Usage_Report_UeResourceReportItem_t)))
|
// ueResourceReport_C := *(**C.CU_UP_Usage_Report_UeResourceReportItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cellResourceReport_C.ueResourceReportList.list.array)) + (uintptr)(k)*unsafe.Sizeof(sizeof_CU_UP_Usage_Report_UeResourceReportItem_t)))
|
||||||
|
|
||||||
ueResourceReport.CRNTI.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.c_RNTI.buf), C.int(ueResourceReport_C.c_RNTI.size))
|
// ueResourceReport.CRNTI.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.c_RNTI.buf), C.int(ueResourceReport_C.c_RNTI.size))
|
||||||
ueResourceReport.CRNTI.Size = int(ueResourceReport_C.c_RNTI.size)
|
// ueResourceReport.CRNTI.Size = int(ueResourceReport_C.c_RNTI.size)
|
||||||
|
|
||||||
if ueResourceReport_C.pDCPBytesDL != nil {
|
// if ueResourceReport_C.pDCPBytesDL != nil {
|
||||||
ueResourceReport.PDCPBytesDL = &Integer{}
|
// ueResourceReport.PDCPBytesDL = &Integer{}
|
||||||
ueResourceReport.PDCPBytesDL.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.pDCPBytesDL.buf), C.int(ueResourceReport_C.pDCPBytesDL.size))
|
// ueResourceReport.PDCPBytesDL.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.pDCPBytesDL.buf), C.int(ueResourceReport_C.pDCPBytesDL.size))
|
||||||
ueResourceReport.PDCPBytesDL.Size = int(ueResourceReport_C.pDCPBytesDL.size)
|
// ueResourceReport.PDCPBytesDL.Size = int(ueResourceReport_C.pDCPBytesDL.size)
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ueResourceReport_C.pDCPBytesUL != nil {
|
// if ueResourceReport_C.pDCPBytesUL != nil {
|
||||||
ueResourceReport.PDCPBytesUL = &Integer{}
|
// ueResourceReport.PDCPBytesUL = &Integer{}
|
||||||
ueResourceReport.PDCPBytesUL.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.pDCPBytesUL.buf), C.int(ueResourceReport_C.pDCPBytesUL.size))
|
// ueResourceReport.PDCPBytesUL.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.pDCPBytesUL.buf), C.int(ueResourceReport_C.pDCPBytesUL.size))
|
||||||
ueResourceReport.PDCPBytesUL.Size = int(ueResourceReport_C.pDCPBytesUL.size)
|
// ueResourceReport.PDCPBytesUL.Size = int(ueResourceReport_C.pDCPBytesUL.size)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
ranContainer.Container = oCU_UP_UE
|
// ranContainer.Container = oCU_UP_UE
|
||||||
} else {
|
// } else {
|
||||||
return indMsg, errors.New("Unknown RAN Container type")
|
// return indMsg, errors.New("Unknown RAN Container type")
|
||||||
}
|
// }
|
||||||
|
|
||||||
pmContainer.RANContainer = ranContainer
|
pmContainer.RANContainer = ranContainer
|
||||||
}
|
}
|
||||||
|
@ -134,17 +134,18 @@ type GNB_CU_CP_Name PrintableString
|
|||||||
type GNB_CU_UP_Name PrintableString
|
type GNB_CU_UP_Name PrintableString
|
||||||
|
|
||||||
type IndicationHeaderFormat1 struct {
|
type IndicationHeaderFormat1 struct {
|
||||||
|
CollectionStartTime *OctetString
|
||||||
GlobalKPMnodeIDType int32
|
GlobalKPMnodeIDType int32
|
||||||
GlobalKPMnodeID interface{}
|
GlobalKPMnodeID interface{}
|
||||||
NRCGI *NRCGIType
|
// NRCGI *NRCGIType
|
||||||
PlmnID *OctetString
|
// PlmnID *OctetString
|
||||||
SliceID *SliceIDType
|
// SliceID *SliceIDType
|
||||||
FiveQI int64
|
// FiveQI int64
|
||||||
Qci int64
|
// Qci int64
|
||||||
UeMessageType int32
|
// UeMessageType int32
|
||||||
GnbDUID *Integer
|
// GnbDUID *Integer
|
||||||
GnbNameType int32
|
// GnbNameType int32
|
||||||
GnbName interface{}
|
// GnbName interface{}
|
||||||
GlobalgNBID *GlobalgNBIDType
|
GlobalgNBID *GlobalgNBIDType
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +203,7 @@ type CUCPResourceStatusType struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OCUCPPFContainerType struct {
|
type OCUCPPFContainerType struct {
|
||||||
GNBCUCPName *PrintableString
|
// GNBCUCPName *PrintableString
|
||||||
CUCPResourceStatus CUCPResourceStatusType
|
CUCPResourceStatus CUCPResourceStatusType
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,7 +252,7 @@ type CUUPPFContainerItemType struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OCUUPPFContainerType struct {
|
type OCUUPPFContainerType struct {
|
||||||
GNBCUUPName *PrintableString
|
// GNBCUUPName *PrintableString
|
||||||
CUUPPFContainerItems [3]CUUPPFContainerItemType
|
CUUPPFContainerItems [3]CUUPPFContainerItemType
|
||||||
CUUPPFContainerItemCount int
|
CUUPPFContainerItemCount int
|
||||||
}
|
}
|
||||||
@ -312,11 +313,13 @@ type PFContainerType struct {
|
|||||||
Container interface{}
|
Container interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
type RANContainerType struct {
|
// type RANContainerType struct {
|
||||||
Timestamp OctetString
|
// Timestamp OctetString
|
||||||
ContainerType int32
|
// ContainerType int32
|
||||||
Container interface{}
|
// Container interface{}
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
type RANContainerType OctetString
|
||||||
|
|
||||||
type PMContainerType struct {
|
type PMContainerType struct {
|
||||||
PFContainer *PFContainerType
|
PFContainer *PFContainerType
|
||||||
@ -329,7 +332,7 @@ type IndicationMessageFormat1 struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type IndicationMessage struct {
|
type IndicationMessage struct {
|
||||||
StyleType int64
|
// StyleType int64
|
||||||
IndMsgType int32
|
IndMsgType int32
|
||||||
IndMsg interface{}
|
IndMsg interface{}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user