Loading go-apps/meep-rnis/server/rnis.go +19 −20 Original line number Original line Diff line number Diff line /* /* * Copyright (c) 2020 InterDigital Communications, Inc * Copyright (c) 2022 InterDigital Communications, Inc * * * Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License. Loading Loading @@ -147,7 +147,7 @@ type UeData struct { Name string `json:"name"` Name string `json:"name"` ErabId int32 `json:"erabId"` ErabId int32 `json:"erabId"` Ecgi *Ecgi `json:"ecgi"` Ecgi *Ecgi `json:"ecgi"` Nrcgi *NRcgi `json:"nrcgi"` Nrcgi *Nrcgi `json:"nrcgi"` Qci int32 `json:"qci"` Qci int32 `json:"qci"` ParentPoaName string `json:"parentPoaName"` ParentPoaName string `json:"parentPoaName"` InRangePoas []InRangePoa `json:"inRangePoas"` InRangePoas []InRangePoa `json:"inRangePoas"` Loading Loading @@ -175,7 +175,7 @@ type AppStats struct { type PoaInfo struct { type PoaInfo struct { Type string `json:"type"` Type string `json:"type"` Ecgi Ecgi `json:"ecgi"` Ecgi Ecgi `json:"ecgi"` Nrcgi NRcgi `json:"nrcgi"` Nrcgi Nrcgi `json:"nrcgi"` Latency int32 `json:"latency"` Latency int32 `json:"latency"` ThroughputUL int32 `json:"throughputUL"` ThroughputUL int32 `json:"throughputUL"` ThroughputDL int32 `json:"throughputDL"` ThroughputDL int32 `json:"throughputDL"` Loading Loading @@ -713,8 +713,8 @@ func updateUeData(obj sbi.UeDataSbi) { newEcgi.CellId = obj.CellId newEcgi.CellId = obj.CellId newEcgi.Plmn = &plmn newEcgi.Plmn = &plmn var newNrcgi NRcgi var newNrcgi Nrcgi newNrcgi.NrcellId = obj.NrCellId newNrcgi.NrCellId = obj.NrCellId newNrcgi.Plmn = &plmn newNrcgi.Plmn = &plmn var ueData UeData var ueData UeData Loading Loading @@ -755,7 +755,7 @@ func updateUeData(obj sbi.UeDataSbi) { if ueDataObj.Nrcgi != nil { if ueDataObj.Nrcgi != nil { oldNrPlmnMnc = ueDataObj.Nrcgi.Plmn.Mnc oldNrPlmnMnc = ueDataObj.Nrcgi.Plmn.Mnc oldNrPlmnMcc = ueDataObj.Nrcgi.Plmn.Mcc oldNrPlmnMcc = ueDataObj.Nrcgi.Plmn.Mcc oldNrCellId = ueDataObj.Nrcgi.NrcellId oldNrCellId = ueDataObj.Nrcgi.NrCellId } } // Keep previous measurements // Keep previous measurements ueData.InRangePoas = ueDataObj.InRangePoas ueData.InRangePoas = ueDataObj.InRangePoas Loading Loading @@ -801,7 +801,7 @@ func updateUeData(obj sbi.UeDataSbi) { //keep erabId info that was there //keep erabId info that was there ueData.ErabId = oldErabId ueData.ErabId = oldErabId if newNrcgi.Plmn.Mnc != oldNrPlmnMnc || newNrcgi.Plmn.Mcc != oldNrPlmnMcc || newNrcgi.NrcellId != oldNrCellId { if newNrcgi.Plmn.Mnc != oldNrPlmnMnc || newNrcgi.Plmn.Mcc != oldNrPlmnMcc || newNrcgi.NrCellId != oldNrCellId { //update because nrcgi changed //update because nrcgi changed _ = rc.JSONSetEntry(baseKey+"UE:"+obj.Name, ".", convertUeDataToJson(&ueData)) _ = rc.JSONSetEntry(baseKey+"UE:"+obj.Name, ".", convertUeDataToJson(&ueData)) } } Loading Loading @@ -850,8 +850,8 @@ func updatePoaInfo(obj sbi.PoaInfoSbi) { ecgi.Plmn = &plmn ecgi.Plmn = &plmn poaInfo.Ecgi = ecgi poaInfo.Ecgi = ecgi case poaType5G: case poaType5G: var nrcgi NRcgi var nrcgi Nrcgi nrcgi.NrcellId = obj.CellId nrcgi.NrCellId = obj.CellId nrcgi.Plmn = &plmn nrcgi.Plmn = &plmn poaInfo.Nrcgi = nrcgi poaInfo.Nrcgi = nrcgi default: default: Loading Loading @@ -957,13 +957,13 @@ func checkForExpiredSubscriptions() { expiryTimeStamp.Seconds = int32(expiryTime) expiryTimeStamp.Seconds = int32(expiryTime) link := new(ExpiryNotificationLinks) link := new(ExpiryNotificationLinks) link.Self = cbRef link.Subscription.Href = cbRef notif.Links = link notif.Links = link notif.TimeStamp = &timeStamp notif.TimeStamp = &timeStamp notif.ExpiryDeadline = &expiryTimeStamp notif.ExpiryDeadline = &expiryTimeStamp sendExpiryNotification(link.Self, notif) sendExpiryNotification(link.Subscription.Href, notif) _ = delSubscription(baseKey, subsIdStr, true) _ = delSubscription(baseKey, subsIdStr, true) } } } } Loading Loading @@ -1460,13 +1460,13 @@ func isMatchNrMrFilterCriteriaNrcgi(filterCriteria interface{}, newPlmn *Plmn, o } } } } if matchingPlmn { if matchingPlmn { if nrcgi.NrcellId == "" { if nrcgi.NrCellId == "" { return true return true } } if newCellId == nrcgi.NrcellId { if newCellId == nrcgi.NrCellId { return true return true } } if oldCellId == nrcgi.NrcellId { if oldCellId == nrcgi.NrCellId { return true return true } } } } Loading Loading @@ -1871,7 +1871,7 @@ func checkMrNotificationRegisteredSubscriptions(key string, jsonInfo string, ext var measRepUeNotificationNrNCellInfo MeasRepUeNotificationNrNCellInfo var measRepUeNotificationNrNCellInfo MeasRepUeNotificationNrNCellInfo measRepUeNotificationNrNCellInfo.NrNCellPlmn = append(measRepUeNotificationNrNCellInfo.NrNCellPlmn, *poaInfo.Nrcgi.Plmn) measRepUeNotificationNrNCellInfo.NrNCellPlmn = append(measRepUeNotificationNrNCellInfo.NrNCellPlmn, *poaInfo.Nrcgi.Plmn) measRepUeNotificationNrNCellInfo.NrNCellGId = poaInfo.Nrcgi.NrcellId measRepUeNotificationNrNCellInfo.NrNCellGId = poaInfo.Nrcgi.NrCellId neighborCell.NrNCellInfo = append(neighborCell.NrNCellInfo, measRepUeNotificationNrNCellInfo) neighborCell.NrNCellInfo = append(neighborCell.NrNCellInfo, measRepUeNotificationNrNCellInfo) notif.NewRadioMeasNeiInfo = append(notif.NewRadioMeasNeiInfo, neighborCell) notif.NewRadioMeasNeiInfo = append(notif.NewRadioMeasNeiInfo, neighborCell) default: default: Loading Loading @@ -1914,7 +1914,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e return err return err } } if ueData.Nrcgi == nil || ueData.Nrcgi.NrcellId == "" { if ueData.Nrcgi == nil || ueData.Nrcgi.NrCellId == "" { //that ue is not on a 5G poa //that ue is not on a 5G poa return nil return nil } } Loading @@ -1937,7 +1937,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e if match { if match { if ueData.Nrcgi != nil { if ueData.Nrcgi != nil { match = isMatchFilterCriteriaNrcgi(nrMeasRepUeSubscriptionType, sub.FilterCriteriaNrMrs, ueData.Nrcgi.Plmn, nil, ueData.Nrcgi.NrcellId, "") match = isMatchFilterCriteriaNrcgi(nrMeasRepUeSubscriptionType, sub.FilterCriteriaNrMrs, ueData.Nrcgi.Plmn, nil, ueData.Nrcgi.NrCellId, "") } else { } else { match = false match = false } } Loading Loading @@ -2002,8 +2002,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e switch poaInfo.Type { switch poaInfo.Type { case poaType5G: case poaType5G: var neighborCell NrMeasRepUeNotificationNrNeighCellMeasInfo var neighborCell NrMeasRepUeNotificationNrNeighCellMeasInfo //not using nrcgi but nrcellId, error in the spec... but going along neighborCell.Nrcgi = &poaInfo.Nrcgi neighborCell.Nrcgi = poaInfo.Nrcgi.NrcellId var measQuantityResultsNr MeasQuantityResultsNr var measQuantityResultsNr MeasQuantityResultsNr measQuantityResultsNr.Rsrp = poa.Rsrp measQuantityResultsNr.Rsrp = poa.Rsrp measQuantityResultsNr.Rsrq = poa.Rsrq measQuantityResultsNr.Rsrq = poa.Rsrq Loading Loading @@ -2463,7 +2462,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { } } for _, nrcgi := range subscription.FilterCriteriaNrMrs.Nrcgi { for _, nrcgi := range subscription.FilterCriteriaNrMrs.Nrcgi { if nrcgi.Plmn == nil || nrcgi.NrcellId == "" { if nrcgi.Plmn == nil || nrcgi.NrCellId == "" { log.Error("For non null nrcgi, plmn and cellId are mandatory") log.Error("For non null nrcgi, plmn and cellId are mandatory") http.Error(w, "For non null nrcgi, plmn and cellId are mandatory", http.StatusBadRequest) http.Error(w, "For non null nrcgi, plmn and cellId are mandatory", http.StatusBadRequest) return return Loading Loading
go-apps/meep-rnis/server/rnis.go +19 −20 Original line number Original line Diff line number Diff line /* /* * Copyright (c) 2020 InterDigital Communications, Inc * Copyright (c) 2022 InterDigital Communications, Inc * * * Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License. Loading Loading @@ -147,7 +147,7 @@ type UeData struct { Name string `json:"name"` Name string `json:"name"` ErabId int32 `json:"erabId"` ErabId int32 `json:"erabId"` Ecgi *Ecgi `json:"ecgi"` Ecgi *Ecgi `json:"ecgi"` Nrcgi *NRcgi `json:"nrcgi"` Nrcgi *Nrcgi `json:"nrcgi"` Qci int32 `json:"qci"` Qci int32 `json:"qci"` ParentPoaName string `json:"parentPoaName"` ParentPoaName string `json:"parentPoaName"` InRangePoas []InRangePoa `json:"inRangePoas"` InRangePoas []InRangePoa `json:"inRangePoas"` Loading Loading @@ -175,7 +175,7 @@ type AppStats struct { type PoaInfo struct { type PoaInfo struct { Type string `json:"type"` Type string `json:"type"` Ecgi Ecgi `json:"ecgi"` Ecgi Ecgi `json:"ecgi"` Nrcgi NRcgi `json:"nrcgi"` Nrcgi Nrcgi `json:"nrcgi"` Latency int32 `json:"latency"` Latency int32 `json:"latency"` ThroughputUL int32 `json:"throughputUL"` ThroughputUL int32 `json:"throughputUL"` ThroughputDL int32 `json:"throughputDL"` ThroughputDL int32 `json:"throughputDL"` Loading Loading @@ -713,8 +713,8 @@ func updateUeData(obj sbi.UeDataSbi) { newEcgi.CellId = obj.CellId newEcgi.CellId = obj.CellId newEcgi.Plmn = &plmn newEcgi.Plmn = &plmn var newNrcgi NRcgi var newNrcgi Nrcgi newNrcgi.NrcellId = obj.NrCellId newNrcgi.NrCellId = obj.NrCellId newNrcgi.Plmn = &plmn newNrcgi.Plmn = &plmn var ueData UeData var ueData UeData Loading Loading @@ -755,7 +755,7 @@ func updateUeData(obj sbi.UeDataSbi) { if ueDataObj.Nrcgi != nil { if ueDataObj.Nrcgi != nil { oldNrPlmnMnc = ueDataObj.Nrcgi.Plmn.Mnc oldNrPlmnMnc = ueDataObj.Nrcgi.Plmn.Mnc oldNrPlmnMcc = ueDataObj.Nrcgi.Plmn.Mcc oldNrPlmnMcc = ueDataObj.Nrcgi.Plmn.Mcc oldNrCellId = ueDataObj.Nrcgi.NrcellId oldNrCellId = ueDataObj.Nrcgi.NrCellId } } // Keep previous measurements // Keep previous measurements ueData.InRangePoas = ueDataObj.InRangePoas ueData.InRangePoas = ueDataObj.InRangePoas Loading Loading @@ -801,7 +801,7 @@ func updateUeData(obj sbi.UeDataSbi) { //keep erabId info that was there //keep erabId info that was there ueData.ErabId = oldErabId ueData.ErabId = oldErabId if newNrcgi.Plmn.Mnc != oldNrPlmnMnc || newNrcgi.Plmn.Mcc != oldNrPlmnMcc || newNrcgi.NrcellId != oldNrCellId { if newNrcgi.Plmn.Mnc != oldNrPlmnMnc || newNrcgi.Plmn.Mcc != oldNrPlmnMcc || newNrcgi.NrCellId != oldNrCellId { //update because nrcgi changed //update because nrcgi changed _ = rc.JSONSetEntry(baseKey+"UE:"+obj.Name, ".", convertUeDataToJson(&ueData)) _ = rc.JSONSetEntry(baseKey+"UE:"+obj.Name, ".", convertUeDataToJson(&ueData)) } } Loading Loading @@ -850,8 +850,8 @@ func updatePoaInfo(obj sbi.PoaInfoSbi) { ecgi.Plmn = &plmn ecgi.Plmn = &plmn poaInfo.Ecgi = ecgi poaInfo.Ecgi = ecgi case poaType5G: case poaType5G: var nrcgi NRcgi var nrcgi Nrcgi nrcgi.NrcellId = obj.CellId nrcgi.NrCellId = obj.CellId nrcgi.Plmn = &plmn nrcgi.Plmn = &plmn poaInfo.Nrcgi = nrcgi poaInfo.Nrcgi = nrcgi default: default: Loading Loading @@ -957,13 +957,13 @@ func checkForExpiredSubscriptions() { expiryTimeStamp.Seconds = int32(expiryTime) expiryTimeStamp.Seconds = int32(expiryTime) link := new(ExpiryNotificationLinks) link := new(ExpiryNotificationLinks) link.Self = cbRef link.Subscription.Href = cbRef notif.Links = link notif.Links = link notif.TimeStamp = &timeStamp notif.TimeStamp = &timeStamp notif.ExpiryDeadline = &expiryTimeStamp notif.ExpiryDeadline = &expiryTimeStamp sendExpiryNotification(link.Self, notif) sendExpiryNotification(link.Subscription.Href, notif) _ = delSubscription(baseKey, subsIdStr, true) _ = delSubscription(baseKey, subsIdStr, true) } } } } Loading Loading @@ -1460,13 +1460,13 @@ func isMatchNrMrFilterCriteriaNrcgi(filterCriteria interface{}, newPlmn *Plmn, o } } } } if matchingPlmn { if matchingPlmn { if nrcgi.NrcellId == "" { if nrcgi.NrCellId == "" { return true return true } } if newCellId == nrcgi.NrcellId { if newCellId == nrcgi.NrCellId { return true return true } } if oldCellId == nrcgi.NrcellId { if oldCellId == nrcgi.NrCellId { return true return true } } } } Loading Loading @@ -1871,7 +1871,7 @@ func checkMrNotificationRegisteredSubscriptions(key string, jsonInfo string, ext var measRepUeNotificationNrNCellInfo MeasRepUeNotificationNrNCellInfo var measRepUeNotificationNrNCellInfo MeasRepUeNotificationNrNCellInfo measRepUeNotificationNrNCellInfo.NrNCellPlmn = append(measRepUeNotificationNrNCellInfo.NrNCellPlmn, *poaInfo.Nrcgi.Plmn) measRepUeNotificationNrNCellInfo.NrNCellPlmn = append(measRepUeNotificationNrNCellInfo.NrNCellPlmn, *poaInfo.Nrcgi.Plmn) measRepUeNotificationNrNCellInfo.NrNCellGId = poaInfo.Nrcgi.NrcellId measRepUeNotificationNrNCellInfo.NrNCellGId = poaInfo.Nrcgi.NrCellId neighborCell.NrNCellInfo = append(neighborCell.NrNCellInfo, measRepUeNotificationNrNCellInfo) neighborCell.NrNCellInfo = append(neighborCell.NrNCellInfo, measRepUeNotificationNrNCellInfo) notif.NewRadioMeasNeiInfo = append(notif.NewRadioMeasNeiInfo, neighborCell) notif.NewRadioMeasNeiInfo = append(notif.NewRadioMeasNeiInfo, neighborCell) default: default: Loading Loading @@ -1914,7 +1914,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e return err return err } } if ueData.Nrcgi == nil || ueData.Nrcgi.NrcellId == "" { if ueData.Nrcgi == nil || ueData.Nrcgi.NrCellId == "" { //that ue is not on a 5G poa //that ue is not on a 5G poa return nil return nil } } Loading @@ -1937,7 +1937,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e if match { if match { if ueData.Nrcgi != nil { if ueData.Nrcgi != nil { match = isMatchFilterCriteriaNrcgi(nrMeasRepUeSubscriptionType, sub.FilterCriteriaNrMrs, ueData.Nrcgi.Plmn, nil, ueData.Nrcgi.NrcellId, "") match = isMatchFilterCriteriaNrcgi(nrMeasRepUeSubscriptionType, sub.FilterCriteriaNrMrs, ueData.Nrcgi.Plmn, nil, ueData.Nrcgi.NrCellId, "") } else { } else { match = false match = false } } Loading Loading @@ -2002,8 +2002,7 @@ func checkNrMrNotificationRegisteredSubscriptions(key string, jsonInfo string, e switch poaInfo.Type { switch poaInfo.Type { case poaType5G: case poaType5G: var neighborCell NrMeasRepUeNotificationNrNeighCellMeasInfo var neighborCell NrMeasRepUeNotificationNrNeighCellMeasInfo //not using nrcgi but nrcellId, error in the spec... but going along neighborCell.Nrcgi = &poaInfo.Nrcgi neighborCell.Nrcgi = poaInfo.Nrcgi.NrcellId var measQuantityResultsNr MeasQuantityResultsNr var measQuantityResultsNr MeasQuantityResultsNr measQuantityResultsNr.Rsrp = poa.Rsrp measQuantityResultsNr.Rsrp = poa.Rsrp measQuantityResultsNr.Rsrq = poa.Rsrq measQuantityResultsNr.Rsrq = poa.Rsrq Loading Loading @@ -2463,7 +2462,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { } } for _, nrcgi := range subscription.FilterCriteriaNrMrs.Nrcgi { for _, nrcgi := range subscription.FilterCriteriaNrMrs.Nrcgi { if nrcgi.Plmn == nil || nrcgi.NrcellId == "" { if nrcgi.Plmn == nil || nrcgi.NrCellId == "" { log.Error("For non null nrcgi, plmn and cellId are mandatory") log.Error("For non null nrcgi, plmn and cellId are mandatory") http.Error(w, "For non null nrcgi, plmn and cellId are mandatory", http.StatusBadRequest) http.Error(w, "For non null nrcgi, plmn and cellId are mandatory", http.StatusBadRequest) return return Loading