pfcp_networking

package module
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 11 Imported by: 0

README

go-pfcp-networking: PFCP Networking functionnalities on top of go-pfcp

Still a Work In Progress. API may change before v1.0.0.

Features

  • PFCP Sessions handling (currently only PFCP Session establishment procedure is supported)

Getting started

Server (UPF)
upNode := NewPFCPServerEntity(upAddress)
upNode.Start()
// Access list of sessions
sessions := upNode.GetPFCPSessions()
Client (SMF)
cpNode := NewPFCPClientEntity(cpAddress)
cpNode.Start()
peer, _ := NewPFCPPeer(cpNode, pfcputils.CreateNodeID(nodeID)
a, _ := cpNode.NewPFCPAssociation(peer)
a.NewPFCPSession(cp.GetNextRemoteSessionID(), pdrs, fars)

Author

Louis Royer

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFSEID

func NewFSEID(seid uint64, v4, v6 *net.IPAddr) (*ie.IE, error)

Types

type PFCPAssociation

type PFCPAssociation struct {
	*PFCPPeer
	// contains filtered or unexported fields
}

func NewPFCPAssociation

func NewPFCPAssociation(peer *PFCPPeer) PFCPAssociation

func (*PFCPAssociation) CreateSession

func (association *PFCPAssociation) CreateSession(seid, rseid uint64, pdrs []*pfcprule.PDR, fars []*pfcprule.FAR) (session *PFCPSession, err error)

func (*PFCPAssociation) GetSessions

func (association *PFCPAssociation) GetSessions() map[uint64]*PFCPSession

func (*PFCPAssociation) NewPFCPSession

func (association *PFCPAssociation) NewPFCPSession(seid uint64, pdrs []*pfcprule.PDR, fars []*pfcprule.FAR) (session *RemotePFCPSession, err error)

type PFCPClientEntity

type PFCPClientEntity struct {
	PFCPEntity
	// contains filtered or unexported fields
}

func NewPFCPClientEntity

func NewPFCPClientEntity(nodeID string) *PFCPClientEntity

func (*PFCPClientEntity) CreatePFCPAssociation

func (e *PFCPClientEntity) CreatePFCPAssociation(association *PFCPAssociation) error

Add an association to the association table

func (*PFCPClientEntity) GetPFCPAssociation

func (e *PFCPClientEntity) GetPFCPAssociation(nid string) (association *PFCPAssociation, err error)

Returns an existing PFCP Association

func (*PFCPClientEntity) NewPFCPAssociation

func (e *PFCPClientEntity) NewPFCPAssociation(peer *PFCPPeer) (association *PFCPAssociation, err error)

Create a PFCP Association, by sending a PFCP Association Setup Request

func (*PFCPClientEntity) RemovePFCPAssociation

func (e *PFCPClientEntity) RemovePFCPAssociation(association *PFCPAssociation) error

Remove an association from the association table

func (*PFCPClientEntity) Start

func (e *PFCPClientEntity) Start() error

type PFCPEntity

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

func NewPFCPEntity

func NewPFCPEntity(nodeID string) PFCPEntity

func (*PFCPEntity) AddHandler

func (e *PFCPEntity) AddHandler(t pfcputil.MessageType, h handler) error

func (*PFCPEntity) AddHandlers

func (e *PFCPEntity) AddHandlers(funcs map[pfcputil.MessageType]handler) error

func (*PFCPEntity) GetHandler

func (e *PFCPEntity) GetHandler(t pfcputil.MessageType) (h handler, err error)

func (*PFCPEntity) GetNextRemoteSessionID

func (e *PFCPEntity) GetNextRemoteSessionID() uint64

func (*PFCPEntity) NodeID

func (e *PFCPEntity) NodeID() *ie.IE

func (*PFCPEntity) RecoveryTimeStamp

func (e *PFCPEntity) RecoveryTimeStamp() *ie.IE

func (*PFCPEntity) ReplyTo

func (entity *PFCPEntity) ReplyTo(ipAddress net.Addr, requestMessage message.Message, responseMessage message.Message) error

type PFCPEntityInterface

type PFCPEntityInterface interface {
	NodeID() *ie.IE
	RecoveryTimeStamp() *ie.IE
	CreatePFCPAssociation(association *PFCPAssociation) error
	RemovePFCPAssociation(association *PFCPAssociation) error
	GetPFCPAssociation(nid string) (association *PFCPAssociation, err error)
	ReplyTo(ipAddress net.Addr, requestMessage message.Message, responseMessage message.Message) error
	GetNextRemoteSessionID() uint64
}

type PFCPPeer

type PFCPPeer struct {
	NodeID *ie.IE
	Srv    PFCPEntityInterface
	// contains filtered or unexported fields
}

func NewPFCPPeer

func NewPFCPPeer(srv PFCPEntityInterface, nodeID *ie.IE) (peer *PFCPPeer, err error)

func (*PFCPPeer) Close

func (peer *PFCPPeer) Close() error

Close connection of PFCPPeer

func (*PFCPPeer) IsAlive

func (peer *PFCPPeer) IsAlive() (res bool, err error)

Send an Heartbeat request, return true if the PFCP peer is alive.

func (*PFCPPeer) Send

func (peer *PFCPPeer) Send(msg message.Message) (m message.Message, err error)

Send a PFCP message

type PFCPServerEntity

type PFCPServerEntity struct {
	PFCPEntity
	// contains filtered or unexported fields
}

func NewPFCPServerEntity

func NewPFCPServerEntity(nodeID string) *PFCPServerEntity

func (*PFCPServerEntity) CreatePFCPAssociation

func (e *PFCPServerEntity) CreatePFCPAssociation(association *PFCPAssociation) error

Add an association to the association table

func (*PFCPServerEntity) GetPFCPAssociation

func (e *PFCPServerEntity) GetPFCPAssociation(nid string) (association *PFCPAssociation, err error)

Returns an existing PFCP Association

func (*PFCPServerEntity) GetPFCPSessions

func (e *PFCPServerEntity) GetPFCPSessions() []*PFCPSession

func (*PFCPServerEntity) RemovePFCPAssociation

func (e *PFCPServerEntity) RemovePFCPAssociation(association *PFCPAssociation) error

Remove an association from the association table

func (*PFCPServerEntity) Start

func (e *PFCPServerEntity) Start() error

type PFCPSession

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

func NewPFCPSession

func NewPFCPSession(fseid *ie.IE, rseid uint64) PFCPSession

func (*PFCPSession) AddFARs

func (s *PFCPSession) AddFARs(fars map[uint32]*pfcprule.FAR)

func (*PFCPSession) AddPDRs

func (s *PFCPSession) AddPDRs(pdrs map[uint16]*pfcprule.PDR)

func (*PFCPSession) FSEID

func (s *PFCPSession) FSEID() *ie.IE

func (*PFCPSession) GetFAR

func (s *PFCPSession) GetFAR(farid uint32) (*pfcprule.FAR, error)

func (*PFCPSession) GetPDRs

func (s *PFCPSession) GetPDRs() pfcprule.PDRs

func (*PFCPSession) RSEID

func (s *PFCPSession) RSEID() uint64

func (*PFCPSession) SEID

func (s *PFCPSession) SEID() (uint64, error)

type RemotePFCPSession

type RemotePFCPSession struct {
	PFCPSession
	// contains filtered or unexported fields
}

func NewRemotePFCPSession

func NewRemotePFCPSession(fseid *ie.IE, association *PFCPAssociation) RemotePFCPSession

func (*RemotePFCPSession) Start

func (s *RemotePFCPSession) Start(pdrs []*pfcprule.PDR, fars []*pfcprule.FAR) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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