diff --git a/consumer/nf_management.go b/consumer/nf_management.go index a309f55..98f7385 100644 --- a/consumer/nf_management.go +++ b/consumer/nf_management.go @@ -32,8 +32,8 @@ func BuildNFInstance(udmContext *udm_context.UDMContext) (profile models.NfProfi } var plmns []models.PlmnId - for _, plmn := range udmContext.PlmnList { - plmns = append(plmns, plmn) + for _, plmnItem := range udmContext.PlmnList { + plmns = append(plmns, plmnItem.PlmnId) } if len(plmns) > 0 { profile.PlmnList = &plmns diff --git a/context/context.go b/context/context.go index 151501e..30957c8 100644 --- a/context/context.go +++ b/context/context.go @@ -51,7 +51,7 @@ type UDMContext struct { SubscriptionOfSharedDataChange sync.Map // subscriptionID as key Keys *factory.Keys EeSubscriptionIDGenerator *idgenerator.IDGenerator - PlmnList []models.PlmnId + PlmnList []factory.PlmnSupportItem } type UdmUeContext struct { diff --git a/factory/config.go b/factory/config.go index e0caa77..d8a8fb1 100644 --- a/factory/config.go +++ b/factory/config.go @@ -42,6 +42,7 @@ type Configuration struct { NrfUri string `yaml:"nrfUri,omitempty"` Keys *Keys `yaml:"keys,omitempty"` PlmnSupportList []models.PlmnId `yaml:"plmnSupportList,omitempty"` + PlmnList []PlmnSupportItem `yaml:"plmnList,omitempty"` } type Sbi struct { @@ -66,6 +67,10 @@ type Keys struct { UdmProfileBHNPublicKey string `yaml:"udmProfileBHNPublicKey,omitempty"` } +type PlmnSupportItem struct { + PlmnId models.PlmnId `yaml:"plmnId"` +} + func (c *Config) GetVersion() string { if c.Info != nil && c.Info.Version != "" { return c.Info.Version diff --git a/service/init.go b/service/init.go index 8a50da9..ca55ad4 100644 --- a/service/init.go +++ b/service/init.go @@ -20,7 +20,6 @@ import ( "github.com/free5gc/http2_util" "github.com/free5gc/logger_util" openApiLogger "github.com/free5gc/openapi/logger" - "github.com/free5gc/openapi/models" "github.com/free5gc/path_util" pathUtilLogger "github.com/free5gc/path_util/logger" "github.com/free5gc/udm/consumer" @@ -316,17 +315,17 @@ func (udm *UDM) updateConfig(commChannel chan *protos.NetworkSliceResponse) bool for _, ns := range rsp.NetworkSlice { logger.GrpcLog.Infoln("Network Slice Name ", ns.Name) if ns.Site != nil { - temp := models.PlmnId{} + temp := factory.PlmnSupportItem{} var found bool = false logger.GrpcLog.Infoln("Network Slice has site name present ") site := ns.Site logger.GrpcLog.Infoln("Site name ", site.SiteName) if site.Plmn != nil { - temp.Mcc = site.Plmn.Mcc - temp.Mnc = site.Plmn.Mnc + temp.PlmnId.Mcc = site.Plmn.Mcc + temp.PlmnId.Mnc = site.Plmn.Mnc logger.GrpcLog.Infoln("Plmn mcc ", site.Plmn.Mcc) for _, item := range self.PlmnList { - if item.Mcc == temp.Mcc && item.Mnc == temp.Mnc { + if item.PlmnId.Mcc == temp.PlmnId.Mcc && item.PlmnId.Mnc == temp.PlmnId.Mnc { found = true break } diff --git a/util/init_context.go b/util/init_context.go index c31e092..07cd025 100644 --- a/util/init_context.go +++ b/util/init_context.go @@ -54,6 +54,6 @@ func InitUDMContext(udmContext *context.UDMContext) { servingNameList := configuration.ServiceNameList udmContext.Keys = configuration.Keys - + udmContext.PlmnList = configuration.PlmnList udmContext.InitNFService(servingNameList, config.Info.Version) }