2 ==================================================================================
3 Copyright (c) 2019 AT&T Intellectual Property.
4 Copyright (c) 2019 Nokia
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ==================================================================================
23 #include <e2sm/wrapper.h>
24 #cgo LDFLAGS: -le2smwrapper
25 #cgo CFLAGS: -I/usr/local/include/e2sm
40 func (c *E2sm) SetEventTriggerDefinition(buffer []byte, eventTriggerCount int, RTPeriods []int64) (newBuffer []byte, err error) {
41 cptr := unsafe.Pointer(&buffer[0])
42 periods := unsafe.Pointer(&RTPeriods[0])
43 size := C.e2sm_encode_ric_event_trigger_definition(cptr, C.size_t(len(buffer)), C.size_t(eventTriggerCount), (*C.long)(periods))
45 return make([]byte, 0), errors.New("e2sm wrapper is unable to set EventTriggerDefinition due to wrong or invalid input")
47 newBuffer = C.GoBytes(cptr, (C.int(size)+7)/8)
51 func (c *E2sm) SetActionDefinition(buffer []byte, ricStyleType int64) (newBuffer []byte, err error) {
52 cptr := unsafe.Pointer(&buffer[0])
53 size := C.e2sm_encode_ric_action_definition(cptr, C.size_t(len(buffer)), C.long(ricStyleType))
55 return make([]byte, 0), errors.New("e2sm wrapper is unable to set ActionDefinition due to wrong or invalid input")
57 newBuffer = C.GoBytes(cptr, (C.int(size)+7)/8)
61 func (c *E2sm) GetIndicationHeader(buffer []byte) (indHdr *IndicationHeader, err error) {
62 cptr := unsafe.Pointer(&buffer[0])
63 indHdr = &IndicationHeader{}
64 decodedHdr := C.e2sm_decode_ric_indication_header(cptr, C.size_t(len(buffer)))
65 if decodedHdr == nil {
66 return indHdr, errors.New("e2sm wrapper is unable to get IndicationHeader due to wrong or invalid input")
68 defer C.e2sm_free_ric_indication_header(decodedHdr)
70 indHdr.IndHdrType = int32(decodedHdr.present)
71 if indHdr.IndHdrType == 1 {
72 indHdrFormat1 := &IndicationHeaderFormat1{}
73 indHdrFormat1_C := (*C.E2SM_KPM_IndicationHeader_Format1_t)(unsafe.Pointer(&decodedHdr.choice[0]))
75 if indHdrFormat1_C.id_GlobalKPMnode_ID != nil {
76 globalKPMnodeID_C := (*C.GlobalKPMnode_ID_t)(indHdrFormat1_C.id_GlobalKPMnode_ID)
78 indHdrFormat1.GlobalKPMnodeIDType = int32(globalKPMnodeID_C.present)
79 if indHdrFormat1.GlobalKPMnodeIDType == 1 {
80 globalgNBID := &GlobalKPMnodegNBIDType{}
81 globalgNBID_C := (*C.GlobalKPMnode_gNB_ID_t)(unsafe.Pointer(&globalKPMnodeID_C.choice[0]))
83 plmnID_C := globalgNBID_C.global_gNB_ID.plmn_id
84 globalgNBID.GlobalgNBID.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID_C.buf), C.int(plmnID_C.size))
85 globalgNBID.GlobalgNBID.PlmnID.Size = int(plmnID_C.size)
87 globalgNBID_gNBID_C := globalgNBID_C.global_gNB_ID.gnb_id
88 globalgNBID.GlobalgNBID.GnbIDType = int(globalgNBID_gNBID_C.present)
89 if globalgNBID.GlobalgNBID.GnbIDType == 1 {
91 gNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globalgNBID_gNBID_C.choice[0]))
93 gNBID.Buf = C.GoBytes(unsafe.Pointer(gNBID_C.buf), C.int(gNBID_C.size))
94 gNBID.Size = int(gNBID_C.size)
95 gNBID.BitsUnused = int(gNBID_C.bits_unused)
97 globalgNBID.GlobalgNBID.GnbID = gNBID
100 if globalgNBID_C.gNB_CU_UP_ID != nil {
101 globalgNBID.GnbCUUPID = &Integer{}
102 globalgNBID.GnbCUUPID.Buf = C.GoBytes(unsafe.Pointer(globalgNBID_C.gNB_CU_UP_ID.buf), C.int(globalgNBID_C.gNB_CU_UP_ID.size))
103 globalgNBID.GnbCUUPID.Size = int(globalgNBID_C.gNB_CU_UP_ID.size)
106 if globalgNBID_C.gNB_DU_ID != nil {
107 globalgNBID.GnbDUID = &Integer{}
108 globalgNBID.GnbDUID.Buf = C.GoBytes(unsafe.Pointer(globalgNBID_C.gNB_DU_ID.buf), C.int(globalgNBID_C.gNB_DU_ID.size))
109 globalgNBID.GnbDUID.Size = int(globalgNBID_C.gNB_DU_ID.size)
112 indHdrFormat1.GlobalKPMnodeID = globalgNBID
113 } else if indHdrFormat1.GlobalKPMnodeIDType == 2 {
114 globalengNBID := &GlobalKPMnodeengNBIDType{}
115 globalengNBID_C := (*C.GlobalKPMnode_en_gNB_ID_t)(unsafe.Pointer(&globalKPMnodeID_C.choice[0]))
117 plmnID_C := globalengNBID_C.global_gNB_ID.pLMN_Identity
118 globalengNBID.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID_C.buf), C.int(plmnID_C.size))
119 globalengNBID.PlmnID.Size = int(plmnID_C.size)
121 globalengNBID_gNBID_C := globalengNBID_C.global_gNB_ID.gNB_ID
122 globalengNBID.GnbIDType = int(globalengNBID_gNBID_C.present)
123 if globalengNBID.GnbIDType == 1 {
124 engNBID := &ENGNBID{}
125 engNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globalengNBID_gNBID_C.choice[0]))
127 engNBID.Buf = C.GoBytes(unsafe.Pointer(engNBID_C.buf), C.int(engNBID_C.size))
128 engNBID.Size = int(engNBID_C.size)
129 engNBID.BitsUnused = int(engNBID_C.bits_unused)
131 globalengNBID.GnbID = engNBID
134 indHdrFormat1.GlobalKPMnodeID = globalengNBID
135 } else if indHdrFormat1.GlobalKPMnodeIDType == 3 {
136 globalngeNBID := &GlobalKPMnodengeNBIDType{}
137 globalngeNBID_C := (*C.GlobalKPMnode_ng_eNB_ID_t)(unsafe.Pointer(&globalKPMnodeID_C.choice[0]))
139 plmnID_C := globalngeNBID_C.global_ng_eNB_ID.plmn_id
140 globalngeNBID.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID_C.buf), C.int(plmnID_C.size))
141 globalngeNBID.PlmnID.Size = int(plmnID_C.size)
143 globalngeNBID_eNBID_C := globalngeNBID_C.global_ng_eNB_ID.enb_id
144 globalngeNBID.EnbIDType = int(globalngeNBID_eNBID_C.present)
145 if globalngeNBID.EnbIDType == 1 {
146 ngeNBID := &NGENBID_Macro{}
147 ngeNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globalngeNBID_eNBID_C.choice[0]))
149 ngeNBID.Buf = C.GoBytes(unsafe.Pointer(ngeNBID_C.buf), C.int(ngeNBID_C.size))
150 ngeNBID.Size = int(ngeNBID_C.size)
151 ngeNBID.BitsUnused = int(ngeNBID_C.bits_unused)
153 globalngeNBID.EnbID = ngeNBID
154 } else if globalngeNBID.EnbIDType == 2 {
155 ngeNBID := &NGENBID_ShortMacro{}
156 ngeNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globalngeNBID_eNBID_C.choice[0]))
158 ngeNBID.Buf = C.GoBytes(unsafe.Pointer(ngeNBID_C.buf), C.int(ngeNBID_C.size))
159 ngeNBID.Size = int(ngeNBID_C.size)
160 ngeNBID.BitsUnused = int(ngeNBID_C.bits_unused)
162 globalngeNBID.EnbID = ngeNBID
163 } else if globalngeNBID.EnbIDType == 3 {
164 ngeNBID := &NGENBID_LongMacro{}
165 ngeNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globalngeNBID_eNBID_C.choice[0]))
167 ngeNBID.Buf = C.GoBytes(unsafe.Pointer(ngeNBID_C.buf), C.int(ngeNBID_C.size))
168 ngeNBID.Size = int(ngeNBID_C.size)
169 ngeNBID.BitsUnused = int(ngeNBID_C.bits_unused)
171 globalngeNBID.EnbID = ngeNBID
174 indHdrFormat1.GlobalKPMnodeID = globalngeNBID
175 } else if indHdrFormat1.GlobalKPMnodeIDType == 4 {
176 globaleNBID := &GlobalKPMnodeeNBIDType{}
177 globaleNBID_C := (*C.GlobalKPMnode_eNB_ID_t)(unsafe.Pointer(&globalKPMnodeID_C.choice[0]))
179 plmnID_C := globaleNBID_C.global_eNB_ID.pLMN_Identity
180 globaleNBID.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID_C.buf), C.int(plmnID_C.size))
181 globaleNBID.PlmnID.Size = int(plmnID_C.size)
183 globaleNBID_eNBID_C := globaleNBID_C.global_eNB_ID.eNB_ID
184 globaleNBID.EnbIDType = int(globaleNBID_eNBID_C.present)
185 if globaleNBID.EnbIDType == 1 {
186 eNBID := &ENBID_Macro{}
187 eNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globaleNBID_eNBID_C.choice[0]))
189 eNBID.Buf = C.GoBytes(unsafe.Pointer(eNBID_C.buf), C.int(eNBID_C.size))
190 eNBID.Size = int(eNBID_C.size)
191 eNBID.BitsUnused = int(eNBID_C.bits_unused)
193 globaleNBID.EnbID = eNBID
194 } else if globaleNBID.EnbIDType == 2 {
195 eNBID := &ENBID_Home{}
196 eNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globaleNBID_eNBID_C.choice[0]))
198 eNBID.Buf = C.GoBytes(unsafe.Pointer(eNBID_C.buf), C.int(eNBID_C.size))
199 eNBID.Size = int(eNBID_C.size)
200 eNBID.BitsUnused = int(eNBID_C.bits_unused)
202 globaleNBID.EnbID = eNBID
203 } else if globaleNBID.EnbIDType == 3 {
204 eNBID := &ENBID_ShortMacro{}
205 eNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globaleNBID_eNBID_C.choice[0]))
207 eNBID.Buf = C.GoBytes(unsafe.Pointer(eNBID_C.buf), C.int(eNBID_C.size))
208 eNBID.Size = int(eNBID_C.size)
209 eNBID.BitsUnused = int(eNBID_C.bits_unused)
211 globaleNBID.EnbID = eNBID
212 } else if globaleNBID.EnbIDType == 4 {
213 eNBID := &ENBID_LongMacro{}
214 eNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globaleNBID_eNBID_C.choice[0]))
216 eNBID.Buf = C.GoBytes(unsafe.Pointer(eNBID_C.buf), C.int(eNBID_C.size))
217 eNBID.Size = int(eNBID_C.size)
218 eNBID.BitsUnused = int(eNBID_C.bits_unused)
220 globaleNBID.EnbID = eNBID
223 indHdrFormat1.GlobalKPMnodeID = globaleNBID
226 indHdrFormat1.GlobalKPMnodeIDType = 0
229 if indHdrFormat1_C.nRCGI != nil {
230 indHdrFormat1.NRCGI = &NRCGIType{}
232 plmnID := indHdrFormat1_C.nRCGI.pLMN_Identity
233 indHdrFormat1.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID.buf), C.int(plmnID.size))
234 indHdrFormat1.NRCGI.PlmnID.Size = int(plmnID.size)
236 nRCellID := indHdrFormat1_C.nRCGI.nRCellIdentity
237 indHdrFormat1.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(nRCellID.buf), C.int(nRCellID.size))
238 indHdrFormat1.NRCGI.NRCellID.Size = int(nRCellID.size)
239 indHdrFormat1.NRCGI.NRCellID.BitsUnused = int(nRCellID.bits_unused)
242 if indHdrFormat1_C.pLMN_Identity != nil {
243 indHdrFormat1.PlmnID = &OctetString{}
245 indHdrFormat1.PlmnID.Buf = C.GoBytes(unsafe.Pointer(indHdrFormat1_C.pLMN_Identity.buf), C.int(indHdrFormat1_C.pLMN_Identity.size))
246 indHdrFormat1.PlmnID.Size = int(indHdrFormat1_C.pLMN_Identity.size)
249 if indHdrFormat1_C.sliceID != nil {
250 indHdrFormat1.SliceID = &SliceIDType{}
252 sST := indHdrFormat1_C.sliceID.sST
253 indHdrFormat1.SliceID.SST.Buf = C.GoBytes(unsafe.Pointer(sST.buf), C.int(sST.size))
254 indHdrFormat1.SliceID.SST.Size = int(sST.size)
256 if indHdrFormat1_C.sliceID.sD != nil {
257 indHdrFormat1.SliceID.SD = &OctetString{}
259 sD := indHdrFormat1_C.sliceID.sD
260 indHdrFormat1.SliceID.SD.Buf = C.GoBytes(unsafe.Pointer(sD.buf), C.int(sD.size))
261 indHdrFormat1.SliceID.SD.Size = int(sD.size)
265 if indHdrFormat1_C.fiveQI != nil {
266 indHdrFormat1.FiveQI = int64(*indHdrFormat1_C.fiveQI)
268 indHdrFormat1.FiveQI = -1
271 if indHdrFormat1_C.qci != nil {
272 indHdrFormat1.Qci = int64(*indHdrFormat1_C.qci)
274 indHdrFormat1.Qci = -1
277 if indHdrFormat1_C.message_Type != nil {
278 indHdrFormat1.UeMessageType = int32(*indHdrFormat1_C.message_Type)
280 indHdrFormat1.UeMessageType = -1
283 if indHdrFormat1_C.gNB_DU_ID != nil {
284 indHdrFormat1.GnbDUID = &Integer{}
286 indHdrFormat1.GnbDUID.Buf = C.GoBytes(unsafe.Pointer(indHdrFormat1_C.gNB_DU_ID.buf), C.int(indHdrFormat1_C.gNB_DU_ID.size))
287 indHdrFormat1.GnbDUID.Size = int(indHdrFormat1_C.gNB_DU_ID.size)
290 if indHdrFormat1_C.gNB_Name != nil {
291 indHdrFormat1.GnbNameType = int32(indHdrFormat1_C.gNB_Name.present)
292 if indHdrFormat1.GnbNameType == 1 {
293 gNBName := &GNB_DU_Name{}
294 gNBName_C := (*C.GNB_DU_Name_t)(unsafe.Pointer(&indHdrFormat1_C.gNB_Name.choice[0]))
296 gNBName.Buf = C.GoBytes(unsafe.Pointer(gNBName_C.buf), C.int(gNBName_C.size))
297 gNBName.Size = int(gNBName_C.size)
299 indHdrFormat1.GnbName = gNBName
300 } else if indHdrFormat1.GnbNameType == 2 {
301 gNBName := &GNB_CU_CP_Name{}
302 gNBName_C := (*C.GNB_CU_CP_Name_t)(unsafe.Pointer(&indHdrFormat1_C.gNB_Name.choice[0]))
304 gNBName.Buf = C.GoBytes(unsafe.Pointer(gNBName_C.buf), C.int(gNBName_C.size))
305 gNBName.Size = int(gNBName_C.size)
307 indHdrFormat1.GnbName = gNBName
308 } else if indHdrFormat1.GnbNameType == 3 {
309 gNBName := &GNB_CU_UP_Name{}
310 gNBName_C := (*C.GNB_CU_UP_Name_t)(unsafe.Pointer(&indHdrFormat1_C.gNB_Name.choice[0]))
312 gNBName.Buf = C.GoBytes(unsafe.Pointer(gNBName_C.buf), C.int(gNBName_C.size))
313 gNBName.Size = int(gNBName_C.size)
315 indHdrFormat1.GnbName = gNBName
318 indHdrFormat1.GnbNameType = -1
321 if indHdrFormat1_C.global_GNB_ID != nil {
322 plmnID_C := indHdrFormat1_C.global_GNB_ID.plmn_id
323 indHdrFormat1.GlobalgNBID.PlmnID.Buf = C.GoBytes(unsafe.Pointer(plmnID_C.buf), C.int(plmnID_C.size))
324 indHdrFormat1.GlobalgNBID.PlmnID.Size = int(plmnID_C.size)
326 globalgNBID_gNBID_C := indHdrFormat1_C.global_GNB_ID.gnb_id
327 indHdrFormat1.GlobalgNBID.GnbIDType = int(globalgNBID_gNBID_C.present)
328 if indHdrFormat1.GlobalgNBID.GnbIDType == 1 {
330 gNBID_C := (*C.BIT_STRING_t)(unsafe.Pointer(&globalgNBID_gNBID_C.choice[0]))
332 gNBID.Buf = C.GoBytes(unsafe.Pointer(gNBID_C.buf), C.int(gNBID_C.size))
333 gNBID.Size = int(gNBID_C.size)
334 gNBID.BitsUnused = int(gNBID_C.bits_unused)
336 indHdrFormat1.GlobalgNBID.GnbID = gNBID
340 indHdr.IndHdr = indHdrFormat1
342 return indHdr, errors.New("Unknown RIC Indication Header type")
348 func (c *E2sm) GetIndicationMessage(buffer []byte) (indMsg *IndicationMessage, err error) {
349 cptr := unsafe.Pointer(&buffer[0])
350 indMsg = &IndicationMessage{}
351 decodedMsg := C.e2sm_decode_ric_indication_message(cptr, C.size_t(len(buffer)))
352 if decodedMsg == nil {
353 return indMsg, errors.New("e2sm wrapper is unable to get IndicationMessage due to wrong or invalid input")
355 defer C.e2sm_free_ric_indication_message(decodedMsg)
357 indMsg.StyleType = int64(decodedMsg.ric_Style_Type)
359 indMsg.IndMsgType = int32(decodedMsg.indicationMessage.present)
361 if indMsg.IndMsgType == 1 {
362 indMsgFormat1 := &IndicationMessageFormat1{}
363 indMsgFormat1_C := (*C.E2SM_KPM_IndicationMessage_Format1_t)(unsafe.Pointer(&decodedMsg.indicationMessage.choice[0]))
365 indMsgFormat1.PMContainerCount = int(indMsgFormat1_C.pm_Containers.list.count)
366 for i := 0; i < indMsgFormat1.PMContainerCount; i++ {
367 pmContainer := indMsgFormat1.PMContainers[i]
368 var sizeof_PM_Containers_List_t *C.PM_Containers_List_t
369 pmContainer_C := (*C.PM_Containers_List_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(indMsgFormat1_C.pm_Containers.list.array)) + (uintptr)(i)*unsafe.Sizeof(sizeof_PM_Containers_List_t)))
371 if pmContainer_C.performanceContainer != nil {
372 pfContainer := &PFContainerType{}
374 pfContainer.ContainerType = int32(pmContainer_C.performanceContainer.present)
376 if pfContainer.ContainerType == 1 {
377 oDU_PF := &ODUPFContainerType{}
378 oDU_PF_C := (*C.ODU_PF_Container_t)(unsafe.Pointer(&pmContainer_C.performanceContainer.choice[0]))
380 oDU_PF.CellResourceReportCount = int(oDU_PF_C.cellResourceReportList.list.count)
381 for j := 0; j < oDU_PF.CellResourceReportCount; j++ {
382 cellResourceReport := oDU_PF.CellResourceReports[j]
383 var sizeof_CellResourceReportListItem_t *C.CellResourceReportListItem_t
384 cellResourceReport_C := (*C.CellResourceReportListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(oDU_PF_C.cellResourceReportList.list.array)) + (uintptr)(j)*unsafe.Sizeof(sizeof_CellResourceReportListItem_t)))
386 cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
387 cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
389 cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
390 cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
391 cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
393 if cellResourceReport_C.dl_TotalofAvailablePRBs != nil {
394 cellResourceReport.TotalofAvailablePRBs.DL = int64(*cellResourceReport_C.dl_TotalofAvailablePRBs)
396 cellResourceReport.TotalofAvailablePRBs.DL = -1
399 if cellResourceReport_C.ul_TotalofAvailablePRBs != nil {
400 cellResourceReport.TotalofAvailablePRBs.UL = int64(*cellResourceReport_C.ul_TotalofAvailablePRBs)
402 cellResourceReport.TotalofAvailablePRBs.UL = -1
405 cellResourceReport.ServedPlmnPerCellCount = int(cellResourceReport_C.servedPlmnPerCellList.list.count)
406 for k := 0; k < cellResourceReport.ServedPlmnPerCellCount; k++ {
407 servedPlmnPerCell := cellResourceReport.ServedPlmnPerCells[k]
408 var sizeof_ServedPlmnPerCellListItem_t *C.ServedPlmnPerCellListItem_t
409 servedPlmnPerCell_C := (*C.ServedPlmnPerCellListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cellResourceReport_C.servedPlmnPerCellList.list.array)) + (uintptr)(k)*unsafe.Sizeof(sizeof_ServedPlmnPerCellListItem_t)))
411 servedPlmnPerCell.PlmnID.Buf = C.GoBytes(unsafe.Pointer(servedPlmnPerCell_C.pLMN_Identity.buf), C.int(servedPlmnPerCell_C.pLMN_Identity.size))
412 servedPlmnPerCell.PlmnID.Size = int(servedPlmnPerCell_C.pLMN_Identity.size)
414 if servedPlmnPerCell_C.du_PM_5GC != nil {
415 duPM5GC := &DUPM5GCContainerType{}
416 duPM5GC_C := (*C.FGC_DU_PM_Container_t)(servedPlmnPerCell_C.du_PM_5GC)
418 duPM5GC.SlicePerPlmnPerCellCount = int(duPM5GC_C.slicePerPlmnPerCellList.list.count)
419 for l := 0; l < duPM5GC.SlicePerPlmnPerCellCount; l++ {
420 slicePerPlmnPerCell := duPM5GC.SlicePerPlmnPerCells[l]
421 var sizeof_SlicePerPlmnPerCellListItem_t *C.SlicePerPlmnPerCellListItem_t
422 slicePerPlmnPerCell_C := (*C.SlicePerPlmnPerCellListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(duPM5GC_C.slicePerPlmnPerCellList.list.array)) + (uintptr)(l)*unsafe.Sizeof(sizeof_SlicePerPlmnPerCellListItem_t)))
424 slicePerPlmnPerCell.SliceID.SST.Buf = C.GoBytes(unsafe.Pointer(slicePerPlmnPerCell_C.sliceID.sST.buf), C.int(slicePerPlmnPerCell_C.sliceID.sST.size))
425 slicePerPlmnPerCell.SliceID.SST.Size = int(slicePerPlmnPerCell_C.sliceID.sST.size)
427 if slicePerPlmnPerCell_C.sliceID.sD != nil {
428 slicePerPlmnPerCell.SliceID.SD = &OctetString{}
429 slicePerPlmnPerCell.SliceID.SD.Buf = C.GoBytes(unsafe.Pointer(slicePerPlmnPerCell_C.sliceID.sD.buf), C.int(slicePerPlmnPerCell_C.sliceID.sD.size))
430 slicePerPlmnPerCell.SliceID.SD.Size = int(slicePerPlmnPerCell_C.sliceID.sD.size)
433 slicePerPlmnPerCell.FQIPERSlicesPerPlmnPerCellCount = int(slicePerPlmnPerCell_C.fQIPERSlicesPerPlmnPerCellList.list.count)
434 for m := 0; m < slicePerPlmnPerCell.FQIPERSlicesPerPlmnPerCellCount; m++ {
435 fQIPerSlicesPerPlmnPerCell := slicePerPlmnPerCell.FQIPERSlicesPerPlmnPerCells[m]
436 var sizeof_FQIPERSlicesPerPlmnPerCellListItem_t *C.FQIPERSlicesPerPlmnPerCellListItem_t
437 fQIPerSlicesPerPlmnPerCell_C := (*C.FQIPERSlicesPerPlmnPerCellListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(slicePerPlmnPerCell_C.fQIPERSlicesPerPlmnPerCellList.list.array)) + (uintptr)(m)*unsafe.Sizeof(sizeof_FQIPERSlicesPerPlmnPerCellListItem_t)))
439 fQIPerSlicesPerPlmnPerCell.FiveQI = int64(fQIPerSlicesPerPlmnPerCell_C.fiveQI)
441 if fQIPerSlicesPerPlmnPerCell_C.dl_PRBUsage != nil {
442 fQIPerSlicesPerPlmnPerCell.PrbUsage.DL = int64(*fQIPerSlicesPerPlmnPerCell_C.dl_PRBUsage)
444 fQIPerSlicesPerPlmnPerCell.PrbUsage.DL = -1
447 if fQIPerSlicesPerPlmnPerCell_C.ul_PRBUsage != nil {
448 fQIPerSlicesPerPlmnPerCell.PrbUsage.UL = int64(*fQIPerSlicesPerPlmnPerCell_C.ul_PRBUsage)
450 fQIPerSlicesPerPlmnPerCell.PrbUsage.UL = -1
455 servedPlmnPerCell.DUPM5GC = duPM5GC
458 if servedPlmnPerCell_C.du_PM_EPC != nil {
459 duPMEPC := &DUPMEPCContainerType{}
460 duPMEPC_C := (*C.EPC_DU_PM_Container_t)(servedPlmnPerCell_C.du_PM_EPC)
462 duPMEPC.PerQCIReportCount = int(duPMEPC_C.perQCIReportList.list.count)
463 for l := 0; l < duPMEPC.PerQCIReportCount; l++ {
464 perQCIReport := duPMEPC.PerQCIReports[l]
465 var sizeof_PerQCIReportListItem_t *C.PerQCIReportListItem_t
466 perQCIReport_C := (*C.PerQCIReportListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(duPMEPC_C.perQCIReportList.list.array)) + (uintptr)(l)*unsafe.Sizeof(sizeof_PerQCIReportListItem_t)))
468 perQCIReport.QCI = int64(perQCIReport_C.qci)
470 if perQCIReport_C.dl_PRBUsage != nil {
471 perQCIReport.PrbUsage.DL = int64(*perQCIReport_C.dl_PRBUsage)
473 perQCIReport.PrbUsage.DL = -1
476 if perQCIReport_C.ul_PRBUsage != nil {
477 perQCIReport.PrbUsage.UL = int64(*perQCIReport_C.ul_PRBUsage)
479 perQCIReport.PrbUsage.UL = -1
483 servedPlmnPerCell.DUPMEPC = duPMEPC
488 pfContainer.Container = oDU_PF
489 } else if pfContainer.ContainerType == 2 {
490 oCU_CP_PF := &OCUCPPFContainerType{}
491 oCU_CP_PF_C := (*C.OCUCP_PF_Container_t)(unsafe.Pointer(&pmContainer_C.performanceContainer.choice[0]))
493 if oCU_CP_PF_C.gNB_CU_CP_Name != nil {
494 oCU_CP_PF.GNBCUCPName = &PrintableString{}
495 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))
496 oCU_CP_PF.GNBCUCPName.Size = int(oCU_CP_PF_C.gNB_CU_CP_Name.size)
499 if oCU_CP_PF_C.cu_CP_Resource_Status.numberOfActive_UEs != nil {
500 oCU_CP_PF.CUCPResourceStatus.NumberOfActiveUEs = int64(*oCU_CP_PF_C.cu_CP_Resource_Status.numberOfActive_UEs)
503 pfContainer.Container = oCU_CP_PF
504 } else if pfContainer.ContainerType == 3 {
505 oCU_UP_PF := &OCUUPPFContainerType{}
506 oCU_UP_PF_C := (*C.OCUUP_PF_Container_t)(unsafe.Pointer(&pmContainer_C.performanceContainer.choice[0]))
508 if oCU_UP_PF_C.gNB_CU_UP_Name != nil {
509 oCU_UP_PF.GNBCUUPName = &PrintableString{}
510 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))
511 oCU_UP_PF.GNBCUUPName.Size = int(oCU_UP_PF_C.gNB_CU_UP_Name.size)
514 oCU_UP_PF.CUUPPFContainerItemCount = int(oCU_UP_PF_C.pf_ContainerList.list.count)
515 for j := 0; j < oCU_UP_PF.CUUPPFContainerItemCount; j++ {
516 cuUPPFContainer := oCU_UP_PF.CUUPPFContainerItems[j]
517 var sizeof_PF_ContainerListItem_t *C.PF_ContainerListItem_t
518 cuUPPFContainer_C := (*C.PF_ContainerListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(oCU_UP_PF_C.pf_ContainerList.list.array)) + (uintptr)(j)*unsafe.Sizeof(sizeof_PF_ContainerListItem_t)))
520 cuUPPFContainer.InterfaceType = int64(cuUPPFContainer_C.interface_type)
522 cuUPPFContainer.OCUUPPMContainer.CUUPPlmnCount = int(cuUPPFContainer_C.o_CU_UP_PM_Container.plmnList.list.count)
523 for k := 0; k < cuUPPFContainer.OCUUPPMContainer.CUUPPlmnCount; k++ {
524 cuUPPlmn := cuUPPFContainer.OCUUPPMContainer.CUUPPlmns[k]
525 var sizeof_PlmnID_List_t *C.PlmnID_List_t
526 cuUPPlmn_C := (*C.PlmnID_List_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cuUPPFContainer_C.o_CU_UP_PM_Container.plmnList.list.array)) + (uintptr)(k)*unsafe.Sizeof(sizeof_PlmnID_List_t)))
528 cuUPPlmn.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cuUPPlmn_C.pLMN_Identity.buf), C.int(cuUPPlmn_C.pLMN_Identity.size))
529 cuUPPlmn.PlmnID.Size = int(cuUPPlmn_C.pLMN_Identity.size)
531 if cuUPPlmn_C.cu_UP_PM_5GC != nil {
532 cuUPPM5GC := &CUUPPM5GCType{}
533 cuUPPM5GC_C := (*C.FGC_CUUP_PM_Format_t)(cuUPPlmn_C.cu_UP_PM_5GC)
535 cuUPPM5GC.SliceToReportCount = int(cuUPPM5GC_C.sliceToReportList.list.count)
536 for l := 0; l < cuUPPM5GC.SliceToReportCount; l++ {
537 sliceToReport := cuUPPM5GC.SliceToReports[l]
538 var sizeof_SliceToReportListItem_t *C.SliceToReportListItem_t
539 sliceToReport_C := (*C.SliceToReportListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cuUPPM5GC_C.sliceToReportList.list.array)) + (uintptr)(l)*unsafe.Sizeof(sizeof_SliceToReportListItem_t)))
541 sliceToReport.SliceID.SST.Buf = C.GoBytes(unsafe.Pointer(sliceToReport_C.sliceID.sST.buf), C.int(sliceToReport_C.sliceID.sST.size))
542 sliceToReport.SliceID.SST.Size = int(sliceToReport_C.sliceID.sST.size)
544 if sliceToReport_C.sliceID.sD != nil {
545 sliceToReport.SliceID.SD = &OctetString{}
546 sliceToReport.SliceID.SD.Buf = C.GoBytes(unsafe.Pointer(sliceToReport_C.sliceID.sD.buf), C.int(sliceToReport_C.sliceID.sD.size))
547 sliceToReport.SliceID.SD.Size = int(sliceToReport_C.sliceID.sD.size)
550 sliceToReport.FQIPERSlicesPerPlmnCount = int(sliceToReport_C.fQIPERSlicesPerPlmnList.list.count)
551 for m := 0; m < sliceToReport.FQIPERSlicesPerPlmnCount; m++ {
552 fQIPerSlicesPerPlmn := sliceToReport.FQIPERSlicesPerPlmns[m]
553 var sizeof_FQIPERSlicesPerPlmnListItem_t *C.FQIPERSlicesPerPlmnListItem_t
554 fQIPerSlicesPerPlmn_C := (*C.FQIPERSlicesPerPlmnListItem_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(sliceToReport_C.fQIPERSlicesPerPlmnList.list.array)) + (uintptr)(m)*unsafe.Sizeof(sizeof_FQIPERSlicesPerPlmnListItem_t)))
556 fQIPerSlicesPerPlmn.FiveQI = int64(fQIPerSlicesPerPlmn_C.fiveQI)
558 if fQIPerSlicesPerPlmn_C.pDCPBytesDL != nil {
559 fQIPerSlicesPerPlmn.PDCPBytesDL = &Integer{}
560 fQIPerSlicesPerPlmn.PDCPBytesDL.Buf = C.GoBytes(unsafe.Pointer(fQIPerSlicesPerPlmn_C.pDCPBytesDL.buf), C.int(fQIPerSlicesPerPlmn_C.pDCPBytesDL.size))
561 fQIPerSlicesPerPlmn.PDCPBytesDL.Size = int(fQIPerSlicesPerPlmn_C.pDCPBytesDL.size)
564 if fQIPerSlicesPerPlmn_C.pDCPBytesUL != nil {
565 fQIPerSlicesPerPlmn.PDCPBytesUL = &Integer{}
566 fQIPerSlicesPerPlmn.PDCPBytesUL.Buf = C.GoBytes(unsafe.Pointer(fQIPerSlicesPerPlmn_C.pDCPBytesUL.buf), C.int(fQIPerSlicesPerPlmn_C.pDCPBytesUL.size))
567 fQIPerSlicesPerPlmn.PDCPBytesUL.Size = int(fQIPerSlicesPerPlmn_C.pDCPBytesUL.size)
572 cuUPPlmn.CUUPPM5GC = cuUPPM5GC
575 if cuUPPlmn_C.cu_UP_PM_EPC != nil {
576 cuUPPMEPC := &CUUPPMEPCType{}
577 cuUPPMEPC_C := (*C.EPC_CUUP_PM_Format_t)(cuUPPlmn_C.cu_UP_PM_EPC)
579 cuUPPMEPC.CUUPPMEPCPerQCIReportCount = int(cuUPPMEPC_C.perQCIReportList.list.count)
580 for l := 0; l < cuUPPMEPC.CUUPPMEPCPerQCIReportCount; l++ {
581 perQCIReport := cuUPPMEPC.CUUPPMEPCPerQCIReports[l]
582 var sizeof_PerQCIReportListItemFormat_t *C.PerQCIReportListItemFormat_t
583 perQCIReport_C := (*C.PerQCIReportListItemFormat_t)(unsafe.Pointer((uintptr)(unsafe.Pointer(cuUPPMEPC_C.perQCIReportList.list.array)) + (uintptr)(l)*unsafe.Sizeof(sizeof_PerQCIReportListItemFormat_t)))
585 perQCIReport.QCI = int64(perQCIReport_C.qci)
587 if perQCIReport_C.pDCPBytesDL != nil {
588 perQCIReport.PDCPBytesDL = &Integer{}
589 perQCIReport.PDCPBytesDL.Buf = C.GoBytes(unsafe.Pointer(perQCIReport_C.pDCPBytesDL.buf), C.int(perQCIReport_C.pDCPBytesDL.size))
590 perQCIReport.PDCPBytesDL.Size = int(perQCIReport_C.pDCPBytesDL.size)
593 if perQCIReport_C.pDCPBytesUL != nil {
594 perQCIReport.PDCPBytesUL = &Integer{}
595 perQCIReport.PDCPBytesUL.Buf = C.GoBytes(unsafe.Pointer(perQCIReport_C.pDCPBytesUL.buf), C.int(perQCIReport_C.pDCPBytesUL.size))
596 perQCIReport.PDCPBytesUL.Size = int(perQCIReport_C.pDCPBytesUL.size)
600 cuUPPlmn.CUUPPMEPC = cuUPPMEPC
605 pfContainer.Container = oCU_UP_PF
607 return indMsg, errors.New("Unknown PF Container type")
610 pmContainer.PFContainer = pfContainer
613 if pmContainer_C.theRANContainer != nil {
614 ranContainer := &RANContainerType{}
616 ranContainer.Timestamp.Buf = C.GoBytes(unsafe.Pointer(pmContainer_C.theRANContainer.timestamp.buf), C.int(pmContainer_C.theRANContainer.timestamp.size))
617 ranContainer.Timestamp.Size = int(pmContainer_C.theRANContainer.timestamp.size)
619 ranContainer.ContainerType = int32(pmContainer_C.theRANContainer.reportContainer.present)
621 if ranContainer.ContainerType == 1 {
622 oDU_UE := &DUUsageReportType{}
623 oDU_UE_C := (*C.DU_Usage_Report_Per_UE_t)(unsafe.Pointer(&pmContainer_C.theRANContainer.reportContainer.choice[0]))
625 oDU_UE.CellResourceReportItemCount = int(oDU_UE_C.cellResourceReportList.list.count)
626 for j := 0; j < oDU_UE.CellResourceReportItemCount; j++ {
627 cellResourceReport := oDU_UE.CellResourceReportItems[j]
628 var sizeof_DU_Usage_Report_CellResourceReportItem_t *C.DU_Usage_Report_CellResourceReportItem_t
629 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)))
631 cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
632 cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
634 cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
635 cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
636 cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
638 cellResourceReport.UeResourceReportItemCount = int(cellResourceReport_C.ueResourceReportList.list.count)
639 for k := 0; k < cellResourceReport.UeResourceReportItemCount; k++ {
640 ueResourceReport := cellResourceReport.UeResourceReportItems[k]
641 var sizeof_DU_Usage_Report_UeResourceReportItem_t *C.DU_Usage_Report_UeResourceReportItem_t
642 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)))
644 ueResourceReport.CRNTI.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.c_RNTI.buf), C.int(ueResourceReport_C.c_RNTI.size))
645 ueResourceReport.CRNTI.Size = int(ueResourceReport_C.c_RNTI.size)
647 if ueResourceReport_C.dl_PRBUsage != nil {
648 ueResourceReport.PRBUsageDL = int64(*ueResourceReport_C.dl_PRBUsage)
650 ueResourceReport.PRBUsageDL = -1
653 if ueResourceReport_C.ul_PRBUsage != nil {
654 ueResourceReport.PRBUsageUL = int64(*ueResourceReport_C.ul_PRBUsage)
656 ueResourceReport.PRBUsageUL = -1
661 ranContainer.Container = oDU_UE
662 } else if ranContainer.ContainerType == 2 {
663 oCU_CP_UE := &CUCPUsageReportType{}
664 oCU_CP_UE_C := (*C.CU_CP_Usage_Report_Per_UE_t)(unsafe.Pointer(&pmContainer_C.theRANContainer.reportContainer.choice[0]))
666 oCU_CP_UE.CellResourceReportItemCount = int(oCU_CP_UE_C.cellResourceReportList.list.count)
667 for j := 0; j < oCU_CP_UE.CellResourceReportItemCount; j++ {
668 cellResourceReport := oCU_CP_UE.CellResourceReportItems[j]
669 var sizeof_CU_CP_Usage_Report_CellResourceReportItem_t *C.CU_CP_Usage_Report_CellResourceReportItem_t
670 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)))
672 cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
673 cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
675 cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
676 cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
677 cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
679 cellResourceReport.UeResourceReportItemCount = int(cellResourceReport_C.ueResourceReportList.list.count)
680 for k := 0; k < cellResourceReport.UeResourceReportItemCount; k++ {
681 ueResourceReport := cellResourceReport.UeResourceReportItems[k]
682 var sizeof_CU_CP_Usage_Report_UeResourceReportItem_t *C.CU_CP_Usage_Report_UeResourceReportItem_t
683 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)))
685 ueResourceReport.CRNTI.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.c_RNTI.buf), C.int(ueResourceReport_C.c_RNTI.size))
686 ueResourceReport.CRNTI.Size = int(ueResourceReport_C.c_RNTI.size)
688 if ueResourceReport_C.serving_Cell_RF_Type != nil {
689 ueResourceReport.ServingCellRF = &OctetString{}
690 ueResourceReport.ServingCellRF.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.serving_Cell_RF_Type.buf), C.int(ueResourceReport_C.serving_Cell_RF_Type.size))
691 ueResourceReport.ServingCellRF.Size = int(ueResourceReport_C.serving_Cell_RF_Type.size)
694 if ueResourceReport_C.neighbor_Cell_RF != nil {
695 ueResourceReport.NeighborCellRF = &OctetString{}
696 ueResourceReport.NeighborCellRF.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.neighbor_Cell_RF.buf), C.int(ueResourceReport_C.neighbor_Cell_RF.size))
697 ueResourceReport.NeighborCellRF.Size = int(ueResourceReport_C.neighbor_Cell_RF.size)
702 ranContainer.Container = oCU_CP_UE
703 } else if ranContainer.ContainerType == 3 {
704 oCU_UP_UE := &CUUPUsageReportType{}
705 oCU_UP_UE_C := (*C.CU_UP_Usage_Report_Per_UE_t)(unsafe.Pointer(&pmContainer_C.theRANContainer.reportContainer.choice[0]))
707 oCU_UP_UE.CellResourceReportItemCount = int(oCU_UP_UE_C.cellResourceReportList.list.count)
708 for j := 0; j < oCU_UP_UE.CellResourceReportItemCount; j++ {
709 cellResourceReport := oCU_UP_UE.CellResourceReportItems[j]
710 var sizeof_CU_UP_Usage_Report_CellResourceReportItem_t *C.CU_UP_Usage_Report_CellResourceReportItem_t
711 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)))
713 cellResourceReport.NRCGI.PlmnID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.pLMN_Identity.buf), C.int(cellResourceReport_C.nRCGI.pLMN_Identity.size))
714 cellResourceReport.NRCGI.PlmnID.Size = int(cellResourceReport_C.nRCGI.pLMN_Identity.size)
716 cellResourceReport.NRCGI.NRCellID.Buf = C.GoBytes(unsafe.Pointer(cellResourceReport_C.nRCGI.nRCellIdentity.buf), C.int(cellResourceReport_C.nRCGI.nRCellIdentity.size))
717 cellResourceReport.NRCGI.NRCellID.Size = int(cellResourceReport_C.nRCGI.nRCellIdentity.size)
718 cellResourceReport.NRCGI.NRCellID.BitsUnused = int(cellResourceReport_C.nRCGI.nRCellIdentity.bits_unused)
720 cellResourceReport.UeResourceReportItemCount = int(cellResourceReport_C.ueResourceReportList.list.count)
721 for k := 0; k < cellResourceReport.UeResourceReportItemCount; k++ {
722 ueResourceReport := cellResourceReport.UeResourceReportItems[k]
723 var sizeof_CU_UP_Usage_Report_UeResourceReportItem_t *C.CU_UP_Usage_Report_UeResourceReportItem_t
724 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)))
726 ueResourceReport.CRNTI.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.c_RNTI.buf), C.int(ueResourceReport_C.c_RNTI.size))
727 ueResourceReport.CRNTI.Size = int(ueResourceReport_C.c_RNTI.size)
729 if ueResourceReport_C.pDCPBytesDL != nil {
730 ueResourceReport.PDCPBytesDL = &Integer{}
731 ueResourceReport.PDCPBytesDL.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.pDCPBytesDL.buf), C.int(ueResourceReport_C.pDCPBytesDL.size))
732 ueResourceReport.PDCPBytesDL.Size = int(ueResourceReport_C.pDCPBytesDL.size)
735 if ueResourceReport_C.pDCPBytesUL != nil {
736 ueResourceReport.PDCPBytesUL = &Integer{}
737 ueResourceReport.PDCPBytesUL.Buf = C.GoBytes(unsafe.Pointer(ueResourceReport_C.pDCPBytesUL.buf), C.int(ueResourceReport_C.pDCPBytesUL.size))
738 ueResourceReport.PDCPBytesUL.Size = int(ueResourceReport_C.pDCPBytesUL.size)
743 ranContainer.Container = oCU_UP_UE
745 return indMsg, errors.New("Unknown RAN Container type")
748 pmContainer.RANContainer = ranContainer
752 indMsg.IndMsg = indMsgFormat1
754 return indMsg, errors.New("Unknown RIC Indication Message Format")
760 func (c *E2sm) ParseNRCGI(nRCGI NRCGIType) (CellID string, err error) {
761 var plmnID OctetString
762 var nrCellID BitString
764 if plmnID.Size != 3 || nrCellID.Size != 5 {
765 return "", errors.New("Invalid input: illegal length of NRCGI")
768 plmnID = nRCGI.PlmnID
769 CellID, _ = c.ParsePLMNIdentity(plmnID.Buf, plmnID.Size)
771 nrCellID = nRCGI.NRCellID
772 var former []uint8 = make([]uint8, 3)
773 var latter []uint8 = make([]uint8, 6)
775 former[0] = nrCellID.Buf[0] >> 4
776 former[1] = nrCellID.Buf[0] & 0xf
777 former[2] = nrCellID.Buf[1] >> 4
778 latter[0] = nrCellID.Buf[1] & 0xf
779 latter[1] = nrCellID.Buf[2] >> 4
780 latter[2] = nrCellID.Buf[2] & 0xf
781 latter[3] = nrCellID.Buf[3] >> 4
782 latter[4] = nrCellID.Buf[3] & 0xf
783 latter[5] = nrCellID.Buf[4] >> uint(nrCellID.BitsUnused)
785 CellID = CellID + strconv.Itoa(int(former[0])) + strconv.Itoa(int(former[1])) + strconv.Itoa(int(former[2])) + strconv.Itoa(int(latter[0])) + strconv.Itoa(int(latter[1])) + strconv.Itoa(int(latter[2])) + strconv.Itoa(int(latter[3])) + strconv.Itoa(int(latter[4])) + strconv.Itoa(int(latter[5]))
790 func (c *E2sm) ParsePLMNIdentity(buffer []byte, size int) (PlmnID string, err error) {
792 return "", errors.New("Invalid input: illegal length of PlmnID")
795 var mcc []uint8 = make([]uint8, 3)
796 var mnc []uint8 = make([]uint8, 3)
798 mcc[0] = buffer[0] >> 4
799 mcc[1] = buffer[0] & 0xf
800 mcc[2] = buffer[1] >> 4
801 mnc[0] = buffer[1] & 0xf
802 mnc[1] = buffer[2] >> 4
803 mnc[2] = buffer[2] & 0xf
806 PlmnID = strconv.Itoa(int(mcc[0])) + strconv.Itoa(int(mcc[1])) + strconv.Itoa(int(mcc[2])) + strconv.Itoa(int(mnc[1])) + strconv.Itoa(int(mnc[2]))
808 PlmnID = strconv.Itoa(int(mcc[0])) + strconv.Itoa(int(mcc[1])) + strconv.Itoa(int(mcc[2])) + strconv.Itoa(int(mnc[0])) + strconv.Itoa(int(mnc[1])) + strconv.Itoa(int(mnc[2]))
814 func (c *E2sm) ParseSliceID(sliceID SliceIDType) (combined int32, err error) {
815 if sliceID.SST.Size != 1 || (sliceID.SD != nil && sliceID.SD.Size != 3) {
816 return 0, errors.New("Invalid input: illegal length of sliceID")
823 byteBuffer := bytes.NewBuffer(sliceID.SST.Buf)
824 binary.Read(byteBuffer, binary.BigEndian, &temp)
827 if sliceID.SD == nil {
830 for i := 0; i < sliceID.SD.Size; i++ {
831 byteBuffer = bytes.NewBuffer(sliceID.SD.Buf[i : i+1])
832 binary.Read(byteBuffer, binary.BigEndian, &temp)
833 sd = sd*256 + int32(temp)
835 combined = sst<<24 + sd
841 func (c *E2sm) ParseInteger(buffer []byte, size int) (value int64, err error) {
843 var byteBuffer *bytes.Buffer
845 for i := 0; i < size; i++ {
846 byteBuffer = bytes.NewBuffer(buffer[i : i+1])
847 binary.Read(byteBuffer, binary.BigEndian, &temp)
848 value = value*256 + int64(temp)
854 func (c *E2sm) ParseTimestamp(buffer []byte, size int) (timestamp *Timestamp, err error) {
856 var byteBuffer *bytes.Buffer
861 for index := 0; index < size-8; index++ {
862 byteBuffer = bytes.NewBuffer(buffer[index : index+1])
863 binary.Read(byteBuffer, binary.BigEndian, &temp)
864 sec = sec*256 + int64(temp)
867 for index = size - 8; index < size; index++ {
868 byteBuffer = bytes.NewBuffer(buffer[index : index+1])
869 binary.Read(byteBuffer, binary.BigEndian, &temp)
870 nsec = nsec*256 + int64(temp)
873 timestamp = &Timestamp{TVsec: sec, TVnsec: nsec}