pfcpUdp

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 29

Documentation

Index

Constants

View Source
const (
	PFCP_PORT        = 8805
	PFCP_MAX_UDP_LEN = 2048
)

Variables

View Source
var ErrReceivedResentRequest = errors.New("received a request that is re-sent")

Functions

func ReceivePfcpMessage

func ReceivePfcpMessage(msg *pfcp.Message, srcAddr *net.UDPAddr, dstAddr *net.UDPAddr) error

Receive a PFCP message and close UDP connection

func SendPfcpMessage

func SendPfcpMessage(msg pfcp.Message, srcAddr *net.UDPAddr, dstAddr *net.UDPAddr) error

Send a PFCP message and close UDP connection

Types

type ConsumerTable

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

func (*ConsumerTable) Delete

func (t *ConsumerTable) Delete(consumerAddr string)

func (*ConsumerTable) Load

func (t *ConsumerTable) Load(consumerAddr string) (*pfcp.TxTable, bool)

func (*ConsumerTable) LoadOrStore added in v1.0.5

func (t *ConsumerTable) LoadOrStore(consumerAddr string, storeTable *pfcp.TxTable) (*pfcp.TxTable, bool)

func (*ConsumerTable) Store

func (t *ConsumerTable) Store(consumerAddr string, txTable *pfcp.TxTable)

type Message

type Message struct {
	RemoteAddr  *net.UDPAddr
	PfcpMessage *pfcp.Message
}

func NewMessage

func NewMessage(remoteAddr *net.UDPAddr, pfcpMessage *pfcp.Message) (msg *Message)

func (*Message) MessageType added in v1.0.4

func (m *Message) MessageType() pfcp.MessageType

type PfcpServer

type PfcpServer struct {
	Addr string
	Conn *net.UDPConn
	// Consumer Table
	// Map Consumer IP to its tx table
	ConsumerTable ConsumerTable
}

func NewPfcpServer

func NewPfcpServer(addr string) *PfcpServer

func (*PfcpServer) Close

func (pfcpServer *PfcpServer) Close() error

func (*PfcpServer) FindTransaction

func (pfcpServer *PfcpServer) FindTransaction(msg *pfcp.Message, addr *net.UDPAddr) (*pfcp.Transaction, error)

func (*PfcpServer) Listen

func (pfcpServer *PfcpServer) Listen() error

func (*PfcpServer) PutTransaction

func (pfcpServer *PfcpServer) PutTransaction(tx *pfcp.Transaction) (err error)

func (*PfcpServer) ReadFrom

func (pfcpServer *PfcpServer) ReadFrom() (*Message, error)

func (*PfcpServer) RemoveTransaction

func (pfcpServer *PfcpServer) RemoveTransaction(tx *pfcp.Transaction) (err error)

func (*PfcpServer) StartReqTxLifeCycle added in v1.0.4

func (pfcpServer *PfcpServer) StartReqTxLifeCycle(tx *pfcp.Transaction) (resMsg *Message, err error)

func (*PfcpServer) StartResTxLifeCycle added in v1.0.4

func (pfcpServer *PfcpServer) StartResTxLifeCycle(tx *pfcp.Transaction)

StartResTxLifeCycle does not return an error because if an error occurs, a resend request will be sent

func (*PfcpServer) WriteRequestTo added in v1.0.4

func (pfcpServer *PfcpServer) WriteRequestTo(reqMsg *pfcp.Message, addr *net.UDPAddr) (resMsg *Message, err error)

func (*PfcpServer) WriteResponseTo added in v1.0.4

func (pfcpServer *PfcpServer) WriteResponseTo(resMsg *pfcp.Message, addr *net.UDPAddr)

Jump to

Keyboard shortcuts

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