pfcp_networking

package module
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 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(cpNode.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(localSEID uint64, remoteFseid *ie.IE, pdrs []*pfcprule.PDR, fars []*pfcprule.FAR) (session *PFCPSession, err error)

func (*PFCPAssociation) GetSessions

func (association *PFCPAssociation) GetSessions() PFCPSessionMapSEID

func (*PFCPAssociation) NewPFCPSession

func (association *PFCPAssociation) NewPFCPSession(localSEID 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) GetLocalSessions added in v0.0.19

func (e *PFCPClientEntity) GetLocalSessions() PFCPSessionMapSEID

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

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)
	GetNextRemoteSessionID() uint64
	GetLocalSessions() PFCPSessionMapSEID
	// contains filtered or unexported methods
}

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) GetLocalSessions added in v0.0.19

func (e *PFCPServerEntity) GetLocalSessions() PFCPSessionMapSEID

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
}

A PFCPSession is controlled localy

func NewPFCPSession

func NewPFCPSession(fseid, rseid *ie.IE) 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) GetFAR

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

func (*PFCPSession) GetPDRs

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

func (*PFCPSession) LocalFSEID added in v0.0.19

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

func (*PFCPSession) LocalIPAddress added in v0.0.19

func (s *PFCPSession) LocalIPAddress() (net.IP, error)

func (*PFCPSession) LocalSEID added in v0.0.19

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

func (*PFCPSession) RemoteFSEID added in v0.0.19

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

func (*PFCPSession) RemoteIPAddress added in v0.0.19

func (s *PFCPSession) RemoteIPAddress() (net.IP, error)

func (*PFCPSession) RemoteSEID added in v0.0.19

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

func (*PFCPSession) SetRemoteFSEID added in v0.0.19

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

Set the remote FSEID of a PFCPSession

type PFCPSessionMapSEID added in v0.0.19

type PFCPSessionMapSEID = map[uint64]*PFCPSession

type ReceivedMessage added in v0.0.19

type ReceivedMessage struct {
	message.Message
	SenderAddr net.Addr
	Entity     PFCPEntityInterface
}

func (*ReceivedMessage) ReplyTo added in v0.0.19

func (receivedMessage *ReceivedMessage) ReplyTo(responseMessage message.Message) error

type RemotePFCPSession

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

A RemotePFCPSession is a PFCPSession that will be pushed to a remote Associated Peer Peer A create a RemotePFCPSession and push it to Peer B: 1. A.NewRemotePFCPSessionp(…).Start() 2. Now on B side, a PFCPSession is created with the rules defined by A

func NewRemotePFCPSession

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

func (*RemotePFCPSession) Start

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

type RemotePFCPSessionMapSEID added in v0.0.19

type RemotePFCPSessionMapSEID = map[uint64]*RemotePFCPSession

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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