Documentation
¶
Overview ¶
Copyright 2024 Louis Royer and the go-pfcp-networking contributors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. SPDX-License-Identifier: MIT
Index ¶
- func NewFSEID(seid api.SEID, v4, v6 *net.IPAddr) (*ie.IE, error)
- type AssociationsMap
- func (a *AssociationsMap) Add(association api.PFCPAssociationInterface) error
- func (a *AssociationsMap) CheckNonExist(nid string) bool
- func (a *AssociationsMap) Get(nid string) (association api.PFCPAssociationInterface, err error)
- func (a *AssociationsMap) Remove(association api.PFCPAssociationInterface) error
- func (a *AssociationsMap) Update(association api.PFCPAssociationInterface) error
- type EntityOptions
- type FAR
- type FARMap
- func (m *FARMap) Add(far api.FARInterface) error
- func (m *FARMap) Foreach(f func(api.FARInterface) error) error
- func (m *FARMap) Get(key api.FARID) (api.FARInterface, error)
- func (m *FARMap) IntoCreateFAR() []*ie.IE
- func (m *FARMap) NewCreateFARs() []*ie.IE
- func (m *FARMap) Remove(key api.FARID) error
- func (m *FARMap) SimulateAdd(far api.FARInterface) error
- func (m *FARMap) SimulateRemove(key api.FARID) error
- func (m *FARMap) SimulateUpdate(far api.FARUpdateInterface) error
- func (m *FARMap) Update(farUpdate api.FARUpdateInterface) error
- type FARMapUpdate
- type FARUpdate
- type OutcomingMessage
- func DefaultAssociationSetupRequestHandler(ctx context.Context, msg ReceivedMessage) (*OutcomingMessage, error)
- func DefaultHeartbeatRequestHandler(ctx context.Context, msg ReceivedMessage) (*OutcomingMessage, error)
- func DefaultSessionEstablishmentRequestHandler(ctx context.Context, msg ReceivedMessage) (*OutcomingMessage, error)
- func DefaultSessionModificationRequestHandler(ctx context.Context, msg ReceivedMessage) (*OutcomingMessage, error)
- type PDR
- func (pdr *PDR) FARID() (api.FARID, error)
- func (pdr *PDR) FTEID() (*ie.FTEIDFields, error)
- func (pdr *PDR) ID() (api.PDRID, error)
- func (pdr *PDR) NewCreatePDR() *ie.IE
- func (pdr *PDR) NewUpdatePDR() *ie.IE
- func (pdr *PDR) OuterHeaderRemoval() *ie.IE
- func (pdr *PDR) PDI() ([]*ie.IE, error)
- func (pdr *PDR) Precedence() (uint32, error)
- func (pdr *PDR) SourceInterface() (uint8, error)
- func (pdr *PDR) UEIPAddress() (*ie.UEIPAddressFields, error)
- type PDRMap
- func (m *PDRMap) Add(pdr api.PDRInterface) error
- func (m *PDRMap) Foreach(f func(api.PDRInterface) error) error
- func (m *PDRMap) Get(key api.PDRID) (api.PDRInterface, error)
- func (m *PDRMap) GetSortedPDRIDs() []api.PDRID
- func (m *PDRMap) IntoCreatePDR() []*ie.IE
- func (m *PDRMap) IntoUpdatePDR() []*ie.IE
- func (m *PDRMap) Len() int
- func (m *PDRMap) Less(i, j int) bool
- func (m *PDRMap) NewCreatePDRs() []*ie.IE
- func (m *PDRMap) Remove(key api.PDRID) error
- func (m *PDRMap) SimulateAdd(pdr api.PDRInterface) error
- func (m *PDRMap) SimulateRemove(key api.PDRID) error
- func (m *PDRMap) SimulateUpdate(pdr api.PDRInterface) error
- func (m *PDRMap) Swap(i, j int)
- func (m *PDRMap) Update(pdr api.PDRInterface) error
- type PFCPAssociation
- type PFCPConn
- type PFCPEntity
- func (e *PFCPEntity) AddEstablishedPFCPSession(session api.PFCPSessionInterface) error
- func (e *PFCPEntity) AddHandler(t pfcputil.MessageType, h PFCPMessageHandler) error
- func (e *PFCPEntity) AddHandlers(funcs map[pfcputil.MessageType]PFCPMessageHandler) error
- func (e *PFCPEntity) Close() error
- func (e *PFCPEntity) GetHandler(t pfcputil.MessageType) (h PFCPMessageHandler, err error)
- func (e *PFCPEntity) GetPFCPAssociation(nid string) (association api.PFCPAssociationInterface, err error)
- func (e *PFCPEntity) GetPFCPSession(localIP string, seid api.SEID) (api.PFCPSessionInterface, error)
- func (e *PFCPEntity) GetPFCPSessions() []api.PFCPSessionInterface
- func (e *PFCPEntity) IsControlPlane() bool
- func (e *PFCPEntity) IsUserPlane() bool
- func (e *PFCPEntity) ListenAddr() netip.Addr
- func (e *PFCPEntity) ListenAndServe() error
- func (e *PFCPEntity) ListenAndServeContext(ctx context.Context) error
- func (e *PFCPEntity) LogPFCPRules()
- func (e *PFCPEntity) NewEstablishedPFCPAssociation(nodeID *ie.IE) (association api.PFCPAssociationInterface, err error)
- func (e *PFCPEntity) NodeID() *ie.IE
- func (e *PFCPEntity) Options() api.EntityOptionsInterface
- func (e *PFCPEntity) RecoveryTimeStamp() *ie.IE
- func (e *PFCPEntity) RemovePFCPAssociation(association api.PFCPAssociationInterface) error
- func (e *PFCPEntity) Serve(ctx context.Context, conn *PFCPConn) error
- func (e *PFCPEntity) WaitReady(ctx context.Context) error
- type PFCPEntityCP
- type PFCPEntityUP
- type PFCPMessageHandler
- type PFCPPeer
- func (peer *PFCPPeer) Close() error
- func (peer *PFCPPeer) IsAlive() (res bool, err error)
- func (peer *PFCPPeer) IsControlPlane() bool
- func (peer *PFCPPeer) IsRunning() bool
- func (peer *PFCPPeer) IsUserPlane() bool
- func (peer *PFCPPeer) LocalEntity() api.PFCPEntityInterface
- func (peer *PFCPPeer) NewEstablishedPFCPAssociation() (api.PFCPAssociationInterface, error)
- func (peer *PFCPPeer) NodeID() *ie.IE
- func (peer *PFCPPeer) Send(msg message.Message) (m message.Message, err error)
- type PFCPSession
- func (s *PFCPSession) AddUpdatePDRsFARs(createpdrs api.PDRMapInterface, createfars api.FARMapInterface, ...) error
- func (s *PFCPSession) ForeachUnsortedPDR(f func(pdr api.PDRInterface) error) error
- func (s *PFCPSession) GetFAR(farid api.FARID) (api.FARInterface, error)
- func (s *PFCPSession) GetPDR(pdrid api.PDRID) (api.PDRInterface, error)
- func (s *PFCPSession) GetSortedPDRIDs() []api.PDRID
- func (s *PFCPSession) LocalFSEID() *ie.IE
- func (s *PFCPSession) LocalIPAddress() (net.IP, error)
- func (s *PFCPSession) LocalSEID() (api.SEID, error)
- func (s *PFCPSession) RLock()
- func (s *PFCPSession) RUnlock()
- func (s *PFCPSession) RemoteFSEID() *ie.IE
- func (s *PFCPSession) RemoteIPAddress() (net.IP, error)
- func (s *PFCPSession) RemoteSEID() (api.SEID, error)
- func (s *PFCPSession) Setup() error
- type ReceivedMessage
- type SessionIDPool
- type SessionsMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssociationsMap ¶
type AssociationsMap struct {
// contains filtered or unexported fields
}
func NewAssociationsMap ¶
func NewAssociationsMap() AssociationsMap
func (*AssociationsMap) Add ¶
func (a *AssociationsMap) Add(association api.PFCPAssociationInterface) error
Add an association to the association table
func (*AssociationsMap) CheckNonExist ¶
func (a *AssociationsMap) CheckNonExist(nid string) bool
Returns true if the association does not exist
func (*AssociationsMap) Get ¶
func (a *AssociationsMap) Get(nid string) (association api.PFCPAssociationInterface, err error)
Returns a copy of an existing PFCP Association
func (*AssociationsMap) Remove ¶
func (a *AssociationsMap) Remove(association api.PFCPAssociationInterface) error
Remove an association from the association table
func (*AssociationsMap) Update ¶
func (a *AssociationsMap) Update(association api.PFCPAssociationInterface) error
Update a Association
type EntityOptions ¶ added in v0.0.31
type EntityOptions struct {
// contains filtered or unexported fields
}
func NewEntityOptions ¶ added in v0.0.31
func NewEntityOptions() *EntityOptions
NewEntityOptions create a new EntityOptions with default settings.
func (EntityOptions) MessageRetransmissionN1 ¶ added in v0.0.31
func (eo EntityOptions) MessageRetransmissionN1() int
func (EntityOptions) MessageRetransmissionT1 ¶ added in v0.0.31
func (eo EntityOptions) MessageRetransmissionT1() time.Duration
func (EntityOptions) SetMessageRetransmissionN1 ¶ added in v0.0.34
func (eo EntityOptions) SetMessageRetransmissionN1(messageRetransmissionN1 int) error
func (EntityOptions) SetMessageRetransmissionT1 ¶ added in v0.0.34
func (eo EntityOptions) SetMessageRetransmissionT1(messageRetransmissionT1 time.Duration) error
type FAR ¶
type FAR struct {
// contains filtered or unexported fields
}
func (*FAR) ApplyAction ¶
func (*FAR) NewCreateFAR ¶
type FARMap ¶
type FARMap struct {
// contains filtered or unexported fields
}
func (*FARMap) IntoCreateFAR ¶ added in v0.0.40
func (*FARMap) NewCreateFARs ¶
func (*FARMap) SimulateAdd ¶
func (m *FARMap) SimulateAdd(far api.FARInterface) error
func (*FARMap) SimulateUpdate ¶
func (m *FARMap) SimulateUpdate(far api.FARUpdateInterface) error
type FARMapUpdate ¶ added in v0.0.42
type FARMapUpdate struct {
// contains filtered or unexported fields
}
func NewFARMapUpdate ¶ added in v0.0.36
func (*FARMapUpdate) Add ¶ added in v0.0.42
func (m *FARMapUpdate) Add(far api.FARUpdateInterface) error
func (*FARMapUpdate) Foreach ¶ added in v0.0.42
func (m *FARMapUpdate) Foreach(f func(api.FARUpdateInterface) error) error
func (*FARMapUpdate) IntoUpdateFAR ¶ added in v0.0.42
func (m *FARMapUpdate) IntoUpdateFAR() []*ie.IE
type FARUpdate ¶ added in v0.0.42
type FARUpdate struct {
// contains filtered or unexported fields
}
func NewFARUpdate ¶ added in v0.0.42
func (*FARUpdate) ApplyAction ¶ added in v0.0.42
func (*FARUpdate) NewUpdateFAR ¶ added in v0.0.42
func (*FARUpdate) UpdateForwardingParameters ¶ added in v0.0.42
type OutcomingMessage ¶ added in v0.0.33
func DefaultAssociationSetupRequestHandler ¶ added in v0.0.28
func DefaultAssociationSetupRequestHandler(ctx context.Context, msg ReceivedMessage) (*OutcomingMessage, error)
func DefaultHeartbeatRequestHandler ¶ added in v0.0.28
func DefaultHeartbeatRequestHandler(ctx context.Context, msg ReceivedMessage) (*OutcomingMessage, error)
func DefaultSessionEstablishmentRequestHandler ¶ added in v0.0.28
func DefaultSessionEstablishmentRequestHandler(ctx context.Context, msg ReceivedMessage) (*OutcomingMessage, error)
func DefaultSessionModificationRequestHandler ¶ added in v0.0.28
func DefaultSessionModificationRequestHandler(ctx context.Context, msg ReceivedMessage) (*OutcomingMessage, error)
type PDR ¶
type PDR struct {
// contains filtered or unexported fields
}
func (*PDR) NewCreatePDR ¶
func (*PDR) NewUpdatePDR ¶ added in v0.0.40
func (*PDR) OuterHeaderRemoval ¶
func (*PDR) Precedence ¶
func (*PDR) SourceInterface ¶ added in v0.0.29
func (*PDR) UEIPAddress ¶ added in v0.0.29
func (pdr *PDR) UEIPAddress() (*ie.UEIPAddressFields, error)
type PDRMap ¶
type PDRMap struct {
// contains filtered or unexported fields
}
func (*PDRMap) GetSortedPDRIDs ¶
func (*PDRMap) IntoCreatePDR ¶ added in v0.0.40
func (*PDRMap) IntoUpdatePDR ¶ added in v0.0.40
func (*PDRMap) NewCreatePDRs ¶
func (*PDRMap) SimulateAdd ¶
func (m *PDRMap) SimulateAdd(pdr api.PDRInterface) error
func (*PDRMap) SimulateUpdate ¶
func (m *PDRMap) SimulateUpdate(pdr api.PDRInterface) error
type PFCPAssociation ¶
type PFCPAssociation struct { api.PFCPPeerInterface // connection to remote peer // contains filtered or unexported fields }
func (*PFCPAssociation) CreateSession ¶
func (association *PFCPAssociation) CreateSession(remoteFseid *ie.IE, pdrs api.PDRMapInterface, fars api.FARMapInterface) (session api.PFCPSessionInterface, err error)
remoteFseid can be nil if caller is at CP function side
func (*PFCPAssociation) GetNextSEID ¶
func (association *PFCPAssociation) GetNextSEID() api.SEID
Get next available SEID for this PFCPAssociation. SEID are not globally unique, F-SEID are globally unique. F-SEID consist of IPv4 and/or IPv6 address(es) of the peer plus the SEID. So as long as SEID are unique per peer (i.e. per PFCPAssociation), everything should be okay.
func (*PFCPAssociation) SetupInitiatedByCP ¶
func (association *PFCPAssociation) SetupInitiatedByCP() error
Setup a PFCPAssociation with the PFCP Association Setup by the CP Function Procedure If the LocalEntity is a CP function, a PFCP Association Setup Request is sent, if the LocalEntity is a UP function, we assume this method is called because we received a Association Setup Request.
PFCP Association Setup Initiated by the UP Function is NOT supported (yet). PR are welcome.
See 129.244 v16.0.1, section 6.2.6.1: The setup of a PFCP association may be initiated by the CP function (see clause 6.2.6.2) or the UP function (see clause 6.2.6.3). The CP function and the UP function shall support the PFCP Association Setup initiated by the CP function. The CP function and the UP function may additionally support the PFCP Association Setup initiated by the UP function.
type PFCPConn ¶ added in v0.0.33
func ListenPFCP ¶ added in v0.0.33
func (*PFCPConn) Write ¶ added in v0.0.33
func (conn *PFCPConn) Write(m *OutcomingMessage) error
type PFCPEntity ¶
type PFCPEntity struct {
// contains filtered or unexported fields
}
func NewPFCPEntity ¶
func NewPFCPEntity(nodeID string, listenAddr netip.Addr, kind string, handlers map[pfcputil.MessageType]PFCPMessageHandler, options api.EntityOptionsInterface) PFCPEntity
func (*PFCPEntity) AddEstablishedPFCPSession ¶
func (e *PFCPEntity) AddEstablishedPFCPSession(session api.PFCPSessionInterface) error
Add an Established PFCP Session
func (*PFCPEntity) AddHandler ¶
func (e *PFCPEntity) AddHandler(t pfcputil.MessageType, h PFCPMessageHandler) error
func (*PFCPEntity) AddHandlers ¶
func (e *PFCPEntity) AddHandlers(funcs map[pfcputil.MessageType]PFCPMessageHandler) error
func (*PFCPEntity) Close ¶ added in v0.0.33
func (e *PFCPEntity) Close() error
Close stop the server and closes active PFCP connection.
func (*PFCPEntity) GetHandler ¶
func (e *PFCPEntity) GetHandler(t pfcputil.MessageType) (h PFCPMessageHandler, err error)
func (*PFCPEntity) GetPFCPAssociation ¶
func (e *PFCPEntity) GetPFCPAssociation(nid string) (association api.PFCPAssociationInterface, err error)
Returns an existing PFCP Association
func (*PFCPEntity) GetPFCPSession ¶
func (e *PFCPEntity) GetPFCPSession(localIP string, seid api.SEID) (api.PFCPSessionInterface, error)
func (*PFCPEntity) GetPFCPSessions ¶
func (e *PFCPEntity) GetPFCPSessions() []api.PFCPSessionInterface
func (*PFCPEntity) IsControlPlane ¶
func (e *PFCPEntity) IsControlPlane() bool
func (*PFCPEntity) IsUserPlane ¶
func (e *PFCPEntity) IsUserPlane() bool
func (*PFCPEntity) ListenAddr ¶ added in v0.0.40
func (e *PFCPEntity) ListenAddr() netip.Addr
func (*PFCPEntity) ListenAndServe ¶ added in v0.0.33
func (e *PFCPEntity) ListenAndServe() error
Listen PFCP and run the entity with the provided context. Always return a non-nil error.
func (*PFCPEntity) ListenAndServeContext ¶ added in v0.0.33
func (e *PFCPEntity) ListenAndServeContext(ctx context.Context) error
Listen PFCP and run the entity with the provided context. Always return a non-nil error.
func (*PFCPEntity) LogPFCPRules ¶ added in v0.0.33
func (e *PFCPEntity) LogPFCPRules()
func (*PFCPEntity) NewEstablishedPFCPAssociation ¶
func (e *PFCPEntity) NewEstablishedPFCPAssociation(nodeID *ie.IE) (association api.PFCPAssociationInterface, err error)
func (*PFCPEntity) NodeID ¶
func (e *PFCPEntity) NodeID() *ie.IE
func (*PFCPEntity) Options ¶ added in v0.0.31
func (e *PFCPEntity) Options() api.EntityOptionsInterface
func (*PFCPEntity) RecoveryTimeStamp ¶
func (e *PFCPEntity) RecoveryTimeStamp() *ie.IE
func (*PFCPEntity) RemovePFCPAssociation ¶
func (e *PFCPEntity) RemovePFCPAssociation(association api.PFCPAssociationInterface) error
Remove an association from the association table
type PFCPEntityCP ¶
type PFCPEntityCP struct {
PFCPEntity
}
func NewPFCPEntityCP ¶
func NewPFCPEntityCP(nodeID string, listenAddr netip.Addr) *PFCPEntityCP
func NewPFCPEntityCPWithOptions ¶ added in v0.0.31
func NewPFCPEntityCPWithOptions(nodeID string, listenAddr netip.Addr, options api.EntityOptionsInterface) *PFCPEntityCP
type PFCPEntityUP ¶
type PFCPEntityUP struct {
PFCPEntity
}
func NewPFCPEntityUP ¶
func NewPFCPEntityUP(nodeID string, listenAddr netip.Addr) *PFCPEntityUP
func NewPFCPEntityUPWithOptions ¶ added in v0.0.31
func NewPFCPEntityUPWithOptions(nodeID string, listenAddr netip.Addr, options api.EntityOptionsInterface) *PFCPEntityUP
type PFCPMessageHandler ¶
type PFCPMessageHandler = func(ctx context.Context, receivedMessage ReceivedMessage) (*OutcomingMessage, error)
type PFCPPeer ¶
type PFCPPeer struct {
// contains filtered or unexported fields
}
A PFCPPeer is a remote PFCPEntity
func (*PFCPPeer) IsControlPlane ¶
func (*PFCPPeer) IsUserPlane ¶
func (*PFCPPeer) LocalEntity ¶
func (peer *PFCPPeer) LocalEntity() api.PFCPEntityInterface
func (*PFCPPeer) NewEstablishedPFCPAssociation ¶
func (peer *PFCPPeer) NewEstablishedPFCPAssociation() (api.PFCPAssociationInterface, error)
type PFCPSession ¶
type PFCPSession struct {
// contains filtered or unexported fields
}
func (*PFCPSession) AddUpdatePDRsFARs ¶
func (s *PFCPSession) AddUpdatePDRsFARs(createpdrs api.PDRMapInterface, createfars api.FARMapInterface, updatepdrs api.PDRMapInterface, updatefars api.FARMapUpdateInterface) error
Add/Update PDRs and FARs to the session
func (*PFCPSession) ForeachUnsortedPDR ¶
func (s *PFCPSession) ForeachUnsortedPDR(f func(pdr api.PDRInterface) error) error
func (*PFCPSession) GetFAR ¶
func (s *PFCPSession) GetFAR(farid api.FARID) (api.FARInterface, error)
Get FAR associated with this FARID
func (*PFCPSession) GetPDR ¶
func (s *PFCPSession) GetPDR(pdrid api.PDRID) (api.PDRInterface, error)
Get PDR associated with this PDRID
func (*PFCPSession) GetSortedPDRIDs ¶
func (s *PFCPSession) GetSortedPDRIDs() []api.PDRID
Returns IDs of PDRs sorted by Precedence For PDI checking, the checking order is: look first at the first item of the array, look last at the last item of the array.
func (*PFCPSession) LocalFSEID ¶
func (s *PFCPSession) LocalFSEID() *ie.IE
Get local F-SEID of this session This value should be used when a session related message is received.
func (*PFCPSession) LocalIPAddress ¶
func (s *PFCPSession) LocalIPAddress() (net.IP, error)
Get IP Address part of local F-SEID This value should be used when a session related message is received.
func (*PFCPSession) LocalSEID ¶
func (s *PFCPSession) LocalSEID() (api.SEID, error)
Get SEID part of local F-SEID This value should be used when a session related message is received.
func (*PFCPSession) RLock ¶
func (s *PFCPSession) RLock()
func (*PFCPSession) RUnlock ¶
func (s *PFCPSession) RUnlock()
func (*PFCPSession) RemoteFSEID ¶
func (s *PFCPSession) RemoteFSEID() *ie.IE
Get remote F-SEID of this session This value should be used when a session related message is send.
func (*PFCPSession) RemoteIPAddress ¶
func (s *PFCPSession) RemoteIPAddress() (net.IP, error)
Get IP Address part of remote F-SEID This value should be used when a session related message is send.
func (*PFCPSession) RemoteSEID ¶
func (s *PFCPSession) RemoteSEID() (api.SEID, error)
Get SEID part of remote F-SEID This value should be used when a session related message is send.
func (*PFCPSession) Setup ¶
func (s *PFCPSession) Setup() error
Setup function, either by: performing the PFCP Session Establishment Procedure (if CP function), or by doing nothing particular (if UP function) since the PFCP Session Establishment Procedure is already performed
type ReceivedMessage ¶
func (*ReceivedMessage) NewResponse ¶ added in v0.0.33
func (receivedMessage *ReceivedMessage) NewResponse(responseMessage message.Message) (*OutcomingMessage, error)
type SessionIDPool ¶
type SessionIDPool struct {
// contains filtered or unexported fields
}
SessionIDPool is a generator of session IDs
func (*SessionIDPool) GetNext ¶
func (pool *SessionIDPool) GetNext() api.SEID
Get next id available in SessionIDPool
type SessionsMap ¶
type SessionsMap struct {
// contains filtered or unexported fields
}
func (*SessionsMap) Add ¶
func (sm *SessionsMap) Add(session api.PFCPSessionInterface) error
Add a session to the map
func (*SessionsMap) GetPFCPSession ¶
func (sm *SessionsMap) GetPFCPSession(localIP string, seid api.SEID) (api.PFCPSessionInterface, error)
Returns a PFCP Session by its FSEID
func (*SessionsMap) GetPFCPSessions ¶
func (sm *SessionsMap) GetPFCPSessions() []api.PFCPSessionInterface
Returns pfcpsessions in an array