blob: 32209db2c9f292fd1f1b9b2ac060c0127d28171f [file] [log] [blame]
rajalakshmisvb8bc34d2022-01-03 06:14:50 +00001package control
rajalakshmisv21b61dd2021-12-07 04:53:03 +00002
3import (
4 "errors"
5 "fmt"
rajalakshmisv21b61dd2021-12-07 04:53:03 +00006 "log"
7 "os"
8 "strconv"
9 "sync"
10 "time"
rajalakshmisv960885a2022-05-31 14:59:10 +000011
12 "gerrit.o-ran-sc.org/r/ric-app/rc/protocol/grpc/ricmsgcommrpc/rc"
13 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
rajalakshmisv21b61dd2021-12-07 04:53:03 +000014)
15
16var (
17 gControlData *Control
18 gChan_RicControlReq_handle = make(chan *rc.RicControlGrpcReq, 2000) //Make it configurable
19)
20
21func NewControl() Control {
22
23 file := "/opt/rc.log"
24 logFile, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0766)
25 if err != nil {
26 panic(err)
27 }
28 log.SetOutput(logFile)
29 log.SetPrefix("[qSkipTool]")
30 log.SetFlags(log.LstdFlags | log.Lshortfile | log.LUTC)
31 logLevel := xapp.Config.GetInt("controls.logLevel")
32 xapp.Logger.SetLevel(logLevel)
33
34 xapp.Logger.Debug("GRPC Server Port = %v ", xapp.Config.GetString("controls.ricHOControlgRpcServerPort"))
35 xapp.Logger.Debug("Log Level = %d ", xapp.Config.GetInt("controls.logLevel"))
36
rajalakshmisv960885a2022-05-31 14:59:10 +000037 go StartgRPCRCControlCommServerRoutine()
38 xapp.Logger.Debug("StartgRPCRCControlCommServerRoutine done")
39
40 //To Handle RIC Control Message
41 go StartHandleControlReqRoutine()
42
rajalakshmisv21b61dd2021-12-07 04:53:03 +000043 return Control{5,
44 make(chan *xapp.RMRParams, 1000), //Make it configurable
45 make(map[int]bool),
46 &sync.Mutex{},
47 0}
48}
49
50func ReadyCB(i interface{}) {
51 gControlData = i.(*Control)
rajalakshmisv21b61dd2021-12-07 04:53:03 +000052 go controlLoop()
rajalakshmisv21b61dd2021-12-07 04:53:03 +000053}
54
55func (aControlData *Control) Run() {
56 xapp.SetReadyCB(ReadyCB, aControlData)
57 xapp.Run(aControlData)
58}
59
60func (aControlData *Control) Consume(rp *xapp.RMRParams) (err error) {
61 gControlData.rcChan <- rp
62 return
63}
64
65func (aControlData *Control) rmrSend(params *xapp.RMRParams) (err error) {
66 if !xapp.Rmr.Send(params, false) {
67 err = errors.New("rmr.Send() failed")
rajalakshmisv960885a2022-05-31 14:59:10 +000068 xapp.Logger.Info("Failed to rmrSend to %v", err)
rajalakshmisv21b61dd2021-12-07 04:53:03 +000069 log.Printf("Failed to rmrSend to %v", err)
70 }
71 return
72}
73
74func (aControlData *Control) rmrReplyToSender(params *xapp.RMRParams) (err error) {
75 if !xapp.Rmr.Send(params, true) {
76 err = errors.New("rmr.Send() failed")
77 xapp.Logger.Error("Failed to rmrReplyToSender to %v", err)
78 log.Printf("Failed to rmrReplyToSender to %v", err)
79 }
80 return
81}
82
83func controlLoop() {
84 for {
85 msg := <-gControlData.rcChan
86 xapp.Logger.Debug("Received message type: %d", msg.Mtype)
87 log.Printf("Received message type: %d", msg.Mtype)
88 switch msg.Mtype {
89 case 12041:
90 go HandleControlResponse(msg)
91 case 12042:
92 go HandleControlFailure(msg)
93 default:
94 err := errors.New("Message Type " + strconv.Itoa(msg.Mtype) + " is discarded")
95 xapp.Logger.Error("Unknown message type: %v", err)
96 log.Printf("Unknown message type: %v", err)
97 }
98 }
99}
100
101func StartHandleControlReqRoutine() {
102
103 log.Printf("Starting Go Routine for Handling GRPC RIC Control msg ")
104 xapp.Logger.Info("Starting Go Routine for Handling GRPC RIC Control msg ")
105 for {
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000106 HandlegRPCRICControlMsgReq(<-gChan_RicControlReq_handle)
107 }
108 xapp.Logger.Debug("StartHandleControlReqRoutine Done")
109}
110
111func HandlegRPCRICControlMsgReq(aPtrRicControlGrpcReq *rc.RicControlGrpcReq) {
112
rajalakshmisv960885a2022-05-31 14:59:10 +0000113 xapp.Logger.Debug("HandlegRPCRICControlMsgReq :%v", *aPtrRicControlGrpcReq)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000114 lRicHoControlMsg := RicHoControlMsg{}
115 lRicHoControlMsg.RicControlGrpcReqPtr = aPtrRicControlGrpcReq
116
117 lUEID := lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID
rajalakshmisv960885a2022-05-31 14:59:10 +0000118 xapp.Logger.Debug("HandlegRPCRICControlMsgReq UEID = %v ", lUEID)
119 //Mandatory parameters validation
120 if lRicHoControlMsg.RicControlGrpcReqPtr.E2NodeID == "" ||
121 lRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.TargetCellID == "" ||
122 lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID.GnbUEID.AmfUENGAPID < 0 ||
123 lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID.GnbUEID.Guami.PLMNIdentity == "" ||
124 lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID.GnbUEID.Guami.AMFRegionID == "" ||
125 lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID.GnbUEID.Guami.AMFSetID == "" ||
126 lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID.GnbUEID.Guami.AMFPointer == "" ||
127 len(lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID.GnbUEID.GNBCUUEF1APID) == 0 ||
128 len(lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID.GnbUEID.GNBCUCPUEE1APID) == 0 ||
129 lRicHoControlMsg.RicControlGrpcReqPtr.PlmnID == "" ||
130 lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.ControlActionId < 0 ||
131 lRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.ControlStyle < 0 ||
132 lRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.RICControlCellTypeVal < 0 ||
133 lRicHoControlMsg.RicControlGrpcReqPtr.RICE2APHeaderData.RICRequestorID < 0 ||
134 lRicHoControlMsg.RicControlGrpcReqPtr.RICE2APHeaderData.RanFuncId < 0 {
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000135 xapp.Logger.Error("Mandaroty parameters missing, dont send control request ")
136 return
137 }
138
139 lRicHoControlMsg.GetSequenceNumber()
140
141 go lRicHoControlMsg.SendRicControlRequest(lRicHoControlMsg.GetSequenceNumber())
142
143 return
144}
145
146func (aRicHoControlMsg *RicHoControlMsg) GetSequenceNumber() int {
147
148 //Incrementing the RIC Requestor Instance Id to make the request unique and traceable.
149 gControlData.eventRicControlReqExpiredMu.Lock()
150 gControlData.ricRequestInstanceID = gControlData.ricRequestInstanceID + 1
151 gControlData.eventRicControlReqExpiredMu.Unlock()
152
153 return gControlData.ricRequestInstanceID
154}
155
156func (aRicHoControlMsg *RicHoControlMsg) setEventRicControlCreateExpiredTimer(aSeqNum int) {
157
158 gControlData.eventRicControlReqExpiredMu.Lock()
159 gControlData.eventRicControlReqExpiredMap[aSeqNum] = false
160 gControlData.eventRicControlReqExpiredMu.Unlock()
rajalakshmisv960885a2022-05-31 14:59:10 +0000161 controlAckTimer := xapp.Config.GetInt("controls.controlAckTimer")
162 xapp.Logger.Debug("configured controlAckTimer = %d and controlAckTimer = %d ", xapp.Config.GetInt("controls.controlAckTimer"),controlAckTimer)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000163
rajalakshmisv960885a2022-05-31 14:59:10 +0000164 timer := time.NewTimer(time.Duration(controlAckTimer) * time.Second)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000165 go func(t *time.Timer) {
166 defer t.Stop()
167 xapp.Logger.Debug("RIC_CONTROL_REQ[%s]: Waiting for RIC_CONTROL_RESP...", aSeqNum)
168 log.Printf("RIC_CONTROL_REQ[%s]: Waiting for RIC_CONTROL_RESP...", aSeqNum)
169 for {
170 select {
171 case <-t.C:
172 gControlData.eventRicControlReqExpiredMu.Lock()
173 isResponsed := gControlData.eventRicControlReqExpiredMap[aSeqNum]
174 delete(gControlData.eventRicControlReqExpiredMap, aSeqNum)
175 gControlData.eventRicControlReqExpiredMu.Unlock()
176 if !isResponsed {
177 xapp.Logger.Debug("RIC_CONTROL_REQ[%s]: RIC Event Create Timer experied!", aSeqNum)
178 log.Printf("RIC_CONTROL_REQ[%s]: RIC Event Create Timer experied!", aSeqNum)
179 //Send ErrorIndication message on Timeout
180 return
181 }
182 default:
183 gControlData.eventRicControlReqExpiredMu.Lock()
184 flag := gControlData.eventRicControlReqExpiredMap[aSeqNum]
185 if flag {
186 delete(gControlData.eventRicControlReqExpiredMap, aSeqNum)
187 gControlData.eventRicControlReqExpiredMu.Unlock()
188 xapp.Logger.Debug("RIC_CONTROL_REQ[%s]: RIC Event Create Timer canceled!", aSeqNum)
189 log.Printf("RIC_CONTROL_REQ[%s]: RIC Event Create Timer canceled!", aSeqNum)
190 return
191 } else {
192 gControlData.eventRicControlReqExpiredMu.Unlock()
193 }
194 }
195 time.Sleep(100 * time.Millisecond)
196 }
197 }(timer)
198}
199func (aRicHoControlMsg *RicHoControlMsg) SendRicControlRequest(aRequestSN int) (err error) {
200 var e2ap *E2ap
201 var e2sm *E2sm
202
203 xapp.Logger.Info("SendRicControlRequest Enter for RanName = %s", aRicHoControlMsg.RicControlGrpcReqPtr.RanName)
204
205 if aRicHoControlMsg.RicControlGrpcReqPtr == nil {
206 return err
207 }
208
209 var lRicControlStyleType int64 = aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.ControlStyle
210 var lRicControlActionID int64 = aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.ControlActionId
211 lUEID := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID
212
rajalakshmisv960885a2022-05-31 14:59:10 +0000213 var ueId_data UEid
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000214
rajalakshmisv960885a2022-05-31 14:59:10 +0000215 xapp.Logger.Debug("UEID:%v, ueId_data strct :%v", aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID,
216 ueId_data)
217 ueId_data.amf_UE_NGAP_Id = lUEID.GnbUEID.AmfUENGAPID
218 ueId_data.pLMNIdentitybuf = lUEID.GnbUEID.Guami.PLMNIdentity
219 ueId_data.aMFRegionIDbuf = lUEID.GnbUEID.Guami.AMFRegionID
220 ueId_data.aMFSetIDbuf = lUEID.GnbUEID.Guami.AMFSetID
221 ueId_data.aMFPointerbuf = lUEID.GnbUEID.Guami.AMFPointer
222 ueId_data.F1AP_id = lUEID.GnbUEID.GNBCUUEF1APID
223 ueId_data.E1AP_id = lUEID.GnbUEID.GNBCUCPUEE1APID
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000224
rajalakshmisv960885a2022-05-31 14:59:10 +0000225 var lRicControlHeader []byte = make([]byte, 1024) //Check the Size
226 lRicControlHeaderEncoded, err := e2sm.SetRicControlHeader(lRicControlHeader, &ueId_data, lRicControlStyleType, lRicControlActionID)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000227 if err != nil {
rajalakshmisv960885a2022-05-31 14:59:10 +0000228 xapp.Logger.Error("SetRicControlHeader Failed: %v, UEID:%v", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
229 log.Printf("SetRicControlHeader Failed: %v, UEID:%v", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000230 return err
231 } else {
232 xapp.Logger.Info("SetRicControlHeader is success: %x", lRicControlHeaderEncoded)
233 fmt.Fprintf(os.Stderr, "Encoded RIC Control Header PDU:\n")
234 for i := 0; i < len(lRicControlHeaderEncoded); i++ {
235 fmt.Fprintf(os.Stderr, " %02x", lRicControlHeaderEncoded[i])
236 }
237 fmt.Fprintf(os.Stderr, "\n")
238 }
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000239 var lTargetPrimaryCell int64 = RIC_CONTROL_TARGET_PRIMARY_CELL
240 var lTargetCell int64 = RIC_CONTROL_TARGET_CELL
241 var lNrCGIOrECGI int64 = RIC_CONTROL_CGI_TYPE
242
243 lNrOrEUtraCellType := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.RICControlCellTypeVal
244 lTargetCellVal := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.TargetCellID
245 lTargetCellValBuf := []byte(lTargetCellVal)
rajalakshmisv960885a2022-05-31 14:59:10 +0000246 //lNRPlmnId := []byte(aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.TargetCellID.PlmnID)
247 //lNRCellId := aRicHoControlMsg.RicControlGrpcReqPtr.RICControlMessageData.TargetCellID.NRCellID
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000248
rajalakshmisv960885a2022-05-31 14:59:10 +0000249
250 var lRicControlMessage []byte = make([]byte, 1024)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000251 lRicControlMessageEncoded, err := e2sm.SetRicControlMessage(lRicControlMessage, lTargetPrimaryCell, lTargetCell, lNrCGIOrECGI, int64(lNrOrEUtraCellType), lTargetCellValBuf)
252 if err != nil {
rajalakshmisv960885a2022-05-31 14:59:10 +0000253 xapp.Logger.Error("SetRicControlMessage Failed: %v, UEID:%v", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
254 log.Printf("SetRicControlMessage Failed: %v, UEID:%v", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000255 return err
256 } else {
257 xapp.Logger.Debug("SetRicControlMessage is success: %x", lRicControlMessageEncoded)
258 fmt.Fprintf(os.Stderr, "Encoded RIC Control Message PDU:\n")
259 for i := 0; i < len(lRicControlMessageEncoded); i++ {
260 fmt.Fprintf(os.Stderr, " %02x", lRicControlMessageEncoded[i])
261 }
262 fmt.Fprintf(os.Stderr, "\n")
263 }
264
265 lParams := &xapp.RMRParams{}
266 lParams.Mtype = 12040 //RIC_CONTROL_REQ
267 lParams.SubId = -1
268
269 var lRequestorId uint16 = uint16(aRicHoControlMsg.RicControlGrpcReqPtr.RICE2APHeaderData.RICRequestorID)
270 var lFuncId uint16 = uint16(aRicHoControlMsg.RicControlGrpcReqPtr.RICE2APHeaderData.RanFuncId)
271
272 lParams.Payload = make([]byte, 2048)
273 lParams.Payload, err = e2ap.SetRicControlRequestPayload(lParams.Payload, lRequestorId, uint16(aRequestSN), lFuncId,
274 lRicControlHeaderEncoded, lRicControlMessageEncoded)
275 if err != nil {
rajalakshmisv960885a2022-05-31 14:59:10 +0000276 xapp.Logger.Error("SetRicControlRequestPayload Failed: %v, UEID:%v", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
277 log.Printf("SetRicControlRequestPayload Failed: %v, UEID:%v", err, aRicHoControlMsg.RicControlGrpcReqPtr.RICControlHeaderData.UEID)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000278 return err
279 } else {
rajalakshmisv960885a2022-05-31 14:59:10 +0000280
281 xapp.Logger.Debug("Encoding RicControlRequestPayload is success. UEID: %v, Payload: %x", lUEID, lParams.Payload)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000282 fmt.Fprintf(os.Stderr, "Encoded RIC Control Req PDU:\n")
283 for i := 0; i < len(lParams.Payload); i++ {
284 fmt.Fprintf(os.Stderr, " %02x", lParams.Payload[i])
285 }
286 fmt.Fprintf(os.Stderr, "\n")
287 }
rajalakshmisv960885a2022-05-31 14:59:10 +0000288 lParams.PayloadLen = len(lParams.Payload)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000289 valEnbId := aRicHoControlMsg.RicControlGrpcReqPtr.E2NodeID
290 valRanName := aRicHoControlMsg.RicControlGrpcReqPtr.RanName
291 valPlmnId := aRicHoControlMsg.RicControlGrpcReqPtr.PlmnID
292 lParams.Meid = &xapp.RMRMeid{PlmnID: valPlmnId, EnbID: valEnbId, RanName: valRanName}
293
rajalakshmisv960885a2022-05-31 14:59:10 +0000294 xapp.Logger.Debug("The RIC Control RMR message to be sent is with MsgType:%d SubId=%d, lParams.Meid: %v, UEID: %v", lParams.Mtype, lParams.SubId, lParams.Meid, lUEID)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000295
rajalakshmisv960885a2022-05-31 14:59:10 +0000296 xapp.Logger.Debug("Sending RIC Control message to RanName: %s, UEID: %v ", aRicHoControlMsg.RicControlGrpcReqPtr.RanName, lUEID)
297
298 xapp.Logger.Info("lParams %v ",lParams)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000299 err = gControlData.rmrSend(lParams)
300 if err != nil {
301 xapp.Logger.Error("Failed to send RIC_CONTROL_REQ: %v", err)
302 log.Printf("Failed to send RIC_CONTROL_REQ: %v", err)
rajalakshmisv960885a2022-05-31 14:59:10 +0000303 xapp.Logger.Info("Failed to send RIC_CONTROL_REQ: %v", err)
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000304 return err
305 }
306
rajalakshmisv960885a2022-05-31 14:59:10 +0000307 xapp.Logger.Info("Sending RIC Control message to RanName: %s, UEID: %v Success", aRicHoControlMsg.RicControlGrpcReqPtr.RanName, lUEID)
308 //Start Timer Operation.
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000309 aRicHoControlMsg.setEventRicControlCreateExpiredTimer(aRequestSN) //TODO check if this is required as we are not expecting Control ACK
310
311 return nil
312}
313
314func HandleControlResponse(params *xapp.RMRParams) (err error) {
rajalakshmisv960885a2022-05-31 14:59:10 +0000315
316 var e2ap *E2ap
317 var e2sm *E2sm
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000318 xapp.Logger.Debug("The SubId in RIC_CONTROL_RESP is %d", params.SubId)
319 log.Printf("The SubId in RIC_CONTROL_RESP is %d", params.SubId)
320
rajalakshmisv960885a2022-05-31 14:59:10 +0000321
322
323 //Decode the RIC Control Ack message
324 controlAck, err := e2ap.GetControlAckMsg(params.Payload)
325 if err != nil {
326 xapp.Logger.Error("Failed to decode RIC Control Ack: %v", err)
327 log.Println("Failed to decode RIC Control Ack: %v", err)
328 return
329 }
330 log.Println("E2ap RIC RIC Control Ack message decoded \n")
331 xapp.Logger.Info("E2ap RIC RIC Control Ack message decoded \n")
332 gControlData.eventRicControlReqExpiredMu.Lock()
333 _,ok := gControlData.eventRicControlReqExpiredMap[int(controlAck.InstanceId)]
334 if !ok {
335 gControlData.eventRicControlReqExpiredMu.Unlock()
336 xapp.Logger.Debug("RIC_CONTROL_REQ has been deleted!")
337 log.Printf("RIC_CONTROL_REQ has been deleted!")
338 return nil
339 } else {
340 gControlData.eventRicControlReqExpiredMap[int(controlAck.InstanceId)] = true
341 gControlData.eventRicControlReqExpiredMu.Unlock()
342 }
343
344 controlOutcome, err := e2sm.GetControlOutcome(controlAck.ControlOutcome)
345 if err != nil {
346 xapp.Logger.Error("Failed to decode RIC Control Outcome: %v", err)
347 log.Println("Failed to decode RIC Control Outcome: %v", err)
348 return
349 }
350 log.Println("E2SM-RC RIC Control Outcome decoded \n",controlOutcome)
351 xapp.Logger.Info("E2SM-RC RIC Control Outcome decoded \n",controlOutcome)
352
353
354
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000355 return nil
356}
357
358func HandleControlFailure(params *xapp.RMRParams) (err error) {
359
rajalakshmisv90fe2322022-06-30 14:00:14 +0000360 var e2ap *E2ap
361
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000362 xapp.Logger.Debug("The SubId in RIC_CONTROL_FAILURE is %d", params.SubId)
363 log.Printf("The SubId in RIC_CONTROL_FAILURE is %d", params.SubId)
364
rajalakshmisv90fe2322022-06-30 14:00:14 +0000365 controlAck, err := e2ap.GetControlFailureMsg(params.Payload)
366 if err != nil {
367 xapp.Logger.Debug("Failed to decode RIC Control message: %v", err)
368 log.Println("Failed to decode RIC Control Ack: %v", err)
369 return
370 }
371 log.Println("E2ap RIC Control Ack message decoded \n")
372 xapp.Logger.Debug("E2ap RIC Control Ack message decoded \n")
373
374 gControlData.eventRicControlReqExpiredMu.Lock()
375 _, ok := gControlData.eventRicControlReqExpiredMap[int(controlAck.InstanceId)]
376 if !ok {
377 gControlData.eventRicControlReqExpiredMu.Unlock()
378 xapp.Logger.Debug("RIC_CONTROL_REQ has been deleted!")
379 log.Printf("RIC_CONTROL_REQ has been deleted!")
380 return nil
381 } else {
382 gControlData.eventRicControlReqExpiredMap[int(controlAck.InstanceId)] = true
383 gControlData.eventRicControlReqExpiredMu.Unlock()
384 }
rajalakshmisv21b61dd2021-12-07 04:53:03 +0000385 return nil
386}