context

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Copyright 2024 Ella Networks

Index

Constants

View Source
const (
	MaxNumOfTAI                       int   = 16
	MaxNumOfBroadcastPLMNs            int   = 12
	MaxNumOfPLMNs                     int   = 12
	MaxNumOfSlice                     int   = 1024
	MaxNumOfAllowedSnssais            int   = 8
	MaxValueOfAmfUeNgapId             int64 = 1099511627775
	MaxNumOfServedGuamiList           int   = 256
	MaxNumOfPDUSessions               int   = 256
	MaxNumOfDRBs                      int   = 32
	MaxNumOfAOI                       int   = 64
	MaxT3513RetryTimes                int   = 4
	MaxT3522RetryTimes                int   = 4
	MaxT3550RetryTimes                int   = 4
	MaxT3560RetryTimes                int   = 4
	MaxT3565RetryTimes                int   = 4
	MAxNumOfAlgorithm                 int   = 8
	DefaultT3502                      int   = 720  // 12 min
	DefaultT3512                      int   = 3240 // 54 min
	DefaultNon3gppDeregistrationTimer int   = 3240 // 54 min
)
View Source
const (
	TimeT3513 time.Duration = 6 * time.Second
	TimeT3522 time.Duration = 6 * time.Second
	TimeT3550 time.Duration = 6 * time.Second
	TimeT3560 time.Duration = 6 * time.Second
	TimeT3565 time.Duration = 6 * time.Second
)

timers at AMF side, defined in TS 24.501 table 10.2.2

View Source
const (
	RanPresentGNbId   = 1
	RanPresentNgeNbId = 2
	RanPresentN3IwfId = 3
	RanConnected      = "Connected"
	RanDisconnected   = "Disconnected"
)
View Source
const (
	NgRanCgiPresentNRCGI    int32 = 0
	NgRanCgiPresentEUTRACGI int32 = 1
)
View Source
const (
	RecommendRanNodePresentRanNode int32 = 0
	RecommendRanNodePresentTAI     int32 = 1
)
View Source
const (
	Deregistered            fsm.StateType = "Deregistered"
	DeregistrationInitiated fsm.StateType = "DeregistrationInitiated"
	Authentication          fsm.StateType = "Authentication"
	SecurityMode            fsm.StateType = "SecurityMode"
	ContextSetup            fsm.StateType = "ContextSetup"
	Registered              fsm.StateType = "Registered"
)

GMM state for UE

View Source
const (
	RanUeNgapIdUnspecified int64 = 0xffffffff
)

Variables

This section is empty.

Functions

func AttachSourceUeTargetUe

func AttachSourceUeTargetUe(sourceUe, targetUe *RanUe)

func CompareUserLocation

func CompareUserLocation(loc1 models.UserLocation, loc2 models.UserLocation) bool

func DetachSourceUeTargetUe

func DetachSourceUeTargetUe(ranUe *RanUe)

func GetServedGuamiList

func GetServedGuamiList() []models.Guami

func GetSupportTaiList

func GetSupportTaiList() []models.Tai

func InTaiList

func InTaiList(servedTai models.Tai, taiList []models.Tai) bool

func TacInAreas

func TacInAreas(targetTac string, areas []models.Area) bool

Types

type AMFContext

type AMFContext struct {
	DbInstance                      *db.Database
	UePool                          sync.Map         // map[supi]*AmfUe
	RanUePool                       sync.Map         // map[AmfUeNgapID]*RanUe
	AmfRanPool                      sync.Map         // map[net.Conn]*AmfRan
	LadnPool                        map[string]*LADN // dnn as key
	RelativeCapacity                int64
	NfId                            string
	Name                            string
	UriScheme                       models.UriScheme
	NgapPort                        int
	NetworkFeatureSupport5GS        *NetworkFeatureSupport5GS
	SupportedDnns                   []string
	SecurityAlgorithm               SecurityAlgorithm
	NetworkName                     NetworkName
	NgapIpList                      []string // NGAP Server IP
	T3502Value                      int      // unit is second
	T3512Value                      int      // unit is second
	Non3gppDeregistrationTimerValue int      // unit is second
	// read-only fields
	T3513Cfg TimerValue
	T3522Cfg TimerValue
	T3550Cfg TimerValue
	T3560Cfg TimerValue
	T3565Cfg TimerValue
}

func AMF_Self

func AMF_Self() *AMFContext

Create new AMF context

func (*AMFContext) AddAmfUeToUePool

func (context *AMFContext) AddAmfUeToUePool(ue *AmfUe, supi string)

func (*AMFContext) AllocateAmfUeNgapID

func (context *AMFContext) AllocateAmfUeNgapID() (int64, error)

func (*AMFContext) AllocateGutiToUe

func (context *AMFContext) AllocateGutiToUe(ue *AmfUe)

func (*AMFContext) AllocateRegistrationArea

func (context *AMFContext) AllocateRegistrationArea(ue *AmfUe, anType models.AccessType)

func (*AMFContext) AmfRanFindByConn

func (context *AMFContext) AmfRanFindByConn(conn net.Conn) (*AmfRan, bool)

use net.Conn to find RAN context, return *AmfRan and ok bit

func (*AMFContext) AmfRanFindByGnbId

func (context *AMFContext) AmfRanFindByGnbId(gnbId string) (*AmfRan, bool)

func (*AMFContext) AmfRanFindByRanID

func (context *AMFContext) AmfRanFindByRanID(ranNodeID models.GlobalRanNodeId) (*AmfRan, bool)

use ranNodeID to find RAN context, return *AmfRan and ok bit

func (*AMFContext) AmfUeDeleteBySuci

func (context *AMFContext) AmfUeDeleteBySuci(suci string) (ue *AmfUe, ok bool)

func (*AMFContext) AmfUeFindByGuti

func (context *AMFContext) AmfUeFindByGuti(guti string) (ue *AmfUe, ok bool)

func (*AMFContext) AmfUeFindByGutiLocal

func (context *AMFContext) AmfUeFindByGutiLocal(guti string) (ue *AmfUe, ok bool)

func (*AMFContext) AmfUeFindByPolicyAssociationID

func (context *AMFContext) AmfUeFindByPolicyAssociationID(polAssoId string) (ue *AmfUe, ok bool)

func (*AMFContext) AmfUeFindBySuci

func (context *AMFContext) AmfUeFindBySuci(suci string) (ue *AmfUe, ok bool)

func (*AMFContext) AmfUeFindBySupi

func (context *AMFContext) AmfUeFindBySupi(supi string) (ue *AmfUe, ok bool)

func (*AMFContext) AmfUeFindBySupiLocal

func (context *AMFContext) AmfUeFindBySupiLocal(supi string) (ue *AmfUe, ok bool)

func (*AMFContext) AmfUeFindByUeContextID

func (context *AMFContext) AmfUeFindByUeContextID(ueContextID string) (*AmfUe, bool)

func (*AMFContext) DeleteAmfRan

func (context *AMFContext) DeleteAmfRan(conn net.Conn)

func (*AMFContext) Get5gsNwFeatSuppEmc

func (context *AMFContext) Get5gsNwFeatSuppEmc() uint8

func (*AMFContext) Get5gsNwFeatSuppEmcN3

func (context *AMFContext) Get5gsNwFeatSuppEmcN3() uint8

func (*AMFContext) Get5gsNwFeatSuppEmf

func (context *AMFContext) Get5gsNwFeatSuppEmf() uint8

func (*AMFContext) Get5gsNwFeatSuppEnable

func (context *AMFContext) Get5gsNwFeatSuppEnable() bool

func (*AMFContext) Get5gsNwFeatSuppImsVoPS

func (context *AMFContext) Get5gsNwFeatSuppImsVoPS() uint8

func (*AMFContext) Get5gsNwFeatSuppIwkN26

func (context *AMFContext) Get5gsNwFeatSuppIwkN26() uint8

func (*AMFContext) Get5gsNwFeatSuppMcsi

func (context *AMFContext) Get5gsNwFeatSuppMcsi() uint8

func (*AMFContext) Get5gsNwFeatSuppMpsi

func (context *AMFContext) Get5gsNwFeatSuppMpsi() uint8

func (*AMFContext) GetIPv4Uri

func (context *AMFContext) GetIPv4Uri() string

func (*AMFContext) InPlmnSupportList

func (context *AMFContext) InPlmnSupportList(snssai models.Snssai) bool

func (*AMFContext) InSupportDnnList

func (context *AMFContext) InSupportDnnList(targetDnn string) bool

func (*AMFContext) ListAmfRan added in v0.0.5

func (context *AMFContext) ListAmfRan() []AmfRan

func (*AMFContext) NewAmfRan

func (context *AMFContext) NewAmfRan(conn net.Conn) *AmfRan

func (*AMFContext) NewAmfUe

func (context *AMFContext) NewAmfUe(supi string) *AmfUe

func (*AMFContext) RanUeFindByAmfUeNgapID

func (context *AMFContext) RanUeFindByAmfUeNgapID(amfUeNgapID int64) *RanUe

func (*AMFContext) RanUeFindByAmfUeNgapIDLocal

func (context *AMFContext) RanUeFindByAmfUeNgapIDLocal(amfUeNgapID int64) *RanUe

func (*AMFContext) ReAllocateGutiToUe

func (context *AMFContext) ReAllocateGutiToUe(ue *AmfUe)

func (*AMFContext) TmsiAllocate

func (context *AMFContext) TmsiAllocate() int32

type AmfRan

type AmfRan struct {
	RanPresent int
	RanId      *models.GlobalRanNodeId
	Name       string
	AnType     models.AccessType
	GnbIp      string `json:"-"`
	GnbId      string // RanId in string format, i.e.,mcc:mnc:gnbid
	/* socket Connect*/
	Conn net.Conn `json:"-"`
	/* Supported TA List */
	SupportedTAList []SupportedTAI

	/* RAN UE List */
	RanUeList []*RanUe `json:"-"` // RanUeNgapId as key

	/* logger */
	Log *zap.SugaredLogger `json:"-"`
}

func ListAmfRan added in v0.0.5

func ListAmfRan() []AmfRan

func (*AmfRan) ConvertGnbIdToRanId

func (ran *AmfRan) ConvertGnbIdToRanId(gnbId string) (ranNodeId *models.GlobalRanNodeId)

func (*AmfRan) NewRanUe

func (ran *AmfRan) NewRanUe(ranUeNgapID int64) (*RanUe, error)

func (*AmfRan) RanID

func (ran *AmfRan) RanID() string

func (*AmfRan) RanUeFindByRanUeNgapID

func (ran *AmfRan) RanUeFindByRanUeNgapID(ranUeNgapID int64) *RanUe

func (*AmfRan) RanUeFindByRanUeNgapIDLocal

func (ran *AmfRan) RanUeFindByRanUeNgapIDLocal(ranUeNgapID int64) *RanUe

func (*AmfRan) Remove

func (ran *AmfRan) Remove()

func (*AmfRan) RemoveAllUeInRan

func (ran *AmfRan) RemoveAllUeInRan()

func (*AmfRan) SetRanId

func (ran *AmfRan) SetRanId(ranNodeId *ngapType.GlobalRANNodeID)

type AmfUe

type AmfUe struct {
	// Mutex sync.Mutex `json:"mutex,omitempty" yaml:"mutex" bson:"mutex,omitempty"`
	Mutex sync.Mutex `json:"-"`
	/* the AMF which serving this AmfUe now */
	ServingAMF *AMFContext `json:"servingAMF,omitempty"` // never nil

	/* Gmm State */
	State map[models.AccessType]*fsm.State `json:"-"`
	/* Registration procedure related context */
	RegistrationType5GS                uint8                           `json:"registrationType5GS,omitempty"`
	IdentityTypeUsedForRegistration    uint8                           `json:"identityTypeUsedForRegistration,omitempty"`
	RegistrationRequest                *nasMessage.RegistrationRequest `json:"registrationRequest,omitempty"`
	ServingAmfChanged                  bool                            `json:"servingAmfChanged,omitempty"`
	DeregistrationTargetAccessType     uint8                           `json:"deregistrationTargetAccessType,omitempty"` // only used when deregistration procedure is initialized by the network
	RegistrationAcceptForNon3GPPAccess []byte                          `json:"registrationAcceptForNon3GPPAccess,omitempty"`
	RetransmissionOfInitialNASMsg      bool                            `json:"retransmissionOfInitialNASMsg,omitempty"`
	/* Used for AMF relocation */
	TargetAmfUri string `json:"targetAmfUri,omitempty"`
	/* Ue Identity*/
	PlmnId              models.PlmnId `json:"plmnId,omitempty"`
	Suci                string        `json:"suci,omitempty"`
	Supi                string        `json:"supi,omitempty"`
	UnauthenticatedSupi bool          `json:"unauthenticatedSupi,omitempty"`
	Gpsi                string        `json:"gpsi,omitempty"`
	Pei                 string        `json:"pei,omitempty"`
	Tmsi                int32         `json:"tmsi,omitempty"` // 5G-Tmsi
	Guti                string        `json:"guti,omitempty"`
	GroupID             string        `json:"groupID,omitempty"`
	EBI                 int32         `json:"ebi,omitempty"`
	/* Ue Identity*/
	EventSubscriptionsInfo map[string]*AmfUeEventSubscription `json:"eventSubscriptionInfo,omitempty"`
	/* User Location*/
	RatType                  models.RatType      `json:"ratType,omitempty"`
	Location                 models.UserLocation `json:"location,omitempty"`
	Tai                      models.Tai          `json:"tai,omitempty"`
	LocationChanged          bool                `json:"locationChanged,omitempty"`
	LastVisitedRegisteredTai models.Tai          `json:"lastVisitedRegisteredTai,omitempty"`
	TimeZone                 string              `json:"timezone,omitempty"`
	/* context about udm */
	// UdmId                             string                                    `json:"udmId,omitempty"`
	SubscriptionDataValid             bool                                      `json:"subscriptionDataValid,omitempty"`
	Reachability                      models.UeReachability                     `json:"reachability,omitempty"`
	SubscribedData                    models.SubscribedData                     `json:"subscribedData,omitempty"`
	SmfSelectionData                  *models.SmfSelectionSubscriptionData      `json:"smfSelectionData,omitempty"`
	UeContextInSmfData                *models.UeContextInSmfData                `json:"ueContextInSmfData,omitempty"`
	TraceData                         *models.TraceData                         `json:"traceData,omitempty"`
	UdmGroupId                        string                                    `json:"udmGroupId,omitempty"`
	SubscribedNssai                   []models.SubscribedSnssai                 `json:"subscribeNssai,omitempty"`
	AccessAndMobilitySubscriptionData *models.AccessAndMobilitySubscriptionData `json:"accessAndMobilitySubscriptionData,omitempty"`
	/* contex abut ausf */
	AusfGroupId                       string                      `json:"ausfGroupId,omitempty"`
	AusfId                            string                      `json:"ausfId,omitempty"`
	RoutingIndicator                  string                      `json:"routingIndicator,omitempty"`
	AuthenticationCtx                 *models.UeAuthenticationCtx `json:"authenticationCtx,omitempty"`
	AuthFailureCauseSynchFailureTimes int                         `json:"authFailureCauseSynchFailureTimes,omitempty"`
	ABBA                              []uint8                     `json:"abba,omitempty"`
	Kseaf                             string                      `json:"kseaf,omitempty"`
	Kamf                              string                      `json:"kamf,omitempty"`
	/* context about PCF */
	PolicyAssociationId          string                    `json:"policyAssociationId,omitempty"`
	AmPolicyUri                  string                    `json:"amPolicyUri,omitempty"`
	AmPolicyAssociation          *models.PolicyAssociation `json:"amPolicyAssociation,omitempty"`
	RequestTriggerLocationChange bool                      `json:"requestTriggerLocationChange,omitempty"` // true if AmPolicyAssociation.Trigger contains RequestTrigger_LOC_CH
	ConfigurationUpdateMessage   []byte                    `json:"configurationUpdateMessage,omitempty"`
	/* UeContextForHandover*/
	HandoverNotifyUri string `json:"handoverNotifyUri,omitempty"`
	/* N1N2Message */
	N1N2MessageIDGenerator          *idgenerator.IDGenerator `json:"n1n2MessageIDGenerator,omitempty"`
	N1N2Message                     *N1N2Message             `json:"-"`
	N1N2MessageSubscribeIDGenerator *idgenerator.IDGenerator `json:"n1n2MessageSubscribeIDGenerator,omitempty"`
	// map[int64]models.UeN1N2InfoSubscriptionCreateData; use n1n2MessageSubscriptionID as key
	N1N2MessageSubscription sync.Map `json:"n1n2MessageSubscription,omitempty"`
	/* Pdu Sesseion context */
	SmContextList sync.Map `json:"-"` // map[int32]*SmContext, pdu session id as key
	/* Related Context*/
	//RanUe map[models.AccessType]*RanUe `json:"ranUe,omitempty" yaml:"ranUe" bson:"ranUe,omitempty"`
	RanUe map[models.AccessType]*RanUe `json:"ranUe,omitempty"`
	/* other */
	OnGoing                       map[models.AccessType]*OnGoingProcedureWithPrio `json:"onGoing,omitempty"`
	UeRadioCapability             string                                          `json:"ueRadioCapability,omitempty"` // OCTET string
	Capability5GMM                nasType.Capability5GMM                          `json:"capability5GMM,omitempty"`
	ConfigurationUpdateIndication nasType.ConfigurationUpdateIndication           `json:"configurationUpdateIndication,omitempty"`
	/* context related to Paging */
	UeRadioCapabilityForPaging                 *UERadioCapabilityForPaging                 `json:"ueRadioCapabilityForPaging,omitempty"`
	InfoOnRecommendedCellsAndRanNodesForPaging *InfoOnRecommendedCellsAndRanNodesForPaging `json:"infoOnRecommendedCellsAndRanNodesForPaging,omitempty"`
	UESpecificDRX                              uint8                                       `json:"ueSpecificDRX,omitempty"`
	/* Security Context */
	SecurityContextAvailable bool                         `json:"securityContextAvailable,omitempty"`
	UESecurityCapability     nasType.UESecurityCapability `json:"ueSecurityCapability,omitempty"` // for security command
	NgKsi                    models.NgKsi                 `json:"ngKsi,omitempty"`
	MacFailed                bool                         `json:"macFailed,omitempty"` // set to true if the integrity check of current NAS message is failed
	KnasInt                  [16]uint8                    `json:"knasInt,omitempty"`   // 16 byte
	KnasEnc                  [16]uint8                    `json:"knasEnc,omitempty"`   // 16 byte
	Kgnb                     []uint8                      `json:"kgnb,omitempty"`      // 32 byte
	Kn3iwf                   []uint8                      `json:"kn3iwf,omitempty"`    // 32 byte
	NH                       []uint8                      `json:"nh,omitempty"`        // 32 byte
	NCC                      uint8                        `json:"ncc,omitempty"`       // 0..7
	// ULCount                  security.Count               `json:"ulCount,omitempty" yaml:"ulCount" bson:"ulCount,omitempty"`
	// DLCount                  security.Count               `json:"dlCount,omitempty" yaml:"dlCount" bson:"dlCount,omitempty"`
	ULCount      security.Count `json:"-"`
	DLCount      security.Count `json:"-"`
	CipheringAlg uint8          `json:"cipheringAlg,omitempty"`
	IntegrityAlg uint8          `json:"integrityAlg,omitempty"`
	/* Registration Area */
	RegistrationArea map[models.AccessType][]models.Tai `json:"registrationArea,omitempty"`
	LadnInfo         []LADN                             `json:"ladnInfo,omitempty"`
	/* Network Slicing related context and Nssf */
	NetworkSliceInfo                  *models.AuthorizedNetworkSliceInfo           `json:"networkSliceInfo,omitempty"`
	AllowedNssai                      map[models.AccessType][]models.AllowedSnssai `json:"allowedNssai,omitempty"`
	ConfiguredNssai                   []models.ConfiguredSnssai                    `json:"configuredNssai,omitempty"`
	NetworkSlicingSubscriptionChanged bool                                         `json:"networkSlicingSubscriptionChanged,omitempty"`
	/* T3513(Paging) */
	T3513 *Timer `json:"t3513Value,omitempty"` // for paging
	/* T3565(Notification) */
	T3565 *Timer `json:"t3565Value,omitempty"` // for NAS Notification
	/* T3560 (for authentication request/security mode command retransmission) */
	T3560 *Timer `json:"t3560Value,omitempty"`
	/* T3550 (for registration accept retransmission) */
	T3550 *Timer `json:"t3550Value,omitempty"`
	/* T3522 (for deregistration request) */
	T3522 *Timer `json:"t3522Value,omitempty"`
	/* Ue Context Release Cause */
	ReleaseCause map[models.AccessType]*CauseAll `json:"releaseCause,omitempty"`
	/* T3502 (Assigned by AMF, and used by UE to initialize registration procedure) */
	T3502Value                      int `json:"t3502Value,omitempty"`                      // Second
	T3512Value                      int `json:"t3512Value,omitempty"`                      // default 54 min
	Non3gppDeregistrationTimerValue int `json:"non3gppDeregistrationTimerValue,omitempty"` // default 54 min

	// AmfInstanceName and Ip
	AmfInstanceName string        `json:"amfInstanceName,omitempty"`
	AmfInstanceIp   string        `json:"amfInstanceIp,omitempty"`
	EventChannel    *EventChannel `json:"-"`

	NASLog      *zap.SugaredLogger `json:"-"`
	GmmLog      *zap.SugaredLogger `json:"-"`
	TxLog       *zap.SugaredLogger `json:"-"`
	ProducerLog *zap.SugaredLogger `json:"-"`
}

func (*AmfUe) AttachRanUe

func (ue *AmfUe) AttachRanUe(ranUe *RanUe)

func (*AmfUe) ClearRegistrationData

func (ue *AmfUe) ClearRegistrationData()

this method called when we are reusing the same uecontext during the registration procedure

func (*AmfUe) ClearRegistrationRequestData

func (ue *AmfUe) ClearRegistrationRequestData(accessType models.AccessType)

this is clearing the transient data of registration request, this is called entrypoint of Deregistration and Registration state

func (*AmfUe) CmConnect

func (ue *AmfUe) CmConnect(anType models.AccessType) bool

func (*AmfUe) CmIdle

func (ue *AmfUe) CmIdle(anType models.AccessType) bool

func (*AmfUe) CopyDataFromUeContextModel

func (ue *AmfUe) CopyDataFromUeContextModel(ueContext models.UeContext)

func (*AmfUe) DerivateAlgKey

func (ue *AmfUe) DerivateAlgKey()

Algorithm key Derivation function defined in TS 33.501 Annex A.9

func (*AmfUe) DerivateAnKey

func (ue *AmfUe) DerivateAnKey(anType models.AccessType)

Access Network key Derivation function defined in TS 33.501 Annex A.9

func (*AmfUe) DerivateKamf

func (ue *AmfUe) DerivateKamf()

Kamf Derivation function defined in TS 33.501 Annex A.7

func (*AmfUe) DerivateNH

func (ue *AmfUe) DerivateNH(syncInput []byte)

NH Derivation function defined in TS 33.501 Annex A.10

func (*AmfUe) DetachRanUe

func (ue *AmfUe) DetachRanUe(anType models.AccessType)

func (*AmfUe) GetAnType

func (ue *AmfUe) GetAnType() models.AccessType

func (*AmfUe) GetCmInfo

func (ue *AmfUe) GetCmInfo() (cmInfos []models.CmInfo)

func (*AmfUe) GetNsiInformationFromSnssai

func (ue *AmfUe) GetNsiInformationFromSnssai(anType models.AccessType, snssai models.Snssai) *models.NsiInformation

func (*AmfUe) GetOnGoing

func (ue *AmfUe) GetOnGoing(anType models.AccessType) OnGoingProcedureWithPrio

func (*AmfUe) HasWildCardSubscribedDNN

func (ue *AmfUe) HasWildCardSubscribedDNN() bool

func (*AmfUe) InAllowedNssai

func (ue *AmfUe) InAllowedNssai(targetSNssai models.Snssai, anType models.AccessType) bool

func (*AmfUe) InSubscribedNssai

func (ue *AmfUe) InSubscribedNssai(targetSNssai models.Snssai) bool

func (*AmfUe) NewEventChannel

func (ue *AmfUe) NewEventChannel() (tx *EventChannel)

func (*AmfUe) Remove

func (ue *AmfUe) Remove()

func (*AmfUe) RemoveAmPolicyAssociation

func (ue *AmfUe) RemoveAmPolicyAssociation()

func (*AmfUe) SecurityContextIsValid

func (ue *AmfUe) SecurityContextIsValid() bool

func (*AmfUe) SelectSecurityAlg

func (ue *AmfUe) SelectSecurityAlg(intOrder, encOrder []uint8)

func (*AmfUe) SetEventChannel

func (ue *AmfUe) SetEventChannel(handler func(*AmfUe, NgapMsg))

func (*AmfUe) SetOnGoing

func (ue *AmfUe) SetOnGoing(anType models.AccessType, onGoing *OnGoingProcedureWithPrio)

func (*AmfUe) SmContextFindByPDUSessionID

func (ue *AmfUe) SmContextFindByPDUSessionID(pduSessionID int32) (*SmContext, bool)

func (*AmfUe) StoreSmContext

func (ue *AmfUe) StoreSmContext(pduSessionID int32, smContext *SmContext)

func (*AmfUe) TaiListInRegistrationArea

func (ue *AmfUe) TaiListInRegistrationArea(taiList []models.Tai, accessType models.AccessType) bool

func (*AmfUe) UpdateNH

func (ue *AmfUe) UpdateNH()

func (*AmfUe) UpdateSecurityContext

func (ue *AmfUe) UpdateSecurityContext(anType models.AccessType)

type AmfUeEventSubscription

type AmfUeEventSubscription struct {
	Timestamp         time.Time
	AnyUe             bool
	RemainReports     *int32
	EventSubscription *models.AmfEventSubscription
}

type CauseAll

type CauseAll struct {
	Cause        *models.Cause
	NgapCause    *models.NgApCause
	Var5GmmCause *int32
}

type EventChannel

type EventChannel struct {
	Message     chan interface{}
	Event       chan string
	AmfUe       *AmfUe
	NasHandler  func(*AmfUe, NasMsg)
	NgapHandler func(*AmfUe, NgapMsg)
	SbiHandler  func(s1, s2 string, msg interface{}) (interface{}, string, interface{}, interface{})
}

func (*EventChannel) Start

func (tx *EventChannel) Start()

func (*EventChannel) SubmitMessage

func (tx *EventChannel) SubmitMessage(msg interface{})

func (*EventChannel) UpdateNasHandler

func (tx *EventChannel) UpdateNasHandler(handler func(*AmfUe, NasMsg))

func (*EventChannel) UpdateNgapHandler

func (tx *EventChannel) UpdateNgapHandler(handler func(*AmfUe, NgapMsg))

func (*EventChannel) UpdateSbiHandler

func (tx *EventChannel) UpdateSbiHandler(handler func(s1, s2 string, msg interface{}) (interface{}, string, interface{}, interface{}))

type InfoOnRecommendedCellsAndRanNodesForPaging

type InfoOnRecommendedCellsAndRanNodesForPaging struct {
	RecommendedCells    []RecommendedCell  // RecommendedCellsForPaging
	RecommendedRanNodes []RecommendRanNode // RecommendedRanNodesForPaging
}

TS 38.413 9.3.1.100

type InterfaceMsg

type InterfaceMsg interface{}

type InterfaceType

type InterfaceType uint8
const (
	NgapMessage InterfaceType = iota
	SbiMessage
	NasMessage
)

type LADN

type LADN struct {
	Dnn      string
	TaiLists []models.Tai
}

type N1N2Message

type N1N2Message struct {
	Request     models.N1N2MessageTransferRequest
	Status      models.N1N2MessageTransferCause
	ResourceUri string
}

type NGRANCGI

type NGRANCGI struct {
	Present  int32
	NRCGI    *models.Ncgi
	EUTRACGI *models.Ecgi
}

type NasMsg

type NasMsg struct {
	AnType        models.AccessType
	NasMsg        []byte
	ProcedureCode int64
}

type NetworkFeatureSupport5GS

type NetworkFeatureSupport5GS struct {
	Enable  bool
	ImsVoPS uint8
	Emc     uint8
	Emf     uint8
	IwkN26  uint8
	Mpsi    uint8
	EmcN3   uint8
	Mcsi    uint8
}

type NetworkName

type NetworkName struct {
	Full  string
	Short string
}

type NgapMsg

type NgapMsg struct {
	NgapMsg *ngapType.NGAPPDU
	Ran     *AmfRan
}

type OnGoingProcedure

type OnGoingProcedure string
const (
	OnGoingProcedureNothing      OnGoingProcedure = "Nothing"
	OnGoingProcedurePaging       OnGoingProcedure = "Paging"
	OnGoingProcedureN2Handover   OnGoingProcedure = "N2Handover"
	OnGoingProcedureRegistration OnGoingProcedure = "Registration"
	OnGoingProcedureAbort        OnGoingProcedure = "Abort"
)

type OnGoingProcedureWithPrio

type OnGoingProcedureWithPrio struct {
	Procedure OnGoingProcedure
	Ppi       int32 // Paging priority
}

type PlmnSupportItem

type PlmnSupportItem struct {
	PlmnId     models.PlmnId
	SNssaiList []models.Snssai
}

func GetPlmnSupportList

func GetPlmnSupportList() []PlmnSupportItem

type RanUe

type RanUe struct {
	/* UE identity*/
	RanUeNgapId int64 `json:"ranUeNgapId,omitempty"`
	AmfUeNgapId int64 `json:"amfUeNgapId,omitempty"`

	/* HandOver Info*/
	HandOverType        ngapType.HandoverType
	SuccessPduSessionId []int32 `json:"successPduSessionId,omitempty"`
	SourceUe            *RanUe  `json:"-"`
	TargetUe            *RanUe  `json:"-"`

	/* UserLocation*/
	Tai      models.Tai
	Location models.UserLocation
	/* context about udm */
	SupportVoPSn3gpp  bool       `json:"-"`
	SupportVoPS       bool       `json:"-"`
	SupportedFeatures string     `json:"-"`
	LastActTime       *time.Time `json:"-"`

	/* Related Context*/
	AmfUe *AmfUe `json:"-"`
	Ran   *AmfRan

	/* Routing ID */
	RoutingID string
	/* Trace Recording Session Reference */
	Trsr string
	/* Ue Context Release Action */
	ReleaseAction RelAction
	/* context used for AMF Re-allocation procedure */
	OldAmfName            string
	InitialUEMessage      []byte
	RRCEstablishmentCause string // Received from initial ue message; pattern: ^[0-9a-fA-F]+$
	UeContextRequest      bool

	/* send initial context setup request or not*/
	SentInitialContextSetupRequest bool

	/*Received Initial context setup response or not */
	RecvdInitialContextSetupResponse bool

	/* logger */
	Log *zap.SugaredLogger `json:"-"`
}

func (*RanUe) DetachAmfUe

func (ranUe *RanUe) DetachAmfUe()

func (*RanUe) Remove

func (ranUe *RanUe) Remove() error

func (*RanUe) SwitchToRan

func (ranUe *RanUe) SwitchToRan(newRan *AmfRan, ranUeNgapId int64) error

func (*RanUe) UpdateLocation

func (ranUe *RanUe) UpdateLocation(userLocationInformation *ngapType.UserLocationInformation)

type RecommendRanNode

type RecommendRanNode struct {
	Present         int32
	GlobalRanNodeId *models.GlobalRanNodeId
	Tai             *models.Tai
}

TS 38.413 9.3.1.101

type RecommendedCell

type RecommendedCell struct {
	NgRanCGI         NGRANCGI
	TimeStayedInCell *int64
}

TS 38.413 9.3.1.71

type RelAction

type RelAction int
const (
	UeContextN2NormalRelease RelAction = iota
	UeContextReleaseHandover
	UeContextReleaseUeContext
	UeContextReleaseDueToNwInitiatedDeregistraion
)

type SbiMsg

type SbiMsg struct {
	Msg         interface{}
	UeContextId string
	ReqUri      string

	Result chan SbiResponseMsg
}

type SbiResponseMsg

type SbiResponseMsg struct {
	RespData       interface{}
	LocationHeader string
	ProblemDetails interface{}
	TransferErr    interface{}
}

type Security

type Security struct {
	IntegrityOrder []string
	CipheringOrder []string
}

type SecurityAlgorithm

type SecurityAlgorithm struct {
	IntegrityOrder []uint8 // slice of security.AlgIntegrityXXX
	CipheringOrder []uint8 // slice of security.AlgCipheringXXX
}

type SmContext

type SmContext struct {
	Mu *sync.RWMutex // protect the following fields

	// pdu session information
	PduSessionIDVal int32
	SmContextRefVal string
	SnssaiVal       models.Snssai
	DnnVal          string
	AccessTypeVal   models.AccessType
	NsInstanceVal   string
	UserLocationVal models.UserLocation
	PlmnIDVal       models.PlmnId

	// SMF information
	SmfIDVal string
	// SmfUriVal string
	HSmfIDVal string
	VSmfIDVal string

	// status of pdusession
	PduSessionInactiveVal bool

	// for duplicate pdu session id handling
	UlNASTransportVal *nasMessage.ULNASTransport
	DuplicatedVal     bool

	SmfProfiles []models.NfProfile
}

func NewSmContext

func NewSmContext(pduSessionID int32) *SmContext

func (*SmContext) AccessType

func (c *SmContext) AccessType() models.AccessType

func (*SmContext) DeleteULNASTransport

func (c *SmContext) DeleteULNASTransport()

func (*SmContext) Dnn

func (c *SmContext) Dnn() string

func (*SmContext) HSmfID

func (c *SmContext) HSmfID() string

func (*SmContext) IsPduSessionActive

func (c *SmContext) IsPduSessionActive() bool

func (*SmContext) NsInstance

func (c *SmContext) NsInstance() string

func (*SmContext) PduSessionID

func (c *SmContext) PduSessionID() int32

func (*SmContext) PduSessionIDDuplicated

func (c *SmContext) PduSessionIDDuplicated() bool

func (*SmContext) PlmnID

func (c *SmContext) PlmnID() models.PlmnId

func (*SmContext) SetAccessType

func (c *SmContext) SetAccessType(accessType models.AccessType)

func (*SmContext) SetDnn

func (c *SmContext) SetDnn(dnn string)

func (*SmContext) SetDuplicatedPduSessionID

func (c *SmContext) SetDuplicatedPduSessionID(duplicated bool)

func (*SmContext) SetHSmfID

func (c *SmContext) SetHSmfID(hsmfID string)

func (*SmContext) SetNsInstance

func (c *SmContext) SetNsInstance(nsInstanceID string)

func (*SmContext) SetPduSessionID

func (c *SmContext) SetPduSessionID(id int32)

func (*SmContext) SetPduSessionInActive

func (c *SmContext) SetPduSessionInActive(s bool)

func (*SmContext) SetPlmnID

func (c *SmContext) SetPlmnID(plmnID models.PlmnId)

func (*SmContext) SetSmContextRef

func (c *SmContext) SetSmContextRef(ref string)

func (*SmContext) SetSnssai

func (c *SmContext) SetSnssai(snssai models.Snssai)

func (*SmContext) SetUserLocation

func (c *SmContext) SetUserLocation(userLocation models.UserLocation)

func (*SmContext) SetVSmfID

func (c *SmContext) SetVSmfID(vsmfID string)

func (*SmContext) SmContextRef

func (c *SmContext) SmContextRef() string

func (*SmContext) Snssai

func (c *SmContext) Snssai() models.Snssai

func (*SmContext) StoreULNASTransport

func (c *SmContext) StoreULNASTransport(msg *nasMessage.ULNASTransport)

func (*SmContext) ULNASTransport

func (c *SmContext) ULNASTransport() *nasMessage.ULNASTransport

func (*SmContext) UserLocation

func (c *SmContext) UserLocation() models.UserLocation

func (*SmContext) VSmfID

func (c *SmContext) VSmfID() string

type SupportedTAI

type SupportedTAI struct {
	Tai        models.Tai
	SNssaiList []models.Snssai
}

func NewSupportedTAI

func NewSupportedTAI() (tai SupportedTAI)

func NewSupportedTAIList

func NewSupportedTAIList() []SupportedTAI

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

Timer can be used for retransmission, it will manage retry times automatically

func NewTimer

func NewTimer(d time.Duration, maxRetryTimes int32,
	expiredFunc func(expireTimes int32),
	cancelFunc func(),
) *Timer

NewTimer will return a Timer struct and create a goroutine. Then it calls expiredFunc every time interval d until the user call Stop(). the number of expire event is be recorded when the timer is active. When the number of expire event is > maxRetryTimes, then the timer will call cancelFunc and turns off itself. Whether expiredFunc pass a parameter expireTimes to tell the user that the current expireTimes.

func (*Timer) ExpireTimes

func (t *Timer) ExpireTimes() int32

ExpireTimes return the current expire times of the timer

func (*Timer) MaxRetryTimes

func (t *Timer) MaxRetryTimes() int32

MaxRetryTimes return the max retry times of the timer

func (*Timer) Stop

func (t *Timer) Stop()

Stop turns off the timer, after Stop, no more timeout event will be triggered. User should call Stop() only once otherwise it may hang on writing to done channel

type TimerValue

type TimerValue struct {
	Enable        bool
	ExpireTime    time.Duration
	MaxRetryTimes int32
}

type UERadioCapabilityForPaging

type UERadioCapabilityForPaging struct {
	NR    string // OCTET string
	EUTRA string // OCTET string
}

Jump to

Keyboard shortcuts

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