Documentation ¶
Overview ¶
Package upf provides a 5G User Plane Function that converts PFCP sessions to GTP-U faces.
Index ¶
- type Session
- type SessionLocatorFields
- type SessionParser
- func (sp *SessionParser) EstablishmentRequest(req *message.SessionEstablishmentRequest, rspIEs []*ie.IE) ([]*ie.IE, error)
- func (sp SessionParser) LocatorFields() (loc SessionLocatorFields, ok bool)
- func (sp *SessionParser) ModificationRequest(req *message.SessionModificationRequest, rspIEs []*ie.IE) ([]*ie.IE, error)
- type SessionTable
- func (st *SessionTable) DeletionRequest(ctx context.Context, req *message.SessionDeletionRequest) (sess *Session, e error)
- func (st *SessionTable) EstablishmentRequest(ctx context.Context, req *message.SessionEstablishmentRequest, rspIEs []*ie.IE) (sess *Session, rspIEsRet []*ie.IE, e error)
- func (st *SessionTable) ModificationRequest(ctx context.Context, req *message.SessionModificationRequest, rspIEs []*ie.IE) (sess *Session, rspIEsRet []*ie.IE, e error)
- type UPF
- func (upf *UPF) AssociationSetupRequest(ctx context.Context, req *message.AssociationSetupRequest) (rsp *message.AssociationSetupResponse, e error)
- func (upf *UPF) HeartbeatRequest(ctx context.Context, req *message.HeartbeatRequest) (rsp *message.HeartbeatResponse, e error)
- func (upf *UPF) Listen(ctx context.Context) error
- func (upf *UPF) ServePFCP(ctx context.Context, req message.Message) (rsp message.Message, e error)
- func (upf *UPF) SessionDeletionRequest(ctx context.Context, req *message.SessionDeletionRequest) (rsp *message.SessionDeletionResponse, e error)
- func (upf *UPF) SessionEstablishmentRequest(ctx context.Context, req *message.SessionEstablishmentRequest) (rsp *message.SessionEstablishmentResponse, e error)
- func (upf *UPF) SessionModificationRequest(ctx context.Context, req *message.SessionModificationRequest) (rsp *message.SessionModificationResponse, e error)
- type UpfLocatorFields
- type UpfParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
CpSEID, UpSEID uint64
Parser SessionParser
FaceID string
}
Session represents a PFCP session and the associated face.
type SessionLocatorFields ¶
type SessionLocatorFields struct { UlTEID uint32 `json:"ulTEID"` DlTEID uint32 `json:"dlTEID"` UlQFI uint8 `json:"ulQFI"` DlQFI uint8 `json:"dlQFI"` RemoteIP netip.Addr `json:"remoteIP"` InnerRemoteIP netip.Addr `json:"innerRemoteIP"` }
SessionLocatorFields contains GTP-U locator fields extracted from PFCP session.
type SessionParser ¶
type SessionParser struct {
// contains filtered or unexported fields
}
SessionParser parses PFCP messages to construct GTP-U face locator.
func (*SessionParser) EstablishmentRequest ¶
func (sp *SessionParser) EstablishmentRequest(req *message.SessionEstablishmentRequest, rspIEs []*ie.IE) ([]*ie.IE, error)
EstablishmentRequest handles a SessionEstablishmentRequest message.
func (SessionParser) LocatorFields ¶
func (sp SessionParser) LocatorFields() (loc SessionLocatorFields, ok bool)
LocatorFields returns GTP-U locator fields extracted from PFCP session. ok indicates whether the locator is valid.
func (*SessionParser) ModificationRequest ¶
func (sp *SessionParser) ModificationRequest(req *message.SessionModificationRequest, rspIEs []*ie.IE) ([]*ie.IE, error)
ModificationRequest handles a SessionModificationRequest message.
type SessionTable ¶
type SessionTable struct {
// contains filtered or unexported fields
}
SessionTable stores PFCP sessions and instructs face creation.
func NewSessionTable ¶
func NewSessionTable( createFace func(ctx context.Context, sloc SessionLocatorFields) (id string, e error), destroyFace func(ctx context.Context, id string) error, ) *SessionTable
NewSessionTable constructs SessionTable.
func (*SessionTable) DeletionRequest ¶
func (st *SessionTable) DeletionRequest(ctx context.Context, req *message.SessionDeletionRequest) (sess *Session, e error)
DeletionRequest handles a SessionDeletionRequest message.
func (*SessionTable) EstablishmentRequest ¶
func (st *SessionTable) EstablishmentRequest(ctx context.Context, req *message.SessionEstablishmentRequest, rspIEs []*ie.IE) (sess *Session, rspIEsRet []*ie.IE, e error)
EstablishmentRequest handles a SessionEstablishmentRequest message.
func (*SessionTable) ModificationRequest ¶
func (st *SessionTable) ModificationRequest(ctx context.Context, req *message.SessionModificationRequest, rspIEs []*ie.IE) (sess *Session, rspIEsRet []*ie.IE, e error)
ModificationRequest handles a SessionModificationRequest message.
type UPF ¶
type UPF struct {
// contains filtered or unexported fields
}
UPF represents a User Plane Function.
func NewUPF ¶
func NewUPF( params UpfParams, createFace func(ctx context.Context, loc any) (id string, e error), destroyFace func(ctx context.Context, id string) error, ) *UPF
NewUPF constructs UPF.
func (*UPF) AssociationSetupRequest ¶
func (upf *UPF) AssociationSetupRequest(ctx context.Context, req *message.AssociationSetupRequest) (rsp *message.AssociationSetupResponse, e error)
AssociationSetupRequest handles an AssociationSetupRequest message.
func (*UPF) HeartbeatRequest ¶
func (upf *UPF) HeartbeatRequest(ctx context.Context, req *message.HeartbeatRequest) (rsp *message.HeartbeatResponse, e error)
HeartbeatRequest handles a HeartbeatRequest message.
func (*UPF) SessionDeletionRequest ¶
func (upf *UPF) SessionDeletionRequest(ctx context.Context, req *message.SessionDeletionRequest) (rsp *message.SessionDeletionResponse, e error)
SessionDeletionRequest handles a SessionDeletionRequest message.
func (*UPF) SessionEstablishmentRequest ¶
func (upf *UPF) SessionEstablishmentRequest(ctx context.Context, req *message.SessionEstablishmentRequest) (rsp *message.SessionEstablishmentResponse, e error)
SessionEstablishmentRequest handles a SessionEstablishmentRequest message.
func (*UPF) SessionModificationRequest ¶
func (upf *UPF) SessionModificationRequest(ctx context.Context, req *message.SessionModificationRequest) (rsp *message.SessionModificationResponse, e error)
SessionModificationRequest handles a SessionModificationRequest message.
type UpfLocatorFields ¶
type UpfLocatorFields struct { Scheme string `json:"scheme"` Local macaddr.Flag `json:"local"` VLAN int `json:"vlan,omitempty"` LocalIP netip.Addr `json:"localIP"` InnerLocalIP netip.Addr `json:"innerLocalIP"` }
UpfLocatorFields contains GTP-U locator fields not related to a PFCP session.
type UpfParams ¶
type UpfParams struct { SmfN4 netip.Addr UpfN4 netip.Addr Locator UpfLocatorFields MapN3 map[netip.Addr]macaddr.Flag RecoveryTimestamp *ie.IE UpfNodeID *ie.IE }
UpfParams contains UPF parameters.
func (*UpfParams) DefineFlags ¶
func (p *UpfParams) DefineFlags(flags []cli.Flag) []cli.Flag
DefineFlags appends CLI flags.
func (UpfParams) MakeLocator ¶
func (p UpfParams) MakeLocator(sloc SessionLocatorFields) (loc any, e error)
MakeLocator constructs GTP-U face locator.
func (*UpfParams) ProcessFlags ¶
ProcessFlags validates and stores CLI flags.