smf

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FteidTypeIPv4                  = 0x01
	UEIpAddrTypeIPv4               = 0x02
	OuterHeaderRemoveGtpuUdpIpv4   = 0x00
	ApplyActionForw                = 0x02
	OuterHeaderCreationGtpuUdpIpv4 = 0x0100
)

PFCP Constants

Variables

View Source
var (
	ErrDnnNotFound             = errors.New("DNN not found")
	ErrPDUSessionAlreadyExists = errors.New("PDU Session already exists")
	ErrPDUSessionNotFound      = errors.New("PDU Session not found")

	ErrUpfNotAssociated    = errors.New("UPF not associated")
	ErrUpfNotFound         = errors.New("UPF not found")
	ErrInterfaceNotFound   = errors.New("interface not found")
	ErrNoPFCPRule          = errors.New("no PFCP rule to push")
	ErrNoIpAvailableInPool = errors.New("no IP address available in pool")
)

Functions

func NewUpfInterfaceMap

func NewUpfInterfaceMap(ifaces []config.Interface) map[netip.Addr]*UpfInterface

Types

type Fteid

type Fteid struct {
	Addr netip.Addr
	Teid uint32
}

type PduSessionN3

type PduSessionN3 struct {
	UeIpAddr      netip.Addr
	UplinkFteid   *Fteid
	DownlinkFteid *Fteid
}

type Pfcprules

type Pfcprules struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewPfcpRules

func NewPfcpRules() *Pfcprules

type SessionsMap

type SessionsMap struct {
	sync.Map // key: UE Ctrl ; value: *PduSessionN3
}

type Slice

type Slice struct {
	Upfs []netip.Addr
	Pool *UeIpPool
	// contains filtered or unexported fields
}

func NewSlice

func NewSlice(pool netip.Prefix, upfs []netip.Addr) *Slice

type SlicesMap

type SlicesMap struct {
	sync.Map // slice name: Slice
}

func NewSlicesMap

func NewSlicesMap(slices map[string]config.Slice) *SlicesMap

type Smf

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

func NewSmf

func NewSmf(addr netip.Addr, slices map[string]config.Slice) *Smf
func (smf *Smf) CreateSessionDownlink(ctx context.Context, ueCtrl jsonapi.ControlURI, dnn string, gnb netip.Addr, gnb_teid uint32) (*PduSessionN3, error)
func (smf *Smf) CreateSessionUplink(ctx context.Context, ueCtrl jsonapi.ControlURI, gnbCtrl jsonapi.ControlURI, dnn string) (*PduSessionN3, error)

func (*Smf) Start

func (smf *Smf) Start(ctx context.Context) error

func (*Smf) WaitShutdown

func (smf *Smf) WaitShutdown(ctx context.Context) error

type TEIDsPool

type TEIDsPool struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTEIDsPool

func NewTEIDsPool() *TEIDsPool

func (*TEIDsPool) Delete

func (t *TEIDsPool) Delete(teid uint32)

func (*TEIDsPool) Next

func (t *TEIDsPool) Next(ctx context.Context) (uint32, error)

type UeIpPool

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

func NewUeIpPool

func NewUeIpPool(pool netip.Prefix) *UeIpPool

func (*UeIpPool) Next

func (p *UeIpPool) Next() (netip.Addr, error)

type Upf

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

func NewUpf

func NewUpf(interfaces []config.Interface) *Upf

func (*Upf) Associate

func (upf *Upf) Associate(a pfcpapi.PFCPAssociationInterface)

func (*Upf) CreateSession

func (upf *Upf) CreateSession(ue netip.Addr) error

func (*Upf) CreateUplinkAnchor

func (upf *Upf) CreateUplinkAnchor(ctx context.Context, ueIp netip.Addr, dnn string, listenInterface netip.Addr) (*Fteid, error)

func (*Upf) CreateUplinkAnchorWithFteid

func (upf *Upf) CreateUplinkAnchorWithFteid(ueIp netip.Addr, dnn string, listenFteid *Fteid)

func (*Upf) CreateUplinkIntermediate

func (upf *Upf) CreateUplinkIntermediate(ctx context.Context, ueIp netip.Addr, dnn string, listenInterface netip.Addr, forwardFteid *Fteid) (*Fteid, error)

func (*Upf) CreateUplinkIntermediateWithFteid

func (upf *Upf) CreateUplinkIntermediateWithFteid(ueIp netip.Addr, dnn string, listenFteid *Fteid, forwardFteid *Fteid)

func (*Upf) GetN3

func (upf *Upf) GetN3() (netip.Addr, error)

func (*Upf) GetN9

func (upf *Upf) GetN9() (netip.Addr, error)

func (*Upf) NextListenFteid

func (upf *Upf) NextListenFteid(ctx context.Context, listenInterface netip.Addr) (*Fteid, error)

func (*Upf) Rules

func (upf *Upf) Rules(ueIp netip.Addr) *Pfcprules

func (*Upf) UpdateDownlinkAnchor

func (upf *Upf) UpdateDownlinkAnchor(ueIp netip.Addr, dnn string, forwardFteid *Fteid)

func (*Upf) UpdateDownlinkIntermediate

func (upf *Upf) UpdateDownlinkIntermediate(ctx context.Context, ueIp netip.Addr, dnn string, listenInterface netip.Addr, forwardFteid *Fteid) (*Fteid, error)

func (*Upf) UpdateDownlinkIntermediateWithFteid

func (upf *Upf) UpdateDownlinkIntermediateWithFteid(ueIp netip.Addr, dnn string, listenFteid *Fteid, forwardFteid *Fteid)

func (*Upf) UpdateSession

func (upf *Upf) UpdateSession(ue netip.Addr) error

type UpfInterface

type UpfInterface struct {
	Teids *TEIDsPool
	Types []string
}

func NewUpfInterface

func NewUpfInterface(t string) *UpfInterface

func (*UpfInterface) IsN3

func (iface *UpfInterface) IsN3() bool

func (*UpfInterface) IsN9

func (iface *UpfInterface) IsN9() bool

type UpfPath

type UpfPath []netip.Addr

type UpfsMap

type UpfsMap struct {
	sync.Map
}

func NewUpfsMap

func NewUpfsMap(slices map[string]config.Slice) *UpfsMap

Jump to

Keyboard shortcuts

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