Loading go-apps/meep-loc-serv/server/loc-serv.go +41 −14 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ const USER_TRACKING_AND_ZONAL_TRAFFIC = 1 const ZONE_STATUS = 2 type UeUserData struct { queryZoneId string queryApId string queryAddress string queryZoneId []string queryApId []string queryAddress []string userList *UserList } Loading Loading @@ -619,9 +619,9 @@ func usersGet(w http.ResponseWriter, r *http.Request) { u, _ := url.Parse(r.URL.String()) log.Info("url: ", u.RequestURI()) q := u.Query() userData.queryZoneId = q.Get("zoneId") userData.queryApId = q.Get("accessPointId") userData.queryAddress = q.Get("address") userData.queryZoneId = q["zoneId"] userData.queryApId = q["accessPointId"] userData.queryAddress = q["address"] // Get user list from DB var response InlineUserList Loading Loading @@ -668,17 +668,45 @@ func populateUserList(key string, jsonInfo string, userData interface{}) error { return nil } //query parameters looked through using OR within same query parameter and AND between different query parameters //example returning users matching zoneId : (zone01 OR zone02) AND accessPointId : (ap1 OR ap2 OR ap3) AND address: (ipAddress1 OR ipAddress2) foundAMatch := false // Filter using query params if data.queryZoneId != "" && userInfo.ZoneId != data.queryZoneId { if len(data.queryZoneId) > 0 { foundAMatch = false for _, queryZoneId := range data.queryZoneId { if userInfo.ZoneId == queryZoneId { foundAMatch = true } } if !foundAMatch { return nil } if data.queryApId != "" && userInfo.AccessPointId != data.queryApId { } if len(data.queryApId) > 0 { foundAMatch = false for _, queryApId := range data.queryApId { if userInfo.AccessPointId == queryApId { foundAMatch = true } } if !foundAMatch { return nil } } if data.queryAddress != "" && userInfo.Address != data.queryAddress { if len(data.queryAddress) > 0 { foundAMatch = false for _, queryAddress := range data.queryAddress { if userInfo.Address == queryAddress { foundAMatch = true } } if !foundAMatch { return nil } } // Add user info to list data.userList.User = append(data.userList.User, userInfo) Loading Loading @@ -1510,9 +1538,8 @@ func updateUserInfo(address string, zoneId string, accessPointId string, longitu } else { if userInfo.LocationInfo == nil { userInfo.LocationInfo = new(LocationInfo) userInfo.LocationInfo.Accuracy = 1 } //we only support shape != 7 in locationInfo //we only support shape == 2 in locationInfo, so we ignore any conditional parameters based on shape userInfo.LocationInfo.Shape = 2 userInfo.LocationInfo.Longitude = nil userInfo.LocationInfo.Longitude = append(userInfo.LocationInfo.Longitude, *longitude) Loading go-apps/meep-rnis/server/rnis.go +112 −116 Original line number Diff line number Diff line Loading @@ -511,6 +511,12 @@ func isMatchRabRelFilterCriteriaAppInsId(filterCriteria interface{}, appId strin return (appId == filter.AppInstanceId) } func isMatchRabRelFilterCriteriaErabId(filterCriteria interface{}, erabId int32) bool { filter := filterCriteria.(*RabModSubscriptionFilterCriteriaQci) return (erabId == filter.ErabId) } func isMatchCcFilterCriteriaAssociateId(filterCriteria interface{}, assocId *AssociateId) bool { filter := filterCriteria.(*CellChangeSubscriptionFilterCriteriaAssocHo) Loading Loading @@ -547,7 +553,7 @@ func isMatchRabFilterCriteriaAssociateId(filterCriteria interface{}, assocId *As } */ func isMatchCcFilterCriteriaPlmn(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn) bool { func isMatchCcFilterCriteriaEcgi(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn, newCellId string, oldCellId string) bool { filter := filterCriteria.(*CellChangeSubscriptionFilterCriteriaAssocHo) //if filter criteria is not set, it acts as a wildcard and accepts all Loading @@ -555,86 +561,69 @@ func isMatchCcFilterCriteriaPlmn(filterCriteria interface{}, newPlmn *Plmn, oldP return true } //either of the Plmn should match the filter, var matchingPlmn bool for _, ecgi := range filter.Ecgi { matchingPlmn = false if ecgi.Plmn == nil { matchingPlmn = true } else { if newPlmn != nil { if newPlmn.Mnc == ecgi.Plmn.Mnc && newPlmn.Mcc == ecgi.Plmn.Mcc { return true matchingPlmn = true } } if oldPlmn != nil { if oldPlmn.Mnc == ecgi.Plmn.Mnc && oldPlmn.Mcc == ecgi.Plmn.Mcc { return true } matchingPlmn = true } } return false } func isMatchRabFilterCriteriaPlmn(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn) bool { filter := filterCriteria.(*RabEstSubscriptionFilterCriteriaQci) //if filter criteria is not set, it acts as a wildcard and accepts all if filter.Ecgi == nil { if matchingPlmn { if ecgi.CellId == "" { return true } //either of the Plmn should match the filter, for _, ecgi := range filter.Ecgi { if newPlmn != nil { if newPlmn.Mnc == ecgi.Plmn.Mnc && newPlmn.Mcc == ecgi.Plmn.Mcc { if newCellId == ecgi.CellId { return true } } if oldPlmn != nil { if oldPlmn.Mnc == ecgi.Plmn.Mnc && oldPlmn.Mcc == ecgi.Plmn.Mcc { if oldCellId == ecgi.CellId { return true } } } return false } func isMatchRabRelFilterCriteriaPlmn(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn) bool { filter := filterCriteria.(*RabModSubscriptionFilterCriteriaQci) func isMatchRabFilterCriteriaEcgi(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn, newCellId string, oldCellId string) bool { filter := filterCriteria.(*RabEstSubscriptionFilterCriteriaQci) //if filter criteria is not set, it acts as a wildcard and accepts all if filter.Ecgi == nil { return true } //either of the Plmn should match the filter, var matchingPlmn bool for _, ecgi := range filter.Ecgi { matchingPlmn = false if ecgi.Plmn == nil { matchingPlmn = true } else { if newPlmn != nil { if newPlmn.Mnc == ecgi.Plmn.Mnc && newPlmn.Mcc == ecgi.Plmn.Mcc { return true matchingPlmn = true } } if oldPlmn != nil { if oldPlmn.Mnc == ecgi.Plmn.Mnc && oldPlmn.Mcc == ecgi.Plmn.Mcc { return true } matchingPlmn = true } } return false } func isMatchCcFilterCriteriaCellId(filterCriteria interface{}, newCellId string, oldCellId string) bool { filter := filterCriteria.(*CellChangeSubscriptionFilterCriteriaAssocHo) if filter.Ecgi == nil { if matchingPlmn { if ecgi.CellId == "" { return true } //either the old of new cellId should match one of the cellId in the filter list for _, ecgi := range filter.Ecgi { if newCellId == ecgi.CellId { return true } Loading @@ -643,38 +632,40 @@ func isMatchCcFilterCriteriaCellId(filterCriteria interface{}, newCellId string, } } } return false } func isMatchRabFilterCriteriaCellId(filterCriteria interface{}, newCellId string, oldCellId string) bool { filter := filterCriteria.(*RabEstSubscriptionFilterCriteriaQci) func isMatchRabRelFilterCriteriaEcgi(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn, newCellId string, oldCellId string) bool { filter := filterCriteria.(*RabModSubscriptionFilterCriteriaQci) //if filter criteria is not set, it acts as a wildcard and accepts all if filter.Ecgi == nil { return true } //either the old of new cellId should match one of the cellId in the filter list var matchingPlmn bool for _, ecgi := range filter.Ecgi { if newCellId == ecgi.CellId { return true matchingPlmn = false if ecgi.Plmn == nil { matchingPlmn = true } else { if newPlmn != nil { if newPlmn.Mnc == ecgi.Plmn.Mnc && newPlmn.Mcc == ecgi.Plmn.Mcc { matchingPlmn = true } if oldCellId == ecgi.CellId { return true } if oldPlmn != nil { if oldPlmn.Mnc == ecgi.Plmn.Mnc && oldPlmn.Mcc == ecgi.Plmn.Mcc { matchingPlmn = true } return false } func isMatchRabRelFilterCriteriaCellId(filterCriteria interface{}, newCellId string, oldCellId string) bool { filter := filterCriteria.(*RabModSubscriptionFilterCriteriaQci) if filter.Ecgi == nil { } if matchingPlmn { if ecgi.CellId == "" { return true } //either the old of new cellId should match one of the cellId in the filter list for _, ecgi := range filter.Ecgi { if newCellId == ecgi.CellId { return true } Loading @@ -683,6 +674,8 @@ func isMatchRabRelFilterCriteriaCellId(filterCriteria interface{}, newCellId str } } } return false } Loading @@ -708,26 +701,14 @@ func isMatchFilterCriteriaAssociateId(subscriptionType string, filterCriteria in return true } func isMatchFilterCriteriaPlmn(subscriptionType string, filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn) bool { func isMatchFilterCriteriaEcgi(subscriptionType string, filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn, newCellId string, oldCellId string) bool { switch subscriptionType { case cellChangeSubscriptionType: return isMatchCcFilterCriteriaPlmn(filterCriteria, newPlmn, oldPlmn) return isMatchCcFilterCriteriaEcgi(filterCriteria, newPlmn, oldPlmn, newCellId, oldCellId) case rabEstSubscriptionType: return isMatchRabFilterCriteriaPlmn(filterCriteria, newPlmn, oldPlmn) return isMatchRabFilterCriteriaEcgi(filterCriteria, newPlmn, oldPlmn, newCellId, oldCellId) case rabRelSubscriptionType: return isMatchRabRelFilterCriteriaPlmn(filterCriteria, newPlmn, oldPlmn) } return true } func isMatchFilterCriteriaCellId(subscriptionType string, filterCriteria interface{}, newCellId string, oldCellId string) bool { switch subscriptionType { case cellChangeSubscriptionType: return isMatchCcFilterCriteriaCellId(filterCriteria, newCellId, oldCellId) case rabEstSubscriptionType: return isMatchRabFilterCriteriaCellId(filterCriteria, newCellId, oldCellId) case rabRelSubscriptionType: return isMatchRabRelFilterCriteriaCellId(filterCriteria, newCellId, oldCellId) return isMatchRabRelFilterCriteriaEcgi(filterCriteria, newPlmn, oldPlmn, newCellId, oldCellId) } return true } Loading @@ -753,11 +734,7 @@ func checkCcNotificationRegisteredSubscriptions(appId string, assocId *Associate } if match { match = isMatchFilterCriteriaPlmn(cellChangeSubscriptionType, sub.FilterCriteriaAssocHo, newPlmn, oldPlmn) } if match { match = isMatchFilterCriteriaCellId(cellChangeSubscriptionType, sub.FilterCriteriaAssocHo, newCellId, oldCellId) match = isMatchFilterCriteriaEcgi(cellChangeSubscriptionType, sub.FilterCriteriaAssocHo, newPlmn, oldPlmn, newCellId, oldCellId) } //we ignore hoStatus Loading Loading @@ -841,11 +818,7 @@ func checkReNotificationRegisteredSubscriptions(appId string, assocId *Associate } if match { match = isMatchFilterCriteriaPlmn(rabEstSubscriptionType, sub.FilterCriteriaQci, newPlmn, nil) } if match { match = isMatchFilterCriteriaCellId(rabEstSubscriptionType, sub.FilterCriteriaQci, newCellId, oldCellId) match = isMatchFilterCriteriaEcgi(rabEstSubscriptionType, sub.FilterCriteriaQci, newPlmn, nil, newCellId, oldCellId) } //we ignore qci Loading Loading @@ -918,13 +891,12 @@ func checkRrNotificationRegisteredSubscriptions(appId string, assocId *Associate } if match { match = isMatchFilterCriteriaPlmn(rabRelSubscriptionType, sub.FilterCriteriaQci, nil, oldPlmn) match = isMatchFilterCriteriaEcgi(rabRelSubscriptionType, sub.FilterCriteriaQci, nil, oldPlmn, newCellId, oldCellId) } if match { match = isMatchFilterCriteriaCellId(rabRelSubscriptionType, sub.FilterCriteriaQci, "", oldCellId) match = isMatchRabRelFilterCriteriaErabId(sub.FilterCriteriaQci, erabId) } //we ignore qci if match { Loading Loading @@ -1153,7 +1125,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { if subscription.FilterCriteriaAssocHo == nil { log.Error("FilterCriteriaAssocHo should not be null for this subscription type") http.Error(w, "FilterCriteriaAssocHo should not be null for this subscription type", http.StatusInternalServerError) http.Error(w, "FilterCriteriaAssocHo should not be null for this subscription type", http.StatusBadRequest) return } Loading @@ -1161,6 +1133,14 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { subscription.FilterCriteriaAssocHo.HoStatus = append(subscription.FilterCriteriaAssocHo.HoStatus, 3 /*COMPLETED*/) } for _, ecgi := range subscription.FilterCriteriaAssocHo.Ecgi { if ecgi.Plmn == nil || ecgi.CellId == "" { log.Error("For non null ecgi, plmn and cellId are mandatory") http.Error(w, "For non null ecgi, plmn and cellId are mandatory", http.StatusBadRequest) return } } //registration registerCc(&subscription, subsIdStr) _ = rc.JSONSetEntry(baseKey+"subscriptions:"+subsIdStr, ".", convertCellChangeSubscriptionToJson(&subscription)) Loading @@ -1180,9 +1160,17 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { if subscription.FilterCriteriaQci == nil { log.Error("FilterCriteriaQci should not be null for this subscription type") http.Error(w, "FilterCriteriaQci should not be null for this subscription type", http.StatusInternalServerError) http.Error(w, "FilterCriteriaQci should not be null for this subscription type", http.StatusBadRequest) return } for _, ecgi := range subscription.FilterCriteriaQci.Ecgi { if ecgi.Plmn == nil || ecgi.CellId == "" { log.Error("For non null ecgi, plmn and cellId are mandatory") http.Error(w, "For non null ecgi, plmn and cellId are mandatory", http.StatusBadRequest) return } } //registration registerRe(&subscription, subsIdStr) Loading @@ -1203,9 +1191,17 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { if subscription.FilterCriteriaQci == nil { log.Error("FilterCriteriaQci should not be null for this subscription type") http.Error(w, "FilterCriteriaQci should not be null for this subscription type", http.StatusInternalServerError) http.Error(w, "FilterCriteriaQci should not be null for this subscription type", http.StatusBadRequest) return } for _, ecgi := range subscription.FilterCriteriaQci.Ecgi { if ecgi.Plmn == nil || ecgi.CellId == "" { log.Error("For non null ecgi, plmn and cellId are mandatory") http.Error(w, "For non null ecgi, plmn and cellId are mandatory", http.StatusBadRequest) return } } //registration registerRr(&subscription, subsIdStr) Loading Loading
go-apps/meep-loc-serv/server/loc-serv.go +41 −14 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ const USER_TRACKING_AND_ZONAL_TRAFFIC = 1 const ZONE_STATUS = 2 type UeUserData struct { queryZoneId string queryApId string queryAddress string queryZoneId []string queryApId []string queryAddress []string userList *UserList } Loading Loading @@ -619,9 +619,9 @@ func usersGet(w http.ResponseWriter, r *http.Request) { u, _ := url.Parse(r.URL.String()) log.Info("url: ", u.RequestURI()) q := u.Query() userData.queryZoneId = q.Get("zoneId") userData.queryApId = q.Get("accessPointId") userData.queryAddress = q.Get("address") userData.queryZoneId = q["zoneId"] userData.queryApId = q["accessPointId"] userData.queryAddress = q["address"] // Get user list from DB var response InlineUserList Loading Loading @@ -668,17 +668,45 @@ func populateUserList(key string, jsonInfo string, userData interface{}) error { return nil } //query parameters looked through using OR within same query parameter and AND between different query parameters //example returning users matching zoneId : (zone01 OR zone02) AND accessPointId : (ap1 OR ap2 OR ap3) AND address: (ipAddress1 OR ipAddress2) foundAMatch := false // Filter using query params if data.queryZoneId != "" && userInfo.ZoneId != data.queryZoneId { if len(data.queryZoneId) > 0 { foundAMatch = false for _, queryZoneId := range data.queryZoneId { if userInfo.ZoneId == queryZoneId { foundAMatch = true } } if !foundAMatch { return nil } if data.queryApId != "" && userInfo.AccessPointId != data.queryApId { } if len(data.queryApId) > 0 { foundAMatch = false for _, queryApId := range data.queryApId { if userInfo.AccessPointId == queryApId { foundAMatch = true } } if !foundAMatch { return nil } } if data.queryAddress != "" && userInfo.Address != data.queryAddress { if len(data.queryAddress) > 0 { foundAMatch = false for _, queryAddress := range data.queryAddress { if userInfo.Address == queryAddress { foundAMatch = true } } if !foundAMatch { return nil } } // Add user info to list data.userList.User = append(data.userList.User, userInfo) Loading Loading @@ -1510,9 +1538,8 @@ func updateUserInfo(address string, zoneId string, accessPointId string, longitu } else { if userInfo.LocationInfo == nil { userInfo.LocationInfo = new(LocationInfo) userInfo.LocationInfo.Accuracy = 1 } //we only support shape != 7 in locationInfo //we only support shape == 2 in locationInfo, so we ignore any conditional parameters based on shape userInfo.LocationInfo.Shape = 2 userInfo.LocationInfo.Longitude = nil userInfo.LocationInfo.Longitude = append(userInfo.LocationInfo.Longitude, *longitude) Loading
go-apps/meep-rnis/server/rnis.go +112 −116 Original line number Diff line number Diff line Loading @@ -511,6 +511,12 @@ func isMatchRabRelFilterCriteriaAppInsId(filterCriteria interface{}, appId strin return (appId == filter.AppInstanceId) } func isMatchRabRelFilterCriteriaErabId(filterCriteria interface{}, erabId int32) bool { filter := filterCriteria.(*RabModSubscriptionFilterCriteriaQci) return (erabId == filter.ErabId) } func isMatchCcFilterCriteriaAssociateId(filterCriteria interface{}, assocId *AssociateId) bool { filter := filterCriteria.(*CellChangeSubscriptionFilterCriteriaAssocHo) Loading Loading @@ -547,7 +553,7 @@ func isMatchRabFilterCriteriaAssociateId(filterCriteria interface{}, assocId *As } */ func isMatchCcFilterCriteriaPlmn(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn) bool { func isMatchCcFilterCriteriaEcgi(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn, newCellId string, oldCellId string) bool { filter := filterCriteria.(*CellChangeSubscriptionFilterCriteriaAssocHo) //if filter criteria is not set, it acts as a wildcard and accepts all Loading @@ -555,86 +561,69 @@ func isMatchCcFilterCriteriaPlmn(filterCriteria interface{}, newPlmn *Plmn, oldP return true } //either of the Plmn should match the filter, var matchingPlmn bool for _, ecgi := range filter.Ecgi { matchingPlmn = false if ecgi.Plmn == nil { matchingPlmn = true } else { if newPlmn != nil { if newPlmn.Mnc == ecgi.Plmn.Mnc && newPlmn.Mcc == ecgi.Plmn.Mcc { return true matchingPlmn = true } } if oldPlmn != nil { if oldPlmn.Mnc == ecgi.Plmn.Mnc && oldPlmn.Mcc == ecgi.Plmn.Mcc { return true } matchingPlmn = true } } return false } func isMatchRabFilterCriteriaPlmn(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn) bool { filter := filterCriteria.(*RabEstSubscriptionFilterCriteriaQci) //if filter criteria is not set, it acts as a wildcard and accepts all if filter.Ecgi == nil { if matchingPlmn { if ecgi.CellId == "" { return true } //either of the Plmn should match the filter, for _, ecgi := range filter.Ecgi { if newPlmn != nil { if newPlmn.Mnc == ecgi.Plmn.Mnc && newPlmn.Mcc == ecgi.Plmn.Mcc { if newCellId == ecgi.CellId { return true } } if oldPlmn != nil { if oldPlmn.Mnc == ecgi.Plmn.Mnc && oldPlmn.Mcc == ecgi.Plmn.Mcc { if oldCellId == ecgi.CellId { return true } } } return false } func isMatchRabRelFilterCriteriaPlmn(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn) bool { filter := filterCriteria.(*RabModSubscriptionFilterCriteriaQci) func isMatchRabFilterCriteriaEcgi(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn, newCellId string, oldCellId string) bool { filter := filterCriteria.(*RabEstSubscriptionFilterCriteriaQci) //if filter criteria is not set, it acts as a wildcard and accepts all if filter.Ecgi == nil { return true } //either of the Plmn should match the filter, var matchingPlmn bool for _, ecgi := range filter.Ecgi { matchingPlmn = false if ecgi.Plmn == nil { matchingPlmn = true } else { if newPlmn != nil { if newPlmn.Mnc == ecgi.Plmn.Mnc && newPlmn.Mcc == ecgi.Plmn.Mcc { return true matchingPlmn = true } } if oldPlmn != nil { if oldPlmn.Mnc == ecgi.Plmn.Mnc && oldPlmn.Mcc == ecgi.Plmn.Mcc { return true } matchingPlmn = true } } return false } func isMatchCcFilterCriteriaCellId(filterCriteria interface{}, newCellId string, oldCellId string) bool { filter := filterCriteria.(*CellChangeSubscriptionFilterCriteriaAssocHo) if filter.Ecgi == nil { if matchingPlmn { if ecgi.CellId == "" { return true } //either the old of new cellId should match one of the cellId in the filter list for _, ecgi := range filter.Ecgi { if newCellId == ecgi.CellId { return true } Loading @@ -643,38 +632,40 @@ func isMatchCcFilterCriteriaCellId(filterCriteria interface{}, newCellId string, } } } return false } func isMatchRabFilterCriteriaCellId(filterCriteria interface{}, newCellId string, oldCellId string) bool { filter := filterCriteria.(*RabEstSubscriptionFilterCriteriaQci) func isMatchRabRelFilterCriteriaEcgi(filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn, newCellId string, oldCellId string) bool { filter := filterCriteria.(*RabModSubscriptionFilterCriteriaQci) //if filter criteria is not set, it acts as a wildcard and accepts all if filter.Ecgi == nil { return true } //either the old of new cellId should match one of the cellId in the filter list var matchingPlmn bool for _, ecgi := range filter.Ecgi { if newCellId == ecgi.CellId { return true matchingPlmn = false if ecgi.Plmn == nil { matchingPlmn = true } else { if newPlmn != nil { if newPlmn.Mnc == ecgi.Plmn.Mnc && newPlmn.Mcc == ecgi.Plmn.Mcc { matchingPlmn = true } if oldCellId == ecgi.CellId { return true } if oldPlmn != nil { if oldPlmn.Mnc == ecgi.Plmn.Mnc && oldPlmn.Mcc == ecgi.Plmn.Mcc { matchingPlmn = true } return false } func isMatchRabRelFilterCriteriaCellId(filterCriteria interface{}, newCellId string, oldCellId string) bool { filter := filterCriteria.(*RabModSubscriptionFilterCriteriaQci) if filter.Ecgi == nil { } if matchingPlmn { if ecgi.CellId == "" { return true } //either the old of new cellId should match one of the cellId in the filter list for _, ecgi := range filter.Ecgi { if newCellId == ecgi.CellId { return true } Loading @@ -683,6 +674,8 @@ func isMatchRabRelFilterCriteriaCellId(filterCriteria interface{}, newCellId str } } } return false } Loading @@ -708,26 +701,14 @@ func isMatchFilterCriteriaAssociateId(subscriptionType string, filterCriteria in return true } func isMatchFilterCriteriaPlmn(subscriptionType string, filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn) bool { func isMatchFilterCriteriaEcgi(subscriptionType string, filterCriteria interface{}, newPlmn *Plmn, oldPlmn *Plmn, newCellId string, oldCellId string) bool { switch subscriptionType { case cellChangeSubscriptionType: return isMatchCcFilterCriteriaPlmn(filterCriteria, newPlmn, oldPlmn) return isMatchCcFilterCriteriaEcgi(filterCriteria, newPlmn, oldPlmn, newCellId, oldCellId) case rabEstSubscriptionType: return isMatchRabFilterCriteriaPlmn(filterCriteria, newPlmn, oldPlmn) return isMatchRabFilterCriteriaEcgi(filterCriteria, newPlmn, oldPlmn, newCellId, oldCellId) case rabRelSubscriptionType: return isMatchRabRelFilterCriteriaPlmn(filterCriteria, newPlmn, oldPlmn) } return true } func isMatchFilterCriteriaCellId(subscriptionType string, filterCriteria interface{}, newCellId string, oldCellId string) bool { switch subscriptionType { case cellChangeSubscriptionType: return isMatchCcFilterCriteriaCellId(filterCriteria, newCellId, oldCellId) case rabEstSubscriptionType: return isMatchRabFilterCriteriaCellId(filterCriteria, newCellId, oldCellId) case rabRelSubscriptionType: return isMatchRabRelFilterCriteriaCellId(filterCriteria, newCellId, oldCellId) return isMatchRabRelFilterCriteriaEcgi(filterCriteria, newPlmn, oldPlmn, newCellId, oldCellId) } return true } Loading @@ -753,11 +734,7 @@ func checkCcNotificationRegisteredSubscriptions(appId string, assocId *Associate } if match { match = isMatchFilterCriteriaPlmn(cellChangeSubscriptionType, sub.FilterCriteriaAssocHo, newPlmn, oldPlmn) } if match { match = isMatchFilterCriteriaCellId(cellChangeSubscriptionType, sub.FilterCriteriaAssocHo, newCellId, oldCellId) match = isMatchFilterCriteriaEcgi(cellChangeSubscriptionType, sub.FilterCriteriaAssocHo, newPlmn, oldPlmn, newCellId, oldCellId) } //we ignore hoStatus Loading Loading @@ -841,11 +818,7 @@ func checkReNotificationRegisteredSubscriptions(appId string, assocId *Associate } if match { match = isMatchFilterCriteriaPlmn(rabEstSubscriptionType, sub.FilterCriteriaQci, newPlmn, nil) } if match { match = isMatchFilterCriteriaCellId(rabEstSubscriptionType, sub.FilterCriteriaQci, newCellId, oldCellId) match = isMatchFilterCriteriaEcgi(rabEstSubscriptionType, sub.FilterCriteriaQci, newPlmn, nil, newCellId, oldCellId) } //we ignore qci Loading Loading @@ -918,13 +891,12 @@ func checkRrNotificationRegisteredSubscriptions(appId string, assocId *Associate } if match { match = isMatchFilterCriteriaPlmn(rabRelSubscriptionType, sub.FilterCriteriaQci, nil, oldPlmn) match = isMatchFilterCriteriaEcgi(rabRelSubscriptionType, sub.FilterCriteriaQci, nil, oldPlmn, newCellId, oldCellId) } if match { match = isMatchFilterCriteriaCellId(rabRelSubscriptionType, sub.FilterCriteriaQci, "", oldCellId) match = isMatchRabRelFilterCriteriaErabId(sub.FilterCriteriaQci, erabId) } //we ignore qci if match { Loading Loading @@ -1153,7 +1125,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { if subscription.FilterCriteriaAssocHo == nil { log.Error("FilterCriteriaAssocHo should not be null for this subscription type") http.Error(w, "FilterCriteriaAssocHo should not be null for this subscription type", http.StatusInternalServerError) http.Error(w, "FilterCriteriaAssocHo should not be null for this subscription type", http.StatusBadRequest) return } Loading @@ -1161,6 +1133,14 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { subscription.FilterCriteriaAssocHo.HoStatus = append(subscription.FilterCriteriaAssocHo.HoStatus, 3 /*COMPLETED*/) } for _, ecgi := range subscription.FilterCriteriaAssocHo.Ecgi { if ecgi.Plmn == nil || ecgi.CellId == "" { log.Error("For non null ecgi, plmn and cellId are mandatory") http.Error(w, "For non null ecgi, plmn and cellId are mandatory", http.StatusBadRequest) return } } //registration registerCc(&subscription, subsIdStr) _ = rc.JSONSetEntry(baseKey+"subscriptions:"+subsIdStr, ".", convertCellChangeSubscriptionToJson(&subscription)) Loading @@ -1180,9 +1160,17 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { if subscription.FilterCriteriaQci == nil { log.Error("FilterCriteriaQci should not be null for this subscription type") http.Error(w, "FilterCriteriaQci should not be null for this subscription type", http.StatusInternalServerError) http.Error(w, "FilterCriteriaQci should not be null for this subscription type", http.StatusBadRequest) return } for _, ecgi := range subscription.FilterCriteriaQci.Ecgi { if ecgi.Plmn == nil || ecgi.CellId == "" { log.Error("For non null ecgi, plmn and cellId are mandatory") http.Error(w, "For non null ecgi, plmn and cellId are mandatory", http.StatusBadRequest) return } } //registration registerRe(&subscription, subsIdStr) Loading @@ -1203,9 +1191,17 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { if subscription.FilterCriteriaQci == nil { log.Error("FilterCriteriaQci should not be null for this subscription type") http.Error(w, "FilterCriteriaQci should not be null for this subscription type", http.StatusInternalServerError) http.Error(w, "FilterCriteriaQci should not be null for this subscription type", http.StatusBadRequest) return } for _, ecgi := range subscription.FilterCriteriaQci.Ecgi { if ecgi.Plmn == nil || ecgi.CellId == "" { log.Error("For non null ecgi, plmn and cellId are mandatory") http.Error(w, "For non null ecgi, plmn and cellId are mandatory", http.StatusBadRequest) return } } //registration registerRr(&subscription, subsIdStr) Loading