context

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

ProtocolConfigurationOptions

Index

Constants

View Source
const (
	OperationCodeCreateNewQoSRule                                   uint8 = 1
	OperationCodeDeleteExistingQoSRule                              uint8 = 2
	OperationCodeModifyExistingQoSRuleAndAddPacketFilters           uint8 = 3
	OperationCodeModifyExistingQoSRuleAndReplaceAllPacketFilters    uint8 = 4
	OperationCodeModifyExistingQoSRuleAndDeletePacketFilters        uint8 = 5
	OperationCodeModifyExistingQoSRuleWithoutModifyingPacketFilters uint8 = 6
)
View Source
const (
	PacketFilterDirectionDownlink      uint8 = 1
	PacketFilterDirectionUplink        uint8 = 2
	PacketFilterDirectionBidirectional uint8 = 3
)
View Source
const (
	PacketFilterComponentTypeMatchAll                       uint8 = 0x01
	PacketFilterComponentTypeIPv4RemoteAddress              uint8 = 0x10
	PacketFilterComponentTypeIPv4LocalAddress               uint8 = 0x11
	PacketFilterComponentTypeIPv6RemoteAddress              uint8 = 0x21
	PacketFilterComponentTypeIPv6LocalAddress               uint8 = 0x23
	PacketFilterComponentTypeProtocolIdentifierOrNextHeader uint8 = 0x30
	PacketFilterComponentTypeSingleLocalPort                uint8 = 0x40
	PacketFilterComponentTypeLocalPortRange                 uint8 = 0x41
	PacketFilterComponentTypeSingleRemotePort               uint8 = 0x50
	PacketFilterComponentTypeRemotePortRange                uint8 = 0x51
	PacketFilterComponentTypeSecurityParameterIndex         uint8 = 0x60
	PacketFilterComponentTypeTypeOfServiceOrTrafficClass    uint8 = 0x70
	PacketFilterComponentTypeFlowLabel                      uint8 = 0x80
	PacketFilterComponentTypeDestinationMACAddress          uint8 = 0x81
	PacketFilterComponentTypeSourceMACAddress               uint8 = 0x82
	PacketFilterComponentType8021Q_CTAG_VID                 uint8 = 0x83
	PacketFilterComponentType8021Q_STAG_VID                 uint8 = 0x84
	PacketFilterComponentType8021Q_CTAG_PCPOrDEI            uint8 = 0x85
	PacketFilterComponentType8021Q_STAG_PCPOrDEI            uint8 = 0x86
	PacketFilterComponentTypeEthertype                      uint8 = 0x87
)

TS 24.501 Table 9.11.4.13.1

View Source
const DefaultNonGBR5QI = 9

Variables

View Source
var NFServices *[]models.NfService
View Source
var NfServiceVersion *[]models.NfServiceVersion
View Source
var SmfInfo *models.SmfInfo

Functions

func AllocateLocalSEID

func AllocateLocalSEID() uint64

func AllocateUPFID

func AllocateUPFID()

func BuildGSMPDUSessionEstablishmentAccept

func BuildGSMPDUSessionEstablishmentAccept(smContext *SMContext) ([]byte, error)

func BuildGSMPDUSessionEstablishmentReject

func BuildGSMPDUSessionEstablishmentReject(smContext *SMContext, cause uint8) ([]byte, error)

func BuildGSMPDUSessionModificationCommand

func BuildGSMPDUSessionModificationCommand(smContext *SMContext) ([]byte, error)

func BuildGSMPDUSessionReleaseCommand

func BuildGSMPDUSessionReleaseCommand(smContext *SMContext) ([]byte, error)

func BuildGSMPDUSessionReleaseReject

func BuildGSMPDUSessionReleaseReject(smContext *SMContext) ([]byte, error)

func BuildHandoverCommandTransfer

func BuildHandoverCommandTransfer(ctx *SMContext) (buf []byte, err error)

func BuildPDUSessionResourceReleaseCommandTransfer

func BuildPDUSessionResourceReleaseCommandTransfer(ctx *SMContext) (buf []byte, err error)

func BuildPDUSessionResourceSetupRequestTransfer

func BuildPDUSessionResourceSetupRequestTransfer(ctx *SMContext) ([]byte, error)

func BuildPathSwitchRequestAcknowledgeTransfer

func BuildPathSwitchRequestAcknowledgeTransfer(ctx *SMContext) ([]byte, error)

TS 38.413 9.3.4.9

func BuildPathSwitchRequestUnsuccessfulTransfer

func BuildPathSwitchRequestUnsuccessfulTransfer(causePresent int, causeValue aper.Enumerated) (buf []byte, err error)

func CheckUEHasPreConfig

func CheckUEHasPreConfig(SUPI string) (exist bool)

func GetSMContextCount

func GetSMContextCount() uint64

func HandleHandoverRequestAcknowledgeTransfer

func HandleHandoverRequestAcknowledgeTransfer(b []byte, ctx *SMContext) (err error)

func HandleHandoverRequiredTransfer

func HandleHandoverRequiredTransfer(b []byte, ctx *SMContext) (err error)

func HandlePDUSessionResourceSetupResponseTransfer

func HandlePDUSessionResourceSetupResponseTransfer(b []byte, ctx *SMContext) (err error)

func HandlePathSwitchRequestSetupFailedTransfer

func HandlePathSwitchRequestSetupFailedTransfer(b []byte, ctx *SMContext) (err error)

func HandlePathSwitchRequestTransfer

func HandlePathSwitchRequestTransfer(b []byte, ctx *SMContext) error

func IPAddrOffset

func IPAddrOffset(in, base net.IP) int

IPAddrOffset calculate the input ip with base ip offset

func IPAddrWithOffset

func IPAddrWithOffset(ip net.IP, offset int) net.IP

IPAddrWithOffset add offset on base ip

func InitSMFUERouting

func InitSMFUERouting(routingConfig *factory.RoutingConfig)

func InitSmfContext

func InitSmfContext(config *factory.Config)

func RemoveSMContext

func RemoveSMContext(ref string)

*** add unit test ***//

func RemoveUPFNodeByNodeID

func RemoveUPFNodeByNodeID(nodeID pfcpType.NodeID) bool

*** add unit test ***//

func ResolveRef

func ResolveRef(identifier string, pduSessID int32) (ref string, err error)

func SNssaiSmfInfo

func SNssaiSmfInfo() *[]models.SnssaiSmfInfoItem

func SetSessionRuleActivateState

func SetSessionRuleActivateState(rule *SessionRule, state bool)

SetSessionRuleActivateState

func SetupNFProfile

func SetupNFProfile(config *factory.Config)

func SetupSMFContext

func SetupSMFContext(config *factory.Config) error

Types

type AddingPSAState

type AddingPSAState int
const (
	ActivatingDataPath AddingPSAState = iota
	EstablishingNewPSA
	EstablishingULCL
	UpdatingPSA2DownLink
	UpdatingRANAndIUPFUpLink
	Finished
)

type BAR

type BAR struct {
	BARID uint8

	DownlinkDataNotificationDelay  pfcpType.DownlinkDataNotificationDelay
	SuggestedBufferingPacketsCount pfcpType.SuggestedBufferingPacketsCount

	State RuleState
}

Buffering Action Rule 7.5.2.6-1

type BPManager

type BPManager struct {
	BPStatus       BPStatus
	AddingPSAState AddingPSAState

	PendingUPF            PendingUPF
	ActivatedPaths        []*DataPath
	ActivatingPath        *DataPath
	UpdatedBranchingPoint map[*UPF]int
	ULCL                  *UPF
}

func NewBPManager

func NewBPManager(supi string) (bpManager *BPManager)

func (*BPManager) FindULCL

func (bpMGR *BPManager) FindULCL(smContext *SMContext) error

func (*BPManager) SelectPSA2

func (bpMGR *BPManager) SelectPSA2(smContext *SMContext)

type BPStatus

type BPStatus int
const (
	UnInitialized BPStatus = iota
	AddingPSA
	AddPSASuccess
	InitializedSuccess
	InitializedFail
)

type DNS

type DNS struct {
	IPv4Addr net.IP
	IPv6Addr net.IP
}

type DataPath

type DataPath struct {
	// meta data
	Activated         bool
	IsDefaultPath     bool
	Destination       Destination
	HasBranchingPoint bool
	// Data Path Double Link List
	FirstDPNode *DataPathNode
}

func GenerateDataPath

func GenerateDataPath(upPath UPPath, smContext *SMContext) *DataPath

func NewDataPath

func NewDataPath() *DataPath

func (*DataPath) ActivateTunnelAndPDR

func (dataPath *DataPath) ActivateTunnelAndPDR(smContext *SMContext, precedence uint32)

func (*DataPath) DeactivateTunnelAndPDR

func (dataPath *DataPath) DeactivateTunnelAndPDR(smContext *SMContext)

func (*DataPath) String

func (dataPath *DataPath) String() string

type DataPathNode

type DataPathNode struct {
	UPF *UPF

	UpLinkTunnel   *GTPTunnel
	DownLinkTunnel *GTPTunnel

	// InUse                bool
	IsBranchingPoint bool
}

func NewDataPathNode

func NewDataPathNode() *DataPathNode

func NewUEDataPathNode

func NewUEDataPathNode(name string) (node *DataPathNode, err error)

func (*DataPathNode) ActivateDownLinkTunnel

func (node *DataPathNode) ActivateDownLinkTunnel(smContext *SMContext) error

func (*DataPathNode) ActivateUpLinkTunnel

func (node *DataPathNode) ActivateUpLinkTunnel(smContext *SMContext) error

func (*DataPathNode) AddNext

func (node *DataPathNode) AddNext(next *DataPathNode)

func (*DataPathNode) AddPrev

func (node *DataPathNode) AddPrev(prev *DataPathNode)

func (*DataPathNode) DeactivateDownLinkTunnel

func (node *DataPathNode) DeactivateDownLinkTunnel(smContext *SMContext)

func (*DataPathNode) DeactivateUpLinkTunnel

func (node *DataPathNode) DeactivateUpLinkTunnel(smContext *SMContext)

func (*DataPathNode) GetNodeIP

func (node *DataPathNode) GetNodeIP() (ip string)

func (*DataPathNode) GetUPFID

func (node *DataPathNode) GetUPFID() (id string, err error)

func (*DataPathNode) GetUpLinkFAR

func (node *DataPathNode) GetUpLinkFAR() (far *FAR)

func (*DataPathNode) GetUpLinkPDR

func (node *DataPathNode) GetUpLinkPDR() (pdr *PDR)

func (*DataPathNode) IsANUPF

func (node *DataPathNode) IsANUPF() bool

func (*DataPathNode) IsAnchorUPF

func (node *DataPathNode) IsAnchorUPF() bool

func (*DataPathNode) Next

func (node *DataPathNode) Next() *DataPathNode

func (*DataPathNode) Prev

func (node *DataPathNode) Prev() *DataPathNode

type DataPathPool

type DataPathPool map[int64]*DataPath

func NewDataPathPool

func NewDataPathPool() DataPathPool

func (DataPathPool) GetDefaultPath

func (dataPathPool DataPathPool) GetDefaultPath() (dataPath *DataPath)

type Destination

type Destination struct {
	DestinationIP   string
	DestinationPort string
	Url             string
}

type DnnUPFInfoItem

type DnnUPFInfoItem struct {
	Dnn             string
	DnaiList        []string
	PduSessionTypes []models.PduSessionType
}

DnnUpfInfoItem presents UPF dnn information

func (*DnnUPFInfoItem) ContainsDNAI

func (d *DnnUPFInfoItem) ContainsDNAI(targetDnai string) bool

ContainsDNAI return true if the this dnn Info contains the specify DNAI

type FAR

type FAR struct {
	FARID uint32

	ApplyAction          pfcpType.ApplyAction
	ForwardingParameters *ForwardingParameters

	BAR   *BAR
	State RuleState
}

Forwarding Action Rule. 7.5.2.3-1

type ForwardingParameters

type ForwardingParameters struct {
	DestinationInterface pfcpType.DestinationInterface
	NetworkInstance      util_3gpp.Dnn
	OuterHeaderCreation  *pfcpType.OuterHeaderCreation
	ForwardingPolicyID   string
}

Forwarding Parameters. 7.5.2.3-2

type GTPTunnel

type GTPTunnel struct {
	SrcEndPoint  *DataPathNode
	DestEndPoint *DataPathNode

	TEID uint32
	PDR  *PDR
}

GTPTunnel represents the GTP tunnel information

type IPAllocator

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

func NewIPAllocator

func NewIPAllocator(cidr string) (*IPAllocator, error)

func (*IPAllocator) Allocate

func (a *IPAllocator) Allocate() (net.IP, error)

Allocate will allocate the IP address and returns it

func (*IPAllocator) Release

func (a *IPAllocator) Release(ip net.IP)

type PCCRule

type PCCRule struct {
	// shall include attribute
	PCCRuleID  string
	Precedence int32

	// maybe include attribute
	AppID     string
	FlowInfos []models.FlowInformation

	// related Data
	Datapath *DataPath
	// contains filtered or unexported fields
}

PCCRule - Policy and Charging Rule

func NewPCCRuleFromModel

func NewPCCRuleFromModel(pccModel *models.PccRule) *PCCRule

NewPCCRuleFromModel - create PCC rule from OpenAPI models

func (*PCCRule) RefTrafficControlData

func (r *PCCRule) RefTrafficControlData() string

RefTrafficControlData - returns reference traffic control data ID

func (*PCCRule) SetRefTrafficControlData

func (r *PCCRule) SetRefTrafficControlData(tcID string)

SetRefTrafficControlData - setting reference traffic control data

type PDI

type PDI struct {
	SourceInterface pfcpType.SourceInterface
	LocalFTeid      *pfcpType.FTEID
	NetworkInstance util_3gpp.Dnn
	UEIPAddress     *pfcpType.UEIPAddress
	SDFFilter       *pfcpType.SDFFilter
	ApplicationID   string
}

Packet Detection. 7.5.2.2-2

type PDR

type PDR struct {
	PDRID uint16

	Precedence         uint32
	PDI                PDI
	OuterHeaderRemoval *pfcpType.OuterHeaderRemoval

	FAR *FAR
	URR *URR
	QER []*QER

	State RuleState
}

Packet Detection Rule. Table 7.5.2.2-1

type PFCPSessionContext

type PFCPSessionContext struct {
	PDRs       map[uint16]*PDR
	NodeID     pfcpType.NodeID
	LocalSEID  uint64
	RemoteSEID uint64
}

func (*PFCPSessionContext) String

func (pfcpSessionContext *PFCPSessionContext) String() string

type PFCPSessionResponseStatus

type PFCPSessionResponseStatus int
const (
	SessionUpdateSuccess PFCPSessionResponseStatus = iota
	SessionUpdateFailed
	SessionReleaseSuccess
	SessionReleaseFailed
)

func (PFCPSessionResponseStatus) String

func (pfcpSessionResponseStatus PFCPSessionResponseStatus) String() string

type PacketFilter

type PacketFilter struct {
	Direction     uint8
	Identifier    uint8
	ComponentType uint8
	Component     []byte
}

func (*PacketFilter) MarshalBinary

func (pf *PacketFilter) MarshalBinary() (data []byte, err error)

type PendingUPF

type PendingUPF map[string]bool

func (PendingUPF) IsEmpty

func (pendingUPF PendingUPF) IsEmpty() bool

type ProtocolConfigurationOptions

type ProtocolConfigurationOptions struct {
	DNSIPv4Request     bool
	DNSIPv6Request     bool
	IPv4LinkMTURequest bool
}

type QER

type QER struct {
	QERID uint32

	QFI pfcpType.QFI

	GateStatus *pfcpType.GateStatus
	MBR        *pfcpType.MBR
	GBR        *pfcpType.GBR

	State RuleState
}

QoS Enhancement Rule

type QoSRule

type QoSRule struct {
	Identifier       uint8
	OperationCode    uint8
	DQR              uint8
	Segregation      uint8
	PacketFilterList []PacketFilter
	Precedence       uint8
	QFI              uint8
}

func (*QoSRule) MarshalBinary

func (r *QoSRule) MarshalBinary() ([]byte, error)

type QoSRules

type QoSRules []QoSRule

func (QoSRules) MarshalBinary

func (rs QoSRules) MarshalBinary() (data []byte, err error)

type RuleState

type RuleState uint8
const (
	RULE_INITIAL RuleState = 0
	RULE_CREATE  RuleState = 1
	RULE_UPDATE  RuleState = 2
	RULE_REMOVE  RuleState = 3
)

type SMContext

type SMContext struct {
	Ref string

	LocalSEID  uint64
	RemoteSEID uint64

	UnauthenticatedSupi bool
	// SUPI or PEI
	Supi           string
	Pei            string
	Identifier     string
	Gpsi           string
	PDUSessionID   int32
	Dnn            string
	Snssai         *models.Snssai
	HplmnSnssai    *models.Snssai
	ServingNetwork *models.PlmnId
	ServingNfId    string

	UpCnxState models.UpCnxState

	AnType          models.AccessType
	RatType         models.RatType
	PresenceInLadn  models.PresenceState
	UeLocation      *models.UserLocation
	UeTimeZone      string
	AddUeLocation   *models.UserLocation
	OldPduSessionId int32
	HoState         models.HoState

	PDUAddress             net.IP
	SelectedPDUSessionType uint8

	DnnConfiguration models.DnnConfiguration

	// Client
	SMPolicyClient      *Npcf_SMPolicyControl.APIClient
	CommunicationClient *Namf_Communication.APIClient

	AMFProfile         models.NfProfile
	SelectedPCFProfile models.NfProfile
	SmStatusNotifyUri  string

	SMContextState SMContextState

	Tunnel    *UPTunnel
	BPManager *BPManager
	// NodeID(string form) to PFCP Session Context
	PFCPContext                         map[string]*PFCPSessionContext
	SBIPFCPCommunicationChan            chan PFCPSessionResponseStatus
	PendingUPF                          PendingUPF
	PDUSessionRelease_DUE_TO_DUP_PDU_ID bool

	DNNInfo *SnssaiSmfDnnInfo

	// SM Policy related
	PCCRules           map[string]*PCCRule
	SessionRules       map[string]*SessionRule
	TrafficControlPool map[string]*TrafficControlData

	// NAS
	Pti uint8

	// PCO Related
	ProtocolConfigurationOptions *ProtocolConfigurationOptions

	// lock
	SMLock sync.Mutex
}

func GetSMContext

func GetSMContext(ref string) (smContext *SMContext)

*** add unit test ***//

func GetSMContextBySEID

func GetSMContextBySEID(SEID uint64) (smContext *SMContext)

*** add unit test ***//

func NewSMContext

func NewSMContext(identifier string, pduSessID int32) (smContext *SMContext)

func (*SMContext) AllocateLocalSEIDForDataPath

func (smContext *SMContext) AllocateLocalSEIDForDataPath(dataPath *DataPath)

func (*SMContext) AllocateLocalSEIDForUPPath

func (smContext *SMContext) AllocateLocalSEIDForUPPath(path UPPath)

func (*SMContext) BuildCreatedData

func (smContext *SMContext) BuildCreatedData() (createdData *models.SmContextCreatedData)

func (*SMContext) GetNodeIDByLocalSEID

func (smContext *SMContext) GetNodeIDByLocalSEID(seid uint64) (nodeID pfcpType.NodeID)

func (*SMContext) HandlePDUSessionEstablishmentRequest

func (smContext *SMContext) HandlePDUSessionEstablishmentRequest(req *nasMessage.PDUSessionEstablishmentRequest)

func (*SMContext) HandlePDUSessionReleaseRequest

func (smContext *SMContext) HandlePDUSessionReleaseRequest(req *nasMessage.PDUSessionReleaseRequest)

func (*SMContext) PCFSelection

func (smContext *SMContext) PCFSelection() error

PCFSelection will select PCF for this SM Context

func (*SMContext) PDUAddressToNAS

func (smContext *SMContext) PDUAddressToNAS() (addr [12]byte, addrLen uint8)

func (*SMContext) PutPDRtoPFCPSession

func (smContext *SMContext) PutPDRtoPFCPSession(nodeID pfcpType.NodeID, pdr *PDR) error

func (*SMContext) RemovePDRfromPFCPSession

func (smContext *SMContext) RemovePDRfromPFCPSession(nodeID pfcpType.NodeID, pdr *PDR)

func (*SMContext) SelectedSessionRule

func (smContext *SMContext) SelectedSessionRule() *SessionRule

SelectedSessionRule - return the SMF selected session rule for this SM Context

func (*SMContext) SetCreateData

func (smContext *SMContext) SetCreateData(createData *models.SmContextCreateData)

*** add unit test ***//

type SMContextState

type SMContextState int
const (
	InActive SMContextState = iota
	ActivePending
	Active
	InActivePending
	ModificationPending
	PFCPModification
)

func (SMContextState) String

func (smContextState SMContextState) String() string

type SMFContext

type SMFContext struct {
	Name         string
	NfInstanceID string

	URIScheme    models.UriScheme
	BindingIPv4  string
	RegisterIPv4 string
	SBIPort      int
	CPNodeID     pfcpType.NodeID

	UDMProfile models.NfProfile

	UPNodeIDs []pfcpType.NodeID
	Key       string
	PEM       string
	KeyLog    string

	SnssaiInfos []SnssaiSmfInfo

	NrfUri                         string
	NFManagementClient             *Nnrf_NFManagement.APIClient
	NFDiscoveryClient              *Nnrf_NFDiscovery.APIClient
	SubscriberDataManagementClient *Nudm_SubscriberDataManagement.APIClient

	UserPlaneInformation *UserPlaneInformation
	OnlySupportIPv4      bool
	OnlySupportIPv6      bool
	//*** For ULCL ** //
	ULCLSupport         bool
	UEPreConfigPathPool map[string]*UEPreConfigPaths
	LocalSEIDCount      uint64
}

func SMF_Self

func SMF_Self() *SMFContext

type SNssai

type SNssai struct {
	Sst int32
	Sd  string
}

func (*SNssai) Equal

func (s *SNssai) Equal(target *SNssai) bool

Equal return true if two S-NSSAI is equal

type SessionRule

type SessionRule struct {
	// shall include
	SessionRuleID string

	// maybe include
	AuthSessAmbr *models.Ambr
	AuthDefQos   *models.AuthorizedDefaultQos
	// contains filtered or unexported fields
}

SessionRule - A session rule consists of policy information elements associated with PDU session.

func NewSessionRuleFromModel

func NewSessionRuleFromModel(model *models.SessionRule) *SessionRule

NewSessionRuleFromModel - create session rule from OpenAPI models

type SnssaiSmfDnnInfo

type SnssaiSmfDnnInfo struct {
	DNS           DNS
	UeIPAllocator *IPAllocator
}

SnssaiSmfDnnInfo records the SMF per S-NSSAI DNN information

func RetrieveDnnInformation

func RetrieveDnnInformation(Snssai models.Snssai, dnn string) *SnssaiSmfDnnInfo

RetrieveDnnInformation gets the corresponding dnn info from S-NSSAI and DNN

type SnssaiSmfInfo

type SnssaiSmfInfo struct {
	Snssai   SNssai
	DnnInfos map[string]*SnssaiSmfDnnInfo
}

SnssaiSmfInfo records the SMF S-NSSAI related information

type SnssaiUPFInfo

type SnssaiUPFInfo struct {
	SNssai  SNssai
	DnnList []DnnUPFInfoItem
}

type TrafficControlData

type TrafficControlData struct {
	// shall include attribute
	TrafficControlID string

	// maybe include attribute
	FlowStatus     models.FlowStatus
	RouteToLocs    []models.RouteToLocation
	UpPathChgEvent *models.UpPathChgEvent
	// contains filtered or unexported fields
}

TrafficControlData - Traffic control data defines how traffic data flows associated with a rule are treated (e.g. blocked, redirected).

func NewTrafficControlDataFromModel

func NewTrafficControlDataFromModel(model *models.TrafficControlData) *TrafficControlData

NewTrafficControlDataFromModel - create the traffic control data from OpenAPI model

func (*TrafficControlData) AddRefedPCCRules

func (tc *TrafficControlData) AddRefedPCCRules(PCCref string)

func (*TrafficControlData) DeleteRefedPCCRules

func (tc *TrafficControlData) DeleteRefedPCCRules(PCCref string)

func (*TrafficControlData) RefedPCCRules

func (tc *TrafficControlData) RefedPCCRules() map[string]string

RefedPCCRules - returns the PCCRules that reference this tcData

type UEPreConfigPaths

type UEPreConfigPaths struct {
	DataPathPool    DataPathPool
	PathIDGenerator *idgenerator.IDGenerator
}

func GetUEPreConfigPaths

func GetUEPreConfigPaths(SUPI string) *UEPreConfigPaths

func NewUEPreConfigPaths

func NewUEPreConfigPaths(SUPI string, paths []factory.Path) (*UEPreConfigPaths, error)

type UPF

type UPF struct {
	NodeID       pfcpType.NodeID
	UPIPInfo     pfcpType.UserPlaneIPResourceInformation
	UPFStatus    UPFStatus
	SNssaiInfos  []SnssaiUPFInfo
	N3Interfaces []UPFInterfaceInfo
	N9Interfaces []UPFInterfaceInfo
	// contains filtered or unexported fields
}

func NewUPF

func NewUPF(nodeID *pfcpType.NodeID, ifaces []factory.InterfaceUpfInfoItem) (upf *UPF)

*** add unit test ***// NewUPF returns a new UPF context in SMF

func RetrieveUPFNodeByNodeID

func RetrieveUPFNodeByNodeID(nodeID pfcpType.NodeID) *UPF

*** add unit test ***//

func SelectUPFByDnn

func SelectUPFByDnn(Dnn string) *UPF

func (*UPF) AddBAR

func (upf *UPF) AddBAR() (*BAR, error)

func (*UPF) AddFAR

func (upf *UPF) AddFAR() (*FAR, error)

func (*UPF) AddPDR

func (upf *UPF) AddPDR() (*PDR, error)

func (*UPF) AddQER

func (upf *UPF) AddQER() (*QER, error)

func (*UPF) GenerateTEID

func (upf *UPF) GenerateTEID() (uint32, error)

func (*UPF) GetInterface

func (upf *UPF) GetInterface(interfaceType models.UpInterfaceType, dnn string) *UPFInterfaceInfo

*** add unit test ***// GetInterface return the UPFInterfaceInfo that match input cond

func (*UPF) GetUPFID

func (upf *UPF) GetUPFID() string

func (*UPF) GetUPFIP

func (upf *UPF) GetUPFIP() string

func (*UPF) PFCPAddr

func (upf *UPF) PFCPAddr() *net.UDPAddr

func (*UPF) RemoveBAR

func (upf *UPF) RemoveBAR(bar *BAR) (err error)

*** add unit test ***//

func (*UPF) RemoveFAR

func (upf *UPF) RemoveFAR(far *FAR) (err error)

*** add unit test ***//

func (*UPF) RemovePDR

func (upf *UPF) RemovePDR(pdr *PDR) (err error)

*** add unit test ***//

func (*UPF) RemoveQER

func (upf *UPF) RemoveQER(qer *QER) (err error)

*** add unit test ***//

func (*UPF) UUID

func (upf *UPF) UUID() string

UUID return this UPF UUID (allocate by SMF in this time) Maybe allocate by UPF in future

type UPFInterfaceInfo

type UPFInterfaceInfo struct {
	NetworkInstance       string
	IPv4EndPointAddresses []net.IP
	IPv6EndPointAddresses []net.IP
	EndpointFQDN          string
}

UPFInterfaceInfo store the UPF interface information

func NewUPFInterfaceInfo

func NewUPFInterfaceInfo(i *factory.InterfaceUpfInfoItem) *UPFInterfaceInfo

NewUPFInterfaceInfo parse the InterfaceUpfInfoItem to generate UPFInterfaceInfo

func (*UPFInterfaceInfo) IP

func (i *UPFInterfaceInfo) IP(pduSessType uint8) (net.IP, error)

*** add unit test ***// IP returns the IP of the user plane IP information of the pduSessType

type UPFSelectionParams

type UPFSelectionParams struct {
	Dnn    string
	SNssai *SNssai
	Dnai   string
}

UPFSelectionParams ... parameters for upf selection

func (*UPFSelectionParams) String

func (upfSelectionParams *UPFSelectionParams) String() string

type UPFStatus

type UPFStatus int
const (
	NotAssociated          UPFStatus = 0
	AssociatedSettingUp    UPFStatus = 1
	AssociatedSetUpSuccess UPFStatus = 2
)

type UPNode

type UPNode struct {
	Type   UPNodeType
	NodeID pfcpType.NodeID
	ANIP   net.IP
	Dnn    string
	Links  []*UPNode
	UPF    *UPF
}

UPNode represent the user plane node topology

type UPNodeType

type UPNodeType string
const (
	UPNODE_UPF UPNodeType = "UPF"
	UPNODE_AN  UPNodeType = "AN"
)

type UPPath

type UPPath []*UPNode

UPPath represent User Plane Sequence of this path

type UPTunnel

type UPTunnel struct {
	PathIDGenerator *idgenerator.IDGenerator
	DataPathPool    DataPathPool
	ANInformation   struct {
		IPAddress net.IP
		TEID      uint32
	}
}

func NewUPTunnel

func NewUPTunnel() (tunnel *UPTunnel)

func (*UPTunnel) AddDataPath

func (upTunnel *UPTunnel) AddDataPath(dataPath *DataPath)

*** add unit test ***//

type URR

type URR struct {
}

Usage Report Rule

type UserPlaneInformation

type UserPlaneInformation struct {
	UPNodes              map[string]*UPNode
	UPFs                 map[string]*UPNode
	AccessNetwork        map[string]*UPNode
	UPFIPToName          map[string]string
	UPFsID               map[string]string    // name to id
	UPFsIPtoID           map[string]string    // ip->id table, for speed optimization
	DefaultUserPlanePath map[string][]*UPNode // DNN to Default Path
}

UserPlaneInformation store userplane topology

func GetUserPlaneInformation

func GetUserPlaneInformation() *UserPlaneInformation

func NewUserPlaneInformation

func NewUserPlaneInformation(upTopology *factory.UserPlaneInformation) *UserPlaneInformation

NewUserPlaneInformation process the configuration then returns a new instance of UserPlaneInformation

func (*UserPlaneInformation) ExistDefaultPath

func (upi *UserPlaneInformation) ExistDefaultPath(dnn string) bool

func (*UserPlaneInformation) GenerateDefaultPath

func (upi *UserPlaneInformation) GenerateDefaultPath(selection *UPFSelectionParams) bool

func (*UserPlaneInformation) GetDefaultUserPlanePathByDNN

func (upi *UserPlaneInformation) GetDefaultUserPlanePathByDNN(selection *UPFSelectionParams) (path UPPath)

func (*UserPlaneInformation) GetUPFIDByIP

func (upi *UserPlaneInformation) GetUPFIDByIP(ip string) string

func (*UserPlaneInformation) GetUPFNameByIp

func (upi *UserPlaneInformation) GetUPFNameByIp(ip string) string

func (*UserPlaneInformation) GetUPFNodeByIP

func (upi *UserPlaneInformation) GetUPFNodeByIP(ip string) *UPNode

func (*UserPlaneInformation) GetUPFNodeIDByName

func (upi *UserPlaneInformation) GetUPFNodeIDByName(name string) pfcpType.NodeID

Jump to

Keyboard shortcuts

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