From 6ec3c09370e570ed6e50a45935298891582b3afb Mon Sep 17 00:00:00 2001 From: "akagi.mari" Date: Tue, 27 Jul 2021 01:54:48 +0000 Subject: [PATCH] Add locality in config and NF Profile of SMF --- consumer/nnrf.go | 3 +++ context/context.go | 3 +++ factory/config.go | 1 + 3 files changed, 7 insertions(+) diff --git a/consumer/nnrf.go b/consumer/nnrf.go index 8a8290a1..89b9d212 100644 --- a/consumer/nnrf.go +++ b/consumer/nnrf.go @@ -35,6 +35,9 @@ func SendNFRegistration() error { SmfInfo: smf_context.SmfInfo, SNssais: &sNssais, } + if smf_context.SMF_Self().Locality != "" { + profile.Locality = smf_context.SMF_Self().Locality + } var rep models.NfProfile var res *http.Response var err error diff --git a/context/context.go b/context/context.go index b4c9a404..2a48e507 100644 --- a/context/context.go +++ b/context/context.go @@ -47,6 +47,7 @@ type SMFContext struct { NFManagementClient *Nnrf_NFManagement.APIClient NFDiscoveryClient *Nnrf_NFDiscovery.APIClient SubscriberDataManagementClient *Nudm_SubscriberDataManagement.APIClient + Locality string UserPlaneInformation *UserPlaneInformation @@ -191,6 +192,8 @@ func InitSmfContext(config *factory.Config) { smfContext.UserPlaneInformation = NewUserPlaneInformation(&configuration.UserPlaneInformation) SetupNFProfile(config) + + smfContext.Locality = configuration.Locality } func InitSMFUERouting(routingConfig *factory.RoutingConfig) { diff --git a/factory/config.go b/factory/config.go index 2c9856e2..fca416f4 100644 --- a/factory/config.go +++ b/factory/config.go @@ -42,6 +42,7 @@ type Configuration struct { ServiceNameList []string `yaml:"serviceNameList,omitempty"` SNssaiInfo []SnssaiInfoItem `yaml:"snssaiInfos,omitempty"` ULCL bool `yaml:"ulcl,omitempty"` + Locality string `yaml:"locality,omitempty"` } type SnssaiInfoItem struct {