pcf

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBitRateToKbps

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

Convert bitRate string to float64 with uint Kbps

func CreateAMPolicy

func CreateAMPolicy(ctx context.Context, policyAssociationRequest models.PolicyAssociationRequest) (*models.PolicyAssociation, string, error)

func DeleteAMPolicy

func DeleteAMPolicy(ctx context.Context, polAssoID string) error

func DeleteSMPolicy

func DeleteSMPolicy(ctx context.Context, smPolicyID string) error

func GetSMPolicyDnnData

func GetSMPolicyDnnData(data models.SmPolicyData, snssai *models.Snssai, dnn string) (*models.SmPolicyDnnData, error)

GetSMPolicyDnnData returns SMPolicyDnnData derived from SmPolicy data which snssai and dnn match

func GetSmPolicyData added in v0.0.5

func GetSmPolicyData(ctx context.Context) (*models.SmPolicyData, error)

func SnssaiModelsToHex

func SnssaiModelsToHex(snssai models.Snssai) string

Convert Snssai form models to hexString(sst(2)+sd(6))

func Start

func Start(dbInstance *db.Database) error

func UpdateAMPolicy

func UpdateAMPolicy(ctx context.Context, polAssoID string, policyAssociationUpdateRequest models.PolicyAssociationUpdateRequest) (*models.PolicyUpdate, error)

Types

type PCFContext

type PCFContext struct {
	UePool                 sync.Map
	SessionRuleIDGenerator *idgenerator.IDGenerator
	QoSDataIDGenerator     *idgenerator.IDGenerator
	DBInstance             *db.Database
}

func (*PCFContext) NewPCFUe

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

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

func (*PCFContext) PCFUeFindByPolicyID added in v0.0.12

func (c *PCFContext) PCFUeFindByPolicyID(PolicyID string) (*UeContext, error)

Find PcfUe which the policyId belongs to

type PccPolicy

type PccPolicy struct {
	PccRules      map[string]*models.PccRule
	QosDecs       map[string]*models.QosData
	SessionPolicy map[string]*SessionPolicy // dnn is key
}

type PcfSubscriberPolicyData

type PcfSubscriberPolicyData struct {
	PccPolicy map[string]*PccPolicy // sst+sd is key
	Supi      string
}

func GetSubscriberPolicy

func GetSubscriberPolicy(ctx context.Context, imsi string) (*PcfSubscriberPolicyData, error)

type SessionPolicy

type SessionPolicy struct {
	SessionRules map[string]*models.SessionRule
}

type UeAMPolicyData

type UeAMPolicyData struct {
	AccessType  models.AccessType
	ServingPlmn *models.PlmnID
	Guami       *models.Guami
	Pras        map[string]models.PresenceInfo
	PcfUe       *UeContext
	ServAreaRes *models.ServiceAreaRestriction
	UserLoc     *models.UserLocation
	TimeZone    string
	Triggers    []models.RequestTrigger
	Rfsp        int32
}

type UeContext

type UeContext struct {
	SmPolicyData              map[string]*UeSmPolicyData // use smPolicyId(ue.Supi-pduSessionID) as key
	Supi                      string
	Gpsi                      string
	Pei                       string
	AMPolicyData              map[string]*UeAMPolicyData // use PolAssoId(ue.Supi-numPolId) as key
	PolAssociationIDGenerator uint32
}

func (*UeContext) FindAMPolicy

func (ue *UeContext) FindAMPolicy(anType models.AccessType, plmnID *models.PlmnID) *UeAMPolicyData

returns AM Policy which AccessType and plmnID match

func (*UeContext) NewUeAMPolicyData

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

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

type UeSmPolicyData

type UeSmPolicyData struct {
	PackFiltMapToPccRuleID map[string]string    // use PackFiltID as Key
	SmPolicyData           *models.SmPolicyData // Svbscription Data
	PolicyContext          *models.SmPolicyContextData
	AppSessions            map[string]bool // related appSessionId
	PcfUe                  *UeContext
}

Jump to

Keyboard shortcuts

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