Documentation ¶
Overview ¶
ProtocolConfigurationOptions
Index ¶
- Constants
- Variables
- func AllocateLocalSEID() uint64
- func AllocateUPFID()
- func BuildGSMPDUSessionEstablishmentAccept(smContext *SMContext) ([]byte, error)
- func BuildGSMPDUSessionEstablishmentReject(smContext *SMContext, cause uint8) ([]byte, error)
- func BuildGSMPDUSessionModificationCommand(smContext *SMContext) ([]byte, error)
- func BuildGSMPDUSessionModificationReject(smContext *SMContext) ([]byte, error)
- func BuildGSMPDUSessionReleaseCommand(smContext *SMContext, cause uint8, isTriggeredByUE bool) ([]byte, error)
- func BuildGSMPDUSessionReleaseReject(smContext *SMContext) ([]byte, error)
- func BuildHandoverCommandTransfer(ctx *SMContext) ([]byte, error)
- func BuildNASPacketFiltersFromFlowInformation(pfInfo *models.FlowInformation, smCtx *SMContext) ([]nasType.PacketFilter, error)
- func BuildPDUSessionResourceModifyRequestTransfer(ctx *SMContext) ([]byte, error)
- func BuildPDUSessionResourceReleaseCommandTransfer(ctx *SMContext) (buf []byte, err error)
- func BuildPDUSessionResourceSetupRequestTransfer(ctx *SMContext) ([]byte, error)
- func BuildPathSwitchRequestAcknowledgeTransfer(ctx *SMContext) ([]byte, error)
- func BuildPathSwitchRequestUnsuccessfulTransfer(causePresent int, causeValue aper.Enumerated) (buf []byte, err error)
- func CheckUEHasPreConfig(supi string) (exist bool)
- func GenerateChargingID() int32
- func GenerateTEID() (uint32, error)
- func GetSMContextCount() uint64
- func GetULCLGroupNameFromSUPI(supi string) string
- func GetUpfIdFromUrrIdKey(urrIdKey string) string
- func HandleHandoverRequestAcknowledgeTransfer(b []byte, ctx *SMContext) error
- func HandleHandoverRequiredTransfer(b []byte, ctx *SMContext) error
- func HandlePDUSessionResourceModifyResponseTransfer(b []byte, ctx *SMContext) error
- func HandlePDUSessionResourceSetupResponseTransfer(b []byte, ctx *SMContext) error
- func HandlePDUSessionResourceSetupUnsuccessfulTransfer(b []byte, ctx *SMContext) error
- func HandlePathSwitchRequestSetupFailedTransfer(b []byte, ctx *SMContext) error
- func HandlePathSwitchRequestTransfer(b []byte, ctx *SMContext) error
- func Init()
- func InitSMFUERouting(routingConfig *factory.RoutingConfig)
- func InitSmfContext(config *factory.Config)
- func MeasureInformation(isMeasurePkt, isMeasureBeforeQos bool) pfcpType.MeasurementInformation
- func ReleaseTEID(teid uint32)
- func RemoveSMContext(ref string)
- func RemoveUPFNodeByNodeID(nodeID pfcpType.NodeID) bool
- func ResolveIP(host string) net.IP
- func ResolveRef(id string, pduSessID int32) (string, error)
- func SNssaiSmfInfo() *[]models.SnssaiSmfInfoItem
- func SetupSMFContext(config *factory.Config) error
- type AddingPSAState
- type BAR
- type BPManager
- type BPStatus
- type ChargingInfo
- type ChargingLevel
- type DLForwardingType
- type DNS
- type DataPath
- func (dataPath *DataPath) ActivateTunnelAndPDR(smContext *SMContext, precedence uint32)
- func (p *DataPath) AddChargingRules(smContext *SMContext, chgLevel ChargingLevel, chgData *models.ChargingData)
- func (p *DataPath) AddForwardingParameters(fwdPolicyID string, teid uint32)
- func (p *DataPath) AddQoS(smContext *SMContext, qfi uint8, qos *models.QosData)
- func (dataPath *DataPath) CopyFirstDPNode() *DataPathNode
- func (dataPath *DataPath) DeactivateTunnelAndPDR(smContext *SMContext)
- func (p *DataPath) GetChargingUrr(smContext *SMContext) []*URR
- func (p *DataPath) RemovePDR()
- func (dataPath *DataPath) String() string
- func (p *DataPath) UpdateFlowDescription(ulFlowDesc, dlFlowDesc string)
- type DataPathNode
- func (node *DataPathNode) ActivateDownLinkTunnel(smContext *SMContext) error
- func (node *DataPathNode) ActivateUpLinkTunnel(smContext *SMContext) error
- func (node *DataPathNode) AddNext(next *DataPathNode)
- func (node *DataPathNode) AddPrev(prev *DataPathNode)
- func (node *DataPathNode) DeactivateDownLinkTunnel(smContext *SMContext)
- func (node *DataPathNode) DeactivateUpLinkTunnel(smContext *SMContext)
- func (node *DataPathNode) GetNodeIP() (ip string)
- func (node *DataPathNode) GetUPFID() (id string, err error)
- func (node *DataPathNode) GetUpLinkFAR() (far *FAR)
- func (node *DataPathNode) GetUpLinkPDR() (pdr *PDR)
- func (node *DataPathNode) IsANUPF() bool
- func (node *DataPathNode) IsAnchorUPF() bool
- func (node *DataPathNode) Next() *DataPathNode
- func (node *DataPathNode) Prev() *DataPathNode
- type DataPathPool
- type DefaultPathPool
- type Destination
- type DnnUPFInfoItem
- type EventExposureNotification
- type FAR
- type FSEID
- type ForwardingParameters
- type GTPTunnel
- type NFContext
- type NFProfile
- type NotifCallback
- type PCCRule
- func (r *PCCRule) AddDataPathForwardingParameters(c *SMContext, tgtRoute *models.RouteToLocation)
- func (r *PCCRule) BuildNasQoSRule(smCtx *SMContext, opCode nasType.QoSRuleOperationCode) (*nasType.QoSRule, error)
- func (r *PCCRule) FlowDescription() string
- func (r *PCCRule) IdentifyChargingLevel() (ChargingLevel, error)
- func (r *PCCRule) RefChgDataID() string
- func (r *PCCRule) RefQosDataID() string
- func (r *PCCRule) RefTcDataID() string
- func (r *PCCRule) SetQFI(qfi uint8)
- func (r *PCCRule) UpdateDataPathFlowDescription(dlFlowDesc string) error
- type PCSCF
- type PDI
- type PDR
- type PFCPSessionContext
- type PFCPSessionResponseStatus
- type ProtocolConfigurationOptions
- type QER
- type QoSFlow
- func (q *QoSFlow) BuildNasQoSDesc(opCode nasType.QoSFlowOperationCode) (nasType.QoSFlowDesc, error)
- func (q *QoSFlow) BuildNgapQosFlowAddOrModifyRequestItem() (ngapType.QosFlowAddOrModifyRequestItem, error)
- func (q *QoSFlow) BuildNgapQosFlowSetupRequestItem() (ngapType.QosFlowSetupRequestItem, error)
- func (q *QoSFlow) Get5QI() uint8
- func (q *QoSFlow) GetQFI() uint8
- func (q *QoSFlow) GetQoSProfile() *models.QosData
- func (q *QoSFlow) IsGBRFlow() bool
- type QoSFlowState
- type RequestType
- type RuleState
- type SMContext
- func (c *SMContext) AddQosFlow(qfi uint8, qos *models.QosData)
- func (c *SMContext) AllocUeIP() error
- func (smContext *SMContext) AllocateLocalSEIDForDataPath(dataPath *DataPath)
- func (smContext *SMContext) AllocateLocalSEIDForUPPath(path UPPath)
- func (c *SMContext) ApplyPccRules(decision *models.SmPolicyDecision) error
- func (c *SMContext) ApplySessionRules(decision *models.SmPolicyDecision) error
- func (smContext *SMContext) AssignQFI(qosId string) uint8
- func (smContext *SMContext) BuildCreatedData() *models.SmContextCreatedData
- func (c *SMContext) BuildUpPathChgEventExposureNotification(chgEvent *models.UpPathChgEvent, srcRoute, tgtRoute *models.RouteToLocation)
- func (smContext *SMContext) CheckState(state SMContextState) bool
- func (c *SMContext) CreatePccRuleDataPath(pccRule *PCCRule, tcData *TrafficControlData, qosData *models.QosData, ...) error
- func (smContext *SMContext) GenerateUrrId()
- func (smContext *SMContext) GetNodeIDByLocalSEID(seid uint64) pfcpType.NodeID
- func (smContext *SMContext) HandleReports(usageReportRequest []*pfcp.UsageReportPFCPSessionReportRequest, ...)
- func (smContext *SMContext) IsAllowedPDUSessionType(requestedPDUSessionType uint8) error
- func (smContext *SMContext) PDUAddressToNAS() ([12]byte, uint8)
- func (c *SMContext) PostRemoveDataPath()
- func (c *SMContext) PreRemoveDataPath(dp *DataPath)
- func (smContext *SMContext) PutPDRtoPFCPSession(nodeID pfcpType.NodeID, pdr *PDR) error
- func (smContext *SMContext) RemovePDRfromPFCPSession(nodeID pfcpType.NodeID, pdr *PDR)
- func (smContext *SMContext) RemoveQFI(qosId string)
- func (c *SMContext) RemoveQosFlow(qfi uint8)
- func (c *SMContext) SelectDefaultDataPath() error
- func (c *SMContext) SelectedSessionRule() *SessionRule
- func (c *SMContext) SendUpPathChgNotification(chgType string, notifCb NotifCallback)
- func (smContext *SMContext) SetState(state SMContextState)
- func (smContext *SMContext) State() SMContextState
- func (smContext *SMContext) StopT3591()
- func (smContext *SMContext) StopT3592()
- type SMContextState
- type SMFContext
- func (c *SMFContext) AuthorizationCheck(token string, serviceName models.ServiceName) error
- func (s *SMFContext) ExternalIP() net.IP
- func (c *SMFContext) GetTokenCtx(serviceName models.ServiceName, targetNF models.NfType) (context.Context, *models.ProblemDetails, error)
- func (s *SMFContext) ListenIP() net.IP
- func (c *SMFContext) SetupNFProfile(nfProfileconfig *factory.Config)
- type SNssai
- type SessionRule
- type SnssaiSmfDnnInfo
- type SnssaiSmfInfo
- type SnssaiUPFInfo
- type Timer
- type TrafficControlData
- type UEDefaultPaths
- type UEPreConfigPaths
- type UPF
- func (upf *UPF) AddBAR() (*BAR, error)
- func (upf *UPF) AddFAR() (*FAR, error)
- func (upf *UPF) AddPDR() (*PDR, error)
- func (upf *UPF) AddQER() (*QER, error)
- func (upf *UPF) AddURR(urrId uint32, opts ...UrrOpt) (*URR, error)
- func (upf *UPF) GetInterface(interfaceType models.UpInterfaceType, dnn string) *UPFInterfaceInfo
- func (upf *UPF) GetQERById(qerId uint32) *QER
- func (upf *UPF) GetUPFID() string
- func (upf *UPF) GetUPFIP() string
- func (upf *UPF) GetUUID() uuid.UUID
- func (upf *UPF) PFCPAddr() *net.UDPAddr
- func (upf *UPF) ProcEachSMContext(procFunc func(*SMContext))
- func (upf *UPF) RemoveBAR(bar *BAR) (err error)
- func (upf *UPF) RemoveFAR(far *FAR) (err error)
- func (upf *UPF) RemovePDR(pdr *PDR) (err error)
- func (upf *UPF) RemoveQER(qer *QER) (err error)
- func (upf *UPF) UUID() string
- type UPFInterfaceInfo
- type UPFSelectionParams
- type UPFStatus
- type UPNode
- type UPNodeType
- type UPPath
- type UPTunnel
- type URR
- type UeIPPool
- type UrrOpt
- type UrrType
- type UsageReport
- type UserPlaneInformation
- func (upi *UserPlaneInformation) ExistDefaultPath(dnn string) bool
- func (upi *UserPlaneInformation) GenerateDefaultPath(selection *UPFSelectionParams) bool
- func (upi *UserPlaneInformation) GenerateDefaultPathToUPF(selection *UPFSelectionParams, destination *UPNode) bool
- func (upi *UserPlaneInformation) GetDefaultUserPlanePathByDNN(selection *UPFSelectionParams) (path UPPath)
- func (upi *UserPlaneInformation) GetDefaultUserPlanePathByDNNAndUPF(selection *UPFSelectionParams, upf *UPNode) (path UPPath)
- func (upi *UserPlaneInformation) GetUPFIDByIP(ip string) string
- func (upi *UserPlaneInformation) GetUPFNameByIp(ip string) string
- func (upi *UserPlaneInformation) GetUPFNodeByIP(ip string) *UPNode
- func (upi *UserPlaneInformation) GetUPFNodeIDByName(name string) pfcpType.NodeID
- func (upi *UserPlaneInformation) LinksFromConfiguration(upTopology *factory.UserPlaneInformation)
- func (upi *UserPlaneInformation) LinksToConfiguration() []*factory.UPLink
- func (upi *UserPlaneInformation) ReleaseUEIP(upf *UPNode, addr net.IP, static bool)
- func (upi *UserPlaneInformation) SelectUPFAndAllocUEIP(selection *UPFSelectionParams) (*UPNode, net.IP, bool)
- func (upi *UserPlaneInformation) UpNodeDelete(upNodeName string)
- func (upi *UserPlaneInformation) UpNodesFromConfiguration(upTopology *factory.UserPlaneInformation)
- func (upi *UserPlaneInformation) UpNodesToConfiguration() map[string]*factory.UPNode
Constants ¶
const ( MeasureInfoMNOP = 0x10 // Measure Num of Pkts (MNOP) MeasureInfoMBQE = 0x1 // Measure Before Qos Enforce(MQBE) MesureMethodVol = "vol" MesureMethodTime = "time" MeasurePeriodReport = 0x0100 // 0x10: PERIO )
const DefaultNonGBR5QI = 9
const DefaultPrecedence uint32 = 255
Variables ¶
var TeidGenerator *idgenerator.IDGenerator
Functions ¶
func AllocateLocalSEID ¶
func AllocateLocalSEID() uint64
func AllocateUPFID ¶
func AllocateUPFID()
func BuildGSMPDUSessionReleaseCommand ¶
func BuildGSMPDUSessionReleaseCommand(smContext *SMContext, cause uint8, isTriggeredByUE bool) ([]byte, error)
BuildGSMPDUSessionReleaseCommand makes a plain NAS message.
If isTriggeredByUE is true, the PTI field of the constructed NAS message is the value of smContext.Pti which is received from UE, otherwise it is 0. ref. 6.3.3.2 Network-requested PDU session release procedure initiation in TS24.501.
func BuildNASPacketFiltersFromFlowInformation ¶
func BuildNASPacketFiltersFromFlowInformation(pfInfo *models.FlowInformation, smCtx *SMContext, ) ([]nasType.PacketFilter, error)
func BuildPathSwitchRequestAcknowledgeTransfer ¶
TS 38.413 9.3.4.9
func BuildPathSwitchRequestUnsuccessfulTransfer ¶
func BuildPathSwitchRequestUnsuccessfulTransfer(causePresent int, causeValue aper.Enumerated) (buf []byte, err error)
func CheckUEHasPreConfig ¶
func GenerateChargingID ¶
func GenerateChargingID() int32
func GenerateTEID ¶
func GetSMContextCount ¶
func GetSMContextCount() uint64
func GetUpfIdFromUrrIdKey ¶
func InitSMFUERouting ¶
func InitSMFUERouting(routingConfig *factory.RoutingConfig)
func InitSmfContext ¶
func MeasureInformation ¶
func MeasureInformation(isMeasurePkt, isMeasureBeforeQos bool) pfcpType.MeasurementInformation
func ReleaseTEID ¶
func ReleaseTEID(teid uint32)
func RemoveUPFNodeByNodeID ¶
*** add unit test ***//
func SNssaiSmfInfo ¶
func SNssaiSmfInfo() *[]models.SnssaiSmfInfoItem
func SetupSMFContext ¶
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 ActivatedPaths []*DataPath ActivatingPath *DataPath UpdatedBranchingPoint map[*UPF]int ULCL *UPF }
func NewBPManager ¶
func (*BPManager) SelectPSA2 ¶
type ChargingInfo ¶
type ChargingInfo struct { ChargingMethod models.QuotaManagementIndicator VolumeLimitExpiryTimer *Timer EventLimitExpiryTimer *Timer ChargingLevel ChargingLevel RatingGroup int32 UpfId string }
type ChargingLevel ¶
type ChargingLevel uint8
const ( PduSessionCharging ChargingLevel = iota FlowCharging )
For a rating group that is pdu session charging level, all volume in a pdu session will be charged For a rating group that is flow charging level (or Rating group level (32.255)), only volume in a flow will be charged
type DLForwardingType ¶
type DLForwardingType int
const ( IndirectForwarding DLForwardingType = iota DirectForwarding NoForwarding )
type DataPath ¶
type DataPath struct { PathID int64 // meta data Activated bool IsDefaultPath bool GBRFlow bool Destination Destination HasBranchingPoint bool // Data Path Double Link List FirstDPNode *DataPathNode }
func GenerateDataPath ¶
func NewDataPath ¶
func NewDataPath() *DataPath
func (*DataPath) ActivateTunnelAndPDR ¶
func (*DataPath) AddChargingRules ¶
func (p *DataPath) AddChargingRules(smContext *SMContext, chgLevel ChargingLevel, chgData *models.ChargingData)
func (*DataPath) AddForwardingParameters ¶
func (*DataPath) CopyFirstDPNode ¶
func (dataPath *DataPath) CopyFirstDPNode() *DataPathNode
func (*DataPath) DeactivateTunnelAndPDR ¶
func (*DataPath) GetChargingUrr ¶
func (*DataPath) UpdateFlowDescription ¶
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 ¶
func NewDataPathPool ¶
func NewDataPathPool() DataPathPool
func (DataPathPool) GetDefaultPath ¶
func (dataPathPool DataPathPool) GetDefaultPath() *DataPath
func (DataPathPool) ResetDefaultPath ¶
func (dataPathPool DataPathPool) ResetDefaultPath() error
type DefaultPathPool ¶
type Destination ¶
type DnnUPFInfoItem ¶
type DnnUPFInfoItem struct { Dnn string DnaiList []string PduSessionTypes []models.PduSessionType UeIPPools []*UeIPPool StaticIPPools []*UeIPPool }
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
func (*DnnUPFInfoItem) ContainsIPPool ¶
func (d *DnnUPFInfoItem) ContainsIPPool(ip net.IP) bool
ContainsIPPool returns true if the ip pool of this upf dnn info contains the `ip`
type EventExposureNotification ¶
type EventExposureNotification struct { *models.NsmfEventExposureNotification Uri string }
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 *pfcpType.NetworkInstance OuterHeaderCreation *pfcpType.OuterHeaderCreation ForwardingPolicyID string SendEndMarker bool }
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 NFContext ¶
type NFContext interface {
AuthorizationCheck(token string, serviceName models.ServiceName) error
}
type NotifCallback ¶
type NotifCallback func(uri string, notification *models.NsmfEventExposureNotification)
type PCCRule ¶
PCCRule - Policy and Charging Rule
func NewPCCRule ¶
NewPCCRule - create PCC rule from OpenAPI models
func (*PCCRule) AddDataPathForwardingParameters ¶
func (r *PCCRule) AddDataPathForwardingParameters(c *SMContext, tgtRoute *models.RouteToLocation, )
func (*PCCRule) BuildNasQoSRule ¶
func (*PCCRule) FlowDescription ¶
func (*PCCRule) IdentifyChargingLevel ¶
func (r *PCCRule) IdentifyChargingLevel() (ChargingLevel, error)
func (*PCCRule) RefChgDataID ¶
func (*PCCRule) RefQosDataID ¶
func (*PCCRule) RefTcDataID ¶
func (*PCCRule) UpdateDataPathFlowDescription ¶
type PDI ¶
type PDI struct { SourceInterface pfcpType.SourceInterface LocalFTeid *pfcpType.FTEID NetworkInstance *pfcpType.NetworkInstance 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
func (*PDR) AppendURRs ¶
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 ( SessionEstablishSuccess PFCPSessionResponseStatus = iota SessionEstablishFailed SessionUpdateSuccess SessionUpdateFailed SessionReleaseSuccess SessionReleaseFailed )
func (PFCPSessionResponseStatus) String ¶
func (pfcpSessionResponseStatus PFCPSessionResponseStatus) String() string
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 QoSFlow ¶
type QoSFlow struct { QFI uint8 QoSProfile *models.QosData State QoSFlowState }
func (*QoSFlow) BuildNasQoSDesc ¶
func (q *QoSFlow) BuildNasQoSDesc(opCode nasType.QoSFlowOperationCode) (nasType.QoSFlowDesc, error)
func (*QoSFlow) BuildNgapQosFlowAddOrModifyRequestItem ¶
func (q *QoSFlow) BuildNgapQosFlowAddOrModifyRequestItem() (ngapType.QosFlowAddOrModifyRequestItem, error)
func (*QoSFlow) BuildNgapQosFlowSetupRequestItem ¶
func (q *QoSFlow) BuildNgapQosFlowSetupRequestItem() (ngapType.QosFlowSetupRequestItem, error)
func (*QoSFlow) GetQoSProfile ¶
type QoSFlowState ¶
type QoSFlowState int
const ( QoSFlowUnset QoSFlowState = iota QoSFlowSet QoSFlowToBeModify )
type RequestType ¶
type RequestType uint8
const ( CHARGING_INIT RequestType = iota CHARGING_UPDATE CHARGING_RELEASE )
For each charging event, it will have a corresponding charging request type, see 32.255 Table 5.2.1.4.1
type SMContext ¶
type SMContext struct { *models.SmContextCreateData Ref string LocalSEID uint64 RemoteSEID uint64 UnauthenticatedSupi bool Pei string Identifier string PDUSessionID int32 LocalULTeid uint32 LocalDLTeid uint32 UpCnxState models.UpCnxState HoState models.HoState SelectionParam *UPFSelectionParams PDUAddress net.IP UseStaticIP bool SelectedPDUSessionType uint8 DnnConfiguration models.DnnConfiguration SMPolicyID string // Handover related DLForwardingType DLForwardingType DLDirectForwardingTunnel *ngapType.UPTransportLayerInformation IndirectForwardingTunnel *DataPath // UP Security support TS 29.502 R16 6.1.6.2.39 UpSecurity *models.UpSecurity MaximumDataRatePerUEForUserPlaneIntegrityProtectionForUpLink models.MaxIntegrityProtectedDataRate MaximumDataRatePerUEForUserPlaneIntegrityProtectionForDownLink models.MaxIntegrityProtectedDataRate // SMF verified UP security result of Xn-handover TS 33.501 6.6.1 UpSecurityFromPathSwitchRequestSameAsLocalStored bool // Client CommunicationClientApiPrefix string AMFProfile models.NfProfile SelectedPCFProfile models.NfProfile SelectedCHFProfile models.NfProfile SmStatusNotifyUri string Tunnel *UPTunnel SelectedUPF *UPNode BPManager *BPManager // NodeID(string form) to PFCP Session Context PFCPContext map[string]*PFCPSessionContext PDUSessionRelease_DUE_TO_DUP_PDU_ID bool DNNInfo *SnssaiSmfDnnInfo // SM Policy related PCCRules map[string]*PCCRule SessionRules map[string]*SessionRule TrafficControlDatas map[string]*TrafficControlData ChargingData map[string]*models.ChargingData QosDatas map[string]*models.QosData UpPathChgEarlyNotification map[string]*EventExposureNotification // Key: Uri+NotifId UpPathChgLateNotification map[string]*EventExposureNotification // Key: Uri+NotifId DataPathToBeRemoved map[int64]*DataPath // Key: pathID SelectedSessionRuleID string // QoS QoSRuleIDGenerator *idgenerator.IDGenerator PacketFilterIDGenerator *idgenerator.IDGenerator QFIGenerator *idgenerator.IDGenerator PCCRuleIDToQoSRuleID map[string]uint8 PacketFilterIDToNASPFID map[string]uint8 AMBRQerMap map[uuid.UUID]uint32 QerUpfMap map[string]uint32 AdditonalQosFlows map[uint8]*QoSFlow // Key: qfi // URR UrrIDGenerator *idgenerator.IDGenerator UrrIdMap map[UrrType]uint32 UrrUpfMap map[string]*URR UrrReportTime time.Duration UrrReportThreshold uint64 // Cache the usage reports, sent from UPF // Those information will be included in CDR. UrrReports []UsageReport // Charging Related ChargingDataRef string // Each PDU session has a unique charging id ChargingID int32 RequestedUnit int32 // key = urrid // All urr can map to a rating group // However, a rating group may map to more than one urr // e.g. In UL CL case, the rating group for recoreding PDU Session volume may map to two URR // one is for PSA 1, the other is for PSA 2. ChargingInfo map[uint32]*ChargingInfo // NAS Pti uint8 EstAcceptCause5gSMValue uint8 // PCO Related ProtocolConfigurationOptions *ProtocolConfigurationOptions UeCmRegistered bool // Loggers Log *logrus.Entry // 5GSM Timers // T3591 is PDU SESSION MODIFICATION COMMAND timer T3591 *Timer // T3592 is PDU SESSION RELEASE COMMAND timer T3592 *Timer // lock SMLock sync.Mutex // contains filtered or unexported fields }
func GetSMContextById ¶
func NewSMContext ¶
func (*SMContext) AllocateLocalSEIDForDataPath ¶
func (*SMContext) AllocateLocalSEIDForUPPath ¶
func (*SMContext) ApplyPccRules ¶
func (c *SMContext) ApplyPccRules( decision *models.SmPolicyDecision, ) error
func (*SMContext) ApplySessionRules ¶
func (c *SMContext) ApplySessionRules( decision *models.SmPolicyDecision, ) error
func (*SMContext) BuildCreatedData ¶
func (smContext *SMContext) BuildCreatedData() *models.SmContextCreatedData
func (*SMContext) BuildUpPathChgEventExposureNotification ¶
func (c *SMContext) BuildUpPathChgEventExposureNotification( chgEvent *models.UpPathChgEvent, srcRoute, tgtRoute *models.RouteToLocation, )
func (*SMContext) CheckState ¶
func (smContext *SMContext) CheckState(state SMContextState) bool
func (*SMContext) CreatePccRuleDataPath ¶
func (c *SMContext) CreatePccRuleDataPath(pccRule *PCCRule, tcData *TrafficControlData, qosData *models.QosData, chgData *models.ChargingData, ) error
func (*SMContext) GenerateUrrId ¶
func (smContext *SMContext) GenerateUrrId()
func (*SMContext) GetNodeIDByLocalSEID ¶
func (*SMContext) HandleReports ¶
func (smContext *SMContext) HandleReports( usageReportRequest []*pfcp.UsageReportPFCPSessionReportRequest, usageReportModification []*pfcp.UsageReportPFCPSessionModificationResponse, usageReportDeletion []*pfcp.UsageReportPFCPSessionDeletionResponse, nodeId pfcpType.NodeID, reportTpye models.TriggerType, )
func (*SMContext) IsAllowedPDUSessionType ¶
func (*SMContext) PDUAddressToNAS ¶
func (*SMContext) PostRemoveDataPath ¶
func (c *SMContext) PostRemoveDataPath()
Remove data path after receiving PFCP rsp
func (*SMContext) PreRemoveDataPath ¶
Set data path PDR to REMOVE beofre sending PFCP req
func (*SMContext) PutPDRtoPFCPSession ¶
func (*SMContext) RemovePDRfromPFCPSession ¶
func (*SMContext) RemoveQosFlow ¶
func (*SMContext) SelectDefaultDataPath ¶
This function create a data path to be default data path.
func (*SMContext) SelectedSessionRule ¶
func (c *SMContext) SelectedSessionRule() *SessionRule
SelectedSessionRule - return the SMF selected session rule for this SM Context
func (*SMContext) SendUpPathChgNotification ¶
func (c *SMContext) SendUpPathChgNotification(chgType string, notifCb NotifCallback)
func (*SMContext) SetState ¶
func (smContext *SMContext) SetState(state SMContextState)
func (*SMContext) State ¶
func (smContext *SMContext) State() SMContextState
type SMContextState ¶
type SMContextState uint32
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 // N4 interface-related CPNodeID pfcpType.NodeID ExternalAddr string ListenAddr string UDMProfile models.NfProfile NfProfile NFProfile Key string PEM string KeyLog string SnssaiInfos []*SnssaiSmfInfo NrfUri string NrfCertPem string Locality string AssocFailAlertInterval time.Duration AssocFailRetryInterval time.Duration OAuth2Required bool UserPlaneInformation *UserPlaneInformation Ctx context.Context PFCPCancelFunc context.CancelFunc PfcpHeartbeatInterval time.Duration // Now only "IPv4" supported // TODO: support "IPv6", "IPv4v6", "Ethernet" SupportedPDUSessionType string // *** For ULCL *** // ULCLSupport bool ULCLGroups map[string][]string UEPreConfigPathPool map[string]*UEPreConfigPaths UEDefaultPathPool map[string]*UEDefaultPaths LocalSEIDCount uint64 // Each pdu session should have a unique charging id ChargingIDGenerator *idgenerator.IDGenerator }
func GetSelf ¶
func GetSelf() *SMFContext
func (*SMFContext) AuthorizationCheck ¶
func (c *SMFContext) AuthorizationCheck(token string, serviceName models.ServiceName) error
func (*SMFContext) ExternalIP ¶
func (s *SMFContext) ExternalIP() net.IP
func (*SMFContext) GetTokenCtx ¶
func (c *SMFContext) GetTokenCtx(serviceName models.ServiceName, targetNF models.NfType) ( context.Context, *models.ProblemDetails, error, )
func (*SMFContext) ListenIP ¶
func (s *SMFContext) ListenIP() net.IP
func (*SMFContext) SetupNFProfile ¶
func (c *SMFContext) SetupNFProfile(nfProfileconfig *factory.Config)
type SessionRule ¶
type SessionRule struct { *models.SessionRule DefQosQFI uint8 }
SessionRule - A session rule consists of policy information elements associated with PDU session.
func NewSessionRule ¶
func NewSessionRule(model *models.SessionRule) *SessionRule
NewSessionRule - create session rule from OpenAPI models
type SnssaiSmfDnnInfo ¶
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 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 int, 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 ¶
ExpireTimes return the current expire times of the timer
func (*Timer) MaxRetryTimes ¶
MaxRetryTimes return the max retry times of the timer
type TrafficControlData ¶
type TrafficControlData struct {
*models.TrafficControlData
}
TrafficControlData - Traffic control data defines how traffic data flows associated with a rule are treated (e.g. blocked, redirected).
func NewTrafficControlData ¶
func NewTrafficControlData(model *models.TrafficControlData) *TrafficControlData
NewTrafficControlData - create the traffic control data from OpenAPI model
type UEDefaultPaths ¶
type UEDefaultPaths struct { AnchorUPFs []string // list of UPF name DefaultPathPool DefaultPathPool }
func GetUEDefaultPathPool ¶
func GetUEDefaultPathPool(groupName string) *UEDefaultPaths
func NewUEDefaultPaths ¶
func NewUEDefaultPaths(upi *UserPlaneInformation, topology []factory.UPLink) (*UEDefaultPaths, error)
func (*UEDefaultPaths) GetDefaultPath ¶
func (dfp *UEDefaultPaths) GetDefaultPath(upfName string) *DataPath
func (*UEDefaultPaths) SelectUPFAndAllocUEIPForULCL ¶
func (dfp *UEDefaultPaths) SelectUPFAndAllocUEIPForULCL(upi *UserPlaneInformation, selection *UPFSelectionParams, ) (string, net.IP, bool)
type UEPreConfigPaths ¶
type UEPreConfigPaths struct { DataPathPool DataPathPool PathIDGenerator *idgenerator.IDGenerator }
func GetUEPreConfigPaths ¶
func GetUEPreConfigPaths(supi string, upfName string) *UEPreConfigPaths
func NewUEPreConfigPaths ¶
func NewUEPreConfigPaths(paths []factory.SpecificPath) (*UEPreConfigPaths, error)
type UPF ¶
type UPF struct { NodeID pfcpType.NodeID Addr string UPIPInfo pfcpType.UserPlaneIPResourceInformation UPFStatus UPFStatus RecoveryTimeStamp time.Time Ctx context.Context CancelFunc context.CancelFunc SNssaiInfos []*SnssaiUPFInfo N3Interfaces []*UPFInterfaceInfo N9Interfaces []*UPFInterfaceInfo // contains filtered or unexported fields }
func GetUpfById ¶
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 ¶
*** add unit test ***//
func SelectUPFByDnn ¶
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) GetQERById ¶
func (*UPF) ProcEachSMContext ¶
type UPFInterfaceInfo ¶
type UPFInterfaceInfo struct { NetworkInstances []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
type UPFSelectionParams ¶
UPFSelectionParams ... parameters for upf selection
func (*UPFSelectionParams) String ¶
func (upfSelectionParams *UPFSelectionParams) String() string
type UPNode ¶
type UPNode struct { Name string Type UPNodeType NodeID pfcpType.NodeID ANIP net.IP Dnn string Links []*UPNode UPF *UPF }
UPNode represent the user plane node topology
func (*UPNode) MatchedSelection ¶
func (u *UPNode) MatchedSelection(selection *UPFSelectionParams) bool
type UPNodeType ¶
type UPNodeType string
const ( UPNODE_UPF UPNodeType = "UPF" UPNODE_AN UPNodeType = "AN" )
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 ¶
*** add unit test ***//
func (*UPTunnel) RemoveDataPath ¶
type URR ¶
type URR struct { URRID uint32 MeasureMethod string // vol or time ReportingTrigger pfcpType.ReportingTriggers MeasurementPeriod time.Duration QuotaValidityTime time.Time MeasurementInformation pfcpType.MeasurementInformation VolumeThreshold uint64 VolumeQuota uint64 State RuleState }
Usage Report Rule
type UeIPPool ¶
type UeIPPool struct {
// contains filtered or unexported fields
}
UeIPPool represent IPv4 address pool for UE
func NewUEIPPool ¶
func (*UeIPPool) Pool ¶
func (u *UeIPPool) Pool() *pool.LazyReusePool
type UrrOpt ¶
type UrrOpt func(urr *URR)
func NewMeasureInformation ¶
func NewMeasurementPeriod ¶
func NewVolumeQuota ¶
func NewVolumeThreshold ¶
func SetStartOfSDFTrigger ¶
func SetStartOfSDFTrigger() UrrOpt
type UrrType ¶
type UrrType int
const ( N3N6_MBQE_URR UrrType = iota N3N6_MAQE_URR N3N9_MBQE_URR N3N9_MAQE_URR N9N6_MBQE_URR N9N6_MAQE_URR NOT_FOUND_URR )
Reserved URR report for ID = 0 ~ 6
func (UrrType) IsBeforeQos ¶
type UsageReport ¶
type UserPlaneInformation ¶
type UserPlaneInformation struct { Mu sync.RWMutex // protect UPF and topology structure 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 DefaultUserPlanePathToUPF map[string]map[string][]*UPNode // DNN and UPF 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) GenerateDefaultPathToUPF ¶
func (upi *UserPlaneInformation) GenerateDefaultPathToUPF(selection *UPFSelectionParams, destination *UPNode) bool
func (*UserPlaneInformation) GetDefaultUserPlanePathByDNN ¶
func (upi *UserPlaneInformation) GetDefaultUserPlanePathByDNN(selection *UPFSelectionParams) (path UPPath)
func (*UserPlaneInformation) GetDefaultUserPlanePathByDNNAndUPF ¶
func (upi *UserPlaneInformation) GetDefaultUserPlanePathByDNNAndUPF(selection *UPFSelectionParams, upf *UPNode, ) (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
func (*UserPlaneInformation) LinksFromConfiguration ¶
func (upi *UserPlaneInformation) LinksFromConfiguration(upTopology *factory.UserPlaneInformation)
func (*UserPlaneInformation) LinksToConfiguration ¶
func (upi *UserPlaneInformation) LinksToConfiguration() []*factory.UPLink
func (*UserPlaneInformation) ReleaseUEIP ¶
func (upi *UserPlaneInformation) ReleaseUEIP(upf *UPNode, addr net.IP, static bool)
func (*UserPlaneInformation) SelectUPFAndAllocUEIP ¶
func (upi *UserPlaneInformation) SelectUPFAndAllocUEIP(selection *UPFSelectionParams) (*UPNode, net.IP, bool)
SelectUPFAndAllocUEIP will return anchor UPF, allocated UE IP and use/not use static IP
func (*UserPlaneInformation) UpNodeDelete ¶
func (upi *UserPlaneInformation) UpNodeDelete(upNodeName string)
func (*UserPlaneInformation) UpNodesFromConfiguration ¶
func (upi *UserPlaneInformation) UpNodesFromConfiguration(upTopology *factory.UserPlaneInformation)
func (*UserPlaneInformation) UpNodesToConfiguration ¶
func (upi *UserPlaneInformation) UpNodesToConfiguration() map[string]*factory.UPNode
Source Files ¶
- bp_manager.go
- charging.go
- config.go
- context.go
- datapath.go
- gsm_build.go
- nf_profile.go
- ngap_build.go
- ngap_handler.go
- pcc_rule.go
- pco.go
- pfcp_reports.go
- pfcp_rules.go
- pfcp_session_context.go
- qos_flow.go
- session_rules.go
- sm_context.go
- sm_context_policy.go
- snssai.go
- snssai_dnn_smf_info.go
- timer.go
- traffic_control_data.go
- ue_datapath.go
- ue_defaultPath.go
- ue_ip_pool.go
- ulcl_group.go
- upf.go
- user_plane_information.go