pcf_context

package
v3.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBdtRefId = "BdtPolicyId-"

BdtPolicy default value

Variables

View Source
var AppSessionContextStore []AppSessionIdStore
View Source
var BdtPolicyData_store []models.BdtPolicyData

BdtPolicyData_store -

View Source
var CheckNotifiUri = "/npcf-callback/v1/nudr-notify/"
View Source
var CreateFailBdtDateStore []models.BdtData
View Source
var IPv4Address = "192.168."
View Source
var IPv6Address = "ffab::"
View Source
var Ipv4_pool = make(map[string]string)
View Source
var Ipv6_pool = make(map[string]string)
View Source
var PolicyAuthorizationUri = "/npcf-policyauthorization/v1/app-sessions/"
View Source
var SmUri = "/npcf-smpolicycontrol/v1"

Functions

func ConvertBitRateToKbps

func ConvertBitRateToKbps(bitRate string) (kBitRate float64, err error)

Convert bitRate string to float64 with uint Kbps

func ConvertBitRateToString

func ConvertBitRateToString(kBitRate float64) (bitRate string)

Convert bitRate from float64 to String

func DecreaseRamainBitRate

func DecreaseRamainBitRate(remainBitRate *float64, reqBitRate string) error

Decrease remain Bit Rate

func DecreaseRamainBitRateToZero

func DecreaseRamainBitRateToZero(remainBitRate *float64) string

Returns remin Bit rate string and decrease ir to zero

func DeleteIpv4index

func DeleteIpv4index(Ipv4index int32)

func DeleteIpv6index

func DeleteIpv6index(Ipv6index int32)

func GetIpv4Address

func GetIpv4Address(ipindex int32) string

func GetIpv6Address

func GetIpv6Address(ipindex int32) string

func GetTimeformat

func GetTimeformat() string

func GetUri

func GetUri(name models.ServiceName) string

func IncreaseRamainBitRate

func IncreaseRamainBitRate(remainBitRate *float64, reqBitRate string) (orig *float64)

Increase remain Bit Rate and returns original Bit Rate

func Ipv4Index

func Ipv4Index() int32

func Ipv4Pool

func Ipv4Pool(ipindex int32) string

func Ipv6Index

func Ipv6Index() int32

func Ipv6Pool

func Ipv6Pool(ipindex int32) string

Types

type AMFStatusSubscriptionData

type AMFStatusSubscriptionData struct {
	AmfUri       string
	AmfStatusUri string
	GuamiList    []models.Guami
}

type AppSessionData

type AppSessionData struct {
	AppSessionId      string
	AppSessionContext *models.AppSessionContext
	// (compN/compN-subCompN/appId-%s) map to PccRule
	RelatedPccRuleIds    map[string]string
	PccRuleIdMapToCompId map[string]string
	// EventSubscription
	Events   map[models.AfEvent]models.AfNotifMethod
	EventUri string
	// related Session
	SmPolicyData *UeSmPolicyData
}

type AppSessionIdStore

type AppSessionIdStore struct {
	AppSessionId      string
	AppSessionContext models.AppSessionContext
}

AppSessionIdStore -

type PCFContext

type PCFContext struct {
	NfId            string
	Name            string
	UriScheme       models.UriScheme
	HttpIPv4Address string
	HttpIpv4Port    int
	TimeFormat      string
	DefaultBdtRefId string
	NfService       map[models.ServiceName]models.NfService
	PcfServiceUris  map[models.ServiceName]string
	PcfSuppFeats    map[models.ServiceName][]byte
	NrfUri          string
	DefaultUdrUri   string
	UePool          map[string]*UeContext
	// Bdt Policy related
	BdtPolicyPool        map[string]models.BdtPolicy // use BdtPolicyId as key
	BdtPolicyIdGenerator uint64
	// App Session related
	AppSessionPool map[string]*AppSessionData // use AppSessionId(ue.Supi-%d) or (BdtRefId-%d) as key
	// AMF Status Change Subscription related
	AMFStatusSubsData map[string]AMFStatusSubscriptionData // subscriptionId as key
}

func GetPcfContext

func GetPcfContext() PCFContext

func PCF_Self

func PCF_Self() *PCFContext

Create new PCF context

func (*PCFContext) AllocBdtPolicyId

func (context *PCFContext) AllocBdtPolicyId() string

Return Bdt Policy Id with format "BdtPolicyId-%d" which be allocated

func (*PCFContext) GetIPv4Uri

func (context *PCFContext) GetIPv4Uri() string

func (*PCFContext) InitNFService

func (context *PCFContext) InitNFService(serviceList []factory.Service, version string)

Init NfService with supported service list ,and version of services

func (*PCFContext) NewPCFUe

func (context *PCFContext) NewPCFUe(Supi string) (*UeContext, error)

Allocate PCF Ue with supi and add to pcf Context and returns allocated ue

func (*PCFContext) PCFUeFindByAppSessionId

func (context *PCFContext) PCFUeFindByAppSessionId(appSessionId string) *UeContext

Find PcfUe which the AppSessionId belongs to

func (*PCFContext) PCFUeFindByPolicyId

func (context *PCFContext) PCFUeFindByPolicyId(PolicyId string) *UeContext

Find PcfUe which the policyId belongs to

func (*PCFContext) PcfUeFindByIPv4

func (context *PCFContext) PcfUeFindByIPv4(v4 string) *UeContext

Find PcfUe which Ipv4 belongs to

func (*PCFContext) PcfUeFindByIPv6

func (context *PCFContext) PcfUeFindByIPv6(v6 string) *UeContext

Find PcfUe which Ipv6 belongs to

func (*PCFContext) SessionBinding

func (context *PCFContext) SessionBinding(req *models.AppSessionContextReqData) (policy *UeSmPolicyData, err error)

Session Binding from application request to get corresponding Sm policy

type UeAMPolicyData

type UeAMPolicyData struct {
	PolAssoId         string
	AccessType        models.AccessType
	NotificationUri   string
	ServingPlmn       *models.NetworkId
	AltNotifIpv4Addrs []string
	AltNotifIpv6Addrs []string
	// TODO: AMF Status Change
	AmfStatusUri string
	Guami        *models.Guami
	ServiveName  string
	// TraceReq *TraceData
	// Policy Association
	Triggers    []models.RequestTrigger
	ServAreaRes *models.ServiceAreaRestriction
	Rfsp        int32
	UserLoc     *models.UserLocation
	TimeZone    string
	SuppFeat    string
	// about AF request
	Pras map[string]models.PresenceInfo
	// related to UDR Subscription Data
	AmPolicyData *models.AmPolicyData // Svbscription Data
	// Corresponding UE
	PcfUe *UeContext
	// AMF status change subscription
	AmfStatusChangeSubscription *AMFStatusSubscriptionData
}

type UeContext

type UeContext struct {
	// Ue Context
	Supi                      string
	Gpsi                      string
	Pei                       string
	GroupIds                  []string
	PolAssociationIDGenerator uint32
	AMPolicyData              map[string]*UeAMPolicyData // use PolAssoId(ue.Supi-numPolId) as key

	// Udr Ref
	UdrUri string
	// SMPolicy
	SmPolicyData map[string]*UeSmPolicyData // use smPolicyId(ue.Supi-pduSessionId) as key
	// App Session Related
	AppSessionIdGenerator uint64
	// PolicyAuth
	AfRoutReq *models.AfRoutingRequirement
	AspId     string
	// Policy Decision
	AppSessionIdStore           *AppSessionIdStore
	PolicyDataSubscriptionStore *models.PolicyDataSubscription
	PolicyDataChangeStore       *models.PolicyDataChangeNotification
}

key is supi

func (*UeContext) AllocUeAppSessionId

func (ue *UeContext) AllocUeAppSessionId(context *PCFContext) string

Return App Session Id with format "ue.Supi-%d" which be allocated

func (*UeContext) FindAMPolicy

func (ue *UeContext) FindAMPolicy(anType models.AccessType, plmnId *models.NetworkId) *UeAMPolicyData

returns AM Policy which AccessType and plmnId match

func (*UeContext) NewUeAMPolicyData

func (ue *UeContext) NewUeAMPolicyData(assolId string, req models.PolicyAssociationRequest) *UeAMPolicyData

NewUeAMPolicyData returns created UeAMPolicyData data and insert this data to Ue.AMPolicyData with assolId as key

func (*UeContext) NewUeSmPolicyData

func (ue *UeContext) NewUeSmPolicyData(key string, request models.SmPolicyContextData, smData *models.SmPolicyData) *UeSmPolicyData

returns UeSmPolicyData and insert related info to Ue with smPolId

func (*UeContext) SMPolicyFindByIpv4

func (ue *UeContext) SMPolicyFindByIpv4(v4 string) *UeSmPolicyData

returns SM Policy by IPv4

func (*UeContext) SMPolicyFindByIpv6

func (ue *UeContext) SMPolicyFindByIpv6(v6 string) *UeSmPolicyData

returns SM Policy by IPv6

type UeSmPolicyData

type UeSmPolicyData struct {
	// PduSessionId    int32
	// DNN             string
	// NotificationUri string
	// Snssai                 models.Snssai
	// PduSessionType         models.PduSessionType
	// IPAddress              models.IpAddress
	// IPDomain               string
	// Var3gppPsDataOffStatus bool
	// SmfId                  string
	// TraceReq *TraceData
	// RecoveryTime     *time.Time
	PackFiltIdGenarator int32
	PccRuleIdGenarator  int32
	ChargingIdGenarator int32
	// FlowMapsToPackFiltIds  map[string][]string // use Flow Description(in TS 29214) as key map to pcc rule ids
	PackFiltMapToPccRuleId map[string]string // use PackFiltId as Key
	// Related to GBR
	RemainGbrUL *float64
	RemainGbrDL *float64
	// related to UDR Subscription Data
	SmPolicyData *models.SmPolicyData // Svbscription Data
	// related to Policy
	PolicyContext  *models.SmPolicyContextData
	PolicyDecision *models.SmPolicyDecision
	// related to AppSession
	AppSessions map[string]bool // related appSessionId
	// Corresponding UE
	PcfUe *UeContext
}

func (*UeSmPolicyData) ArrangeExistEventSubscription

func (policy *UeSmPolicyData) ArrangeExistEventSubscription() (changed bool)

Arrange Exist Event policy Sm policy about afevents and return if it changes or not and

func (*UeSmPolicyData) CheckRelatedAfEvent

func (policy *UeSmPolicyData) CheckRelatedAfEvent(event models.AfEvent) (found bool)

Check if the afEvent exists in smPolicy

func (*UeSmPolicyData) DecreaseRemainGBR

func (policy *UeSmPolicyData) DecreaseRemainGBR(req *models.RequestedQos) (gbrDl, gbrUl string, err error)

Decrease remain GBR of this policy and returns UL DL GBR

func (*UeSmPolicyData) IncreaseRemainGBR

func (policy *UeSmPolicyData) IncreaseRemainGBR(qosId string) (origUl, origDl *float64)

Increase remain GBR of this policy and returns original UL DL GBR for resume case

func (*UeSmPolicyData) RemovePccRule

func (policy *UeSmPolicyData) RemovePccRule(pccRuleId string) error

Remove Pcc rule wich PccRuleId in the policy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL