context

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNfServices

func AddNfServices(serviceMap *map[models.ServiceName]models.NfService, config *factory.Config, context *CHFContext)

func GenerateAccountSessionId

func GenerateAccountSessionId() uint32

func GenerateRatingSessionId

func GenerateRatingSessionId() uint32

func Init

func Init()

func InitChfContext

func InitChfContext(context *CHFContext)

Init CHF Context from config flie

Types

type CHFContext

type CHFContext struct {
	NfId                      string
	Name                      string
	Url                       string
	UriScheme                 models.UriScheme
	BindingIPv4               string
	RegisterIPv4              string
	SBIPort                   int
	NfService                 map[models.ServiceName]models.NfService
	RecordSequenceNumber      map[string]int64
	LocalRecordSequenceNumber uint64
	NrfUri                    string
	NrfCertPem                string
	UePool                    sync.Map
	OAuth2Required            bool

	RatingCfg *sm.Settings
	AbmfCfg   *sm.Settings

	RatingSessionIdGenerator  *idgenerator.IDGenerator
	AccountSessionIdGenerator *idgenerator.IDGenerator
}

func GetSelf

func GetSelf() *CHFContext

func (*CHFContext) AddChfUeToUePool

func (context *CHFContext) AddChfUeToUePool(ue *ChfUe, supi string)

func (*CHFContext) AuthorizationCheck

func (c *CHFContext) AuthorizationCheck(token string, serviceName models.ServiceName) error

func (*CHFContext) ChfUeFindBySupi

func (context *CHFContext) ChfUeFindBySupi(supi string) (*ChfUe, bool)

func (*CHFContext) GetSelfID

func (c *CHFContext) GetSelfID() string

func (*CHFContext) GetTokenCtx

func (c *CHFContext) GetTokenCtx(serviceName models.ServiceName, targetNF models.NfType) (
	context.Context, *models.ProblemDetails, error,
)

func (*CHFContext) NewCHFUe

func (context *CHFContext) NewCHFUe(supi string) (*ChfUe, error)

Allocate CHF Ue with supi and add to chf Context and returns allocated ue

type ChfUe

type ChfUe struct {
	Supi         string
	RatingGroups []int32

	QuotaValidityTime    int32
	VolumeLimit          int32
	VolumeLimitPDU       int32
	VolumeThresholdRate  float32
	NotifyUri            string
	RecordSequenceNumber int64

	// ABMF
	ReservedQuota  map[int32]int64
	UnitCost       map[int32]uint32
	AcctRequestNum map[int32]uint32
	AbmfClient     *sm.Client
	AbmfMux        *sm.StateMachine
	AcctChan       chan *diam.Message
	AcctSessionId  uint32

	// Rating
	RatingClient  *sm.Client
	RatingMux     *sm.StateMachine
	RatingChan    chan *diam.Message
	RatingType    map[int32]charging_datatype.RequestSubType
	RateSessionId uint32

	// lock
	Cdr         map[string]*cdrType.CHFRecord
	CdrFileLock fslock.Lock
	CULock      sync.Mutex
}

func (*ChfUe) FindRatingGroup

func (ue *ChfUe) FindRatingGroup(ratingGroup int32) bool

type NFContext

type NFContext interface {
	AuthorizationCheck(token string, serviceName models.ServiceName) error
}

Jump to

Keyboard shortcuts

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