Documentation
¶
Index ¶
- Constants
- Variables
- func BindDataPlaneInterfaces(bpfObjects *ebpf.BpfObjects, links *[]link.Link, interfaceNames []string, ...) error
- func DecodeDigitsFromBytes(buffer []byte) string
- func EncodeFQDN(fqdn string) []byte
- func EncodeFQDNHuawei(fqdn string) []byte
- func GatherMetrics(stats ebpf.UpfXdpActionStatistic)
- func GetFSEID(CPFSEID *ie.IE) uint64
- func GetTransportLevelMarking(far *ie.IE) (uint16, error)
- func GetURRIDs(i *ie.IE) ([]uint32, error)
- func HandlePfcpAssociationReleaseRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpAssociationSetupRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpAssociationSetupResponse(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpAssociationUpdateRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpAssociationUpdateResponse(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpHeartbeatRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpHeartbeatResponse(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpSessionDeletionRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpSessionEstablishmentRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpSessionModificationRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func HandlePfcpSessionReportResponse(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
- func InitLogger()
- func IsMessageTraceable(msgType uint8) bool
- func NewNodeIDHuawei(ipv4, ipv6, fqdn string) *ie.IE
- func ParseCidrIp(ipStr, maskStr string) (ebpf.IpWMask, error)
- func ParsePort(str string) (uint16, error)
- func ParsePortRange(str string) (ebpf.PortRange, error)
- func ParseProtocol(protocol string) (uint8, error)
- func ParseSdfFilter(flowDescription string) (ebpf.SdfFilter, error)
- func RegisterMetrics(stats ebpf.UpfXdpActionStatistic, conn []*PfcpConnection)
- func SendAssociationUpdate(conn *PfcpConnection, assoc *NodeAssociation, traced bool, release bool) error
- func SendDownlinkNotificationReport(conn *PfcpConnection, seid uint64, sequenceID uint32, associationAddr string, ...)
- func SendHeartbeatRequest(conn *PfcpConnection, sequenceID uint32, associationAddr string)
- func SendSessionReportADC(conn *PfcpConnection, seid uint64, sequenceID uint32, associationAddr string, ...)
- func SendSessionReportSessionRelease(conn *PfcpConnection, seid uint64, sequenceID uint32, associationAddr string, ...)
- func SendSessionReportUsage(conn *PfcpConnection, seid uint64, sequenceID uint32, associationAddr string, ...)
- func SetLoggerCaller(enableCaller bool)
- func SetLoggerLevel(loggingLevel string) error
- func StartMetrics(addr string) error
- func StringToXDPAttachMode(Mode string) link.XDPAttachFlags
- func UpdateAssociationSetupTimeout(pfcpSrv map[string]*PfcpConnection, associationSetupTimeout uint32)
- func UpdateDataPlaneAddresses(pfcpConnection map[string]*PfcpConnection, gtpPathManager *GtpPathManager, ...) error
- func UpdateGTPManager(gtpPathManager *GtpPathManager, gtpPeerAddresses []string, ...)
- func UpdateHeartbeatTimeout(pfcpSrv map[string]*PfcpConnection, heartbeatTimeout uint32)
- func UpdateLogCaller(enableCaller bool)
- func UpdateLogLevel(logLevel string) error
- func UpdatePFCPConnections(pfcpSrv map[string]*PfcpConnection, keyName string, address string, ...) error
- type AssociationConnector
- type DefaultAssociationConnector
- type DefaultProfile
- func (DefaultProfile) HeartbeatRequestAdditionalIEs() []*ie.IE
- func (DefaultProfile) N4Connector(remoteNode string) (AssociationConnector, error)
- func (DefaultProfile) NodeID(nodeID string) *ie.IE
- func (DefaultProfile) ParseOuterHeaderCreation(i *ie.IE) (FarHeaderFields, error)
- func (DefaultProfile) ParseQFI(qer *ie.IE) (uint8, bool)
- func (DefaultProfile) ParseSubscriberData(ieArr []*ie.IE) (imsi, msisdn string)
- func (DefaultProfile) SessionEstablishmentResponseAdditionalIEs(localSEID uint64, nodeAddrV4 net.IP) []*ie.IE
- func (DefaultProfile) SessionReportReleaseVendorIE(pdrList []uint16) *ie.IE
- func (DefaultProfile) SxaConnector(remoteNode string) (AssociationConnector, error)
- func (DefaultProfile) SxbConnector(remoteNode string) (AssociationConnector, error)
- func (DefaultProfile) URSEQN(sessionSeq, reportSeq uint32) *ie.IE
- func (DefaultProfile) UsageReportADCVendorIEs(sdfFilter string) []*ie.IE
- func (DefaultProfile) UsageReportDeletionVendorIEs() []*ie.IE
- func (DefaultProfile) UsageReportSessionReportVendorIEs() []*ie.IE
- type FarHeaderFields
- type GtpPathManager
- func (gtpPathManager *GtpPathManager) AddGtpPath(gtpPeerAddress string)
- func (gtpPathManager *GtpPathManager) Run()
- func (gtpPathManager *GtpPathManager) Stop()
- func (gtpPathManager *GtpPathManager) UpdateCheckTicker(newTicker *time.Ticker)
- func (gtpPathManager *GtpPathManager) UpdateGtpPath(gtpPeerAddresses []string)
- func (gtpPathManager *GtpPathManager) UpdateLocalAddress(newLocalAddress string)
- type HuaweiProfile
- func (h HuaweiProfile) HeartbeatRequestAdditionalIEs() []*ie.IE
- func (h HuaweiProfile) N4Connector(remoteNode string) (AssociationConnector, error)
- func (h HuaweiProfile) NodeID(nodeID string) *ie.IE
- func (h HuaweiProfile) ParseOuterHeaderCreation(i *ie.IE) (FarHeaderFields, error)
- func (h HuaweiProfile) ParseQFI(qer *ie.IE) (uint8, bool)
- func (h HuaweiProfile) ParseSubscriberData(ieArr []*ie.IE) (imsi, msisdn string)
- func (h HuaweiProfile) SessionEstablishmentResponseAdditionalIEs(localSEID uint64, nodeAddrV4 net.IP) []*ie.IE
- func (h HuaweiProfile) SessionReportReleaseVendorIE(pdrList []uint16) *ie.IE
- func (h HuaweiProfile) SxaConnector(remoteNode string) (AssociationConnector, error)
- func (h HuaweiProfile) SxbConnector(remoteNode string) (AssociationConnector, error)
- func (h HuaweiProfile) URSEQN(sessionSeq, reportSeq uint32) *ie.IE
- func (h HuaweiProfile) UsageReportADCVendorIEs(sdfFilter string) []*ie.IE
- func (h HuaweiProfile) UsageReportDeletionVendorIEs() []*ie.IE
- func (h HuaweiProfile) UsageReportSessionReportVendorIEs() []*ie.IE
- type NeValidator
- type NodeAssociation
- func (association *NodeAssociation) Close()
- func (association *NodeAssociation) HandleHeartbeat(sequence uint32)
- func (association *NodeAssociation) NewLocalSEID() uint64
- func (association *NodeAssociation) NewSequenceID() uint32
- func (association *NodeAssociation) ScheduleHeartbeat(conn *PfcpConnection)
- type Operation
- type OperationPool
- type OuterHeaderCreationFields
- func (f *OuterHeaderCreationFields) HasCTag() bool
- func (f *OuterHeaderCreationFields) HasIPv4() bool
- func (f *OuterHeaderCreationFields) HasIPv6() bool
- func (f *OuterHeaderCreationFields) HasPortNumber() bool
- func (f *OuterHeaderCreationFields) HasSTag() bool
- func (f *OuterHeaderCreationFields) HasTEID() bool
- func (f *OuterHeaderCreationFields) IsLLSSMCTEID() bool
- func (f *OuterHeaderCreationFields) IsN6() bool
- func (f *OuterHeaderCreationFields) IsN19() bool
- func (f *OuterHeaderCreationFields) Marshal() ([]byte, error)
- func (f *OuterHeaderCreationFields) MarshalLen() int
- func (f *OuterHeaderCreationFields) MarshalTo(b []byte) error
- func (f *OuterHeaderCreationFields) UnmarshalBinary(b []byte) error
- type PCCInfo
- type PDRCreationContext
- type PfcpConnection
- func (connection *PfcpConnection) Close()
- func (connection *PfcpConnection) DeleteAllAssociations()
- func (connection *PfcpConnection) DeleteAssociation(assocAddr string)
- func (connection *PfcpConnection) DeleteSession(session *Session)
- func (connection *PfcpConnection) DisableTracing() ([]tracing.TraceRecord, error)
- func (connection *PfcpConnection) DisableTracingByImsi(imsi string) (tracing.TraceRecord, error)
- func (connection *PfcpConnection) DisableTracingByMsisdn(msisdn string) (tracing.TraceRecord, error)
- func (connection *PfcpConnection) EnableTracingByImsi(imsi string) error
- func (connection *PfcpConnection) EnableTracingByMsisdn(msisdn string) error
- func (connection *PfcpConnection) GetAllTracingRecords() ([]tracing.TraceRecord, error)
- func (connection *PfcpConnection) GetAssiciationCount() int
- func (connection *PfcpConnection) GetAssociation(assocAddr string) *NodeAssociation
- func (connection *PfcpConnection) GetConnAddr() string
- func (connection *PfcpConnection) GetDumper() utils.Dumper
- func (connection *PfcpConnection) GetLocalAddr() string
- func (connection *PfcpConnection) GetMapOperations() ebpf.ForwardingPlaneController
- func (connection *PfcpConnection) GetN3Addr() string
- func (connection *PfcpConnection) GetN9Addr() string
- func (connection *PfcpConnection) GetResourceManager() *service.ResourceManager
- func (connection *PfcpConnection) GetSessionCount() int
- func (connection *PfcpConnection) GetTracingRecordByImsi(imsi string) (tracing.TraceRecord, error)
- func (connection *PfcpConnection) GetTracingRecordByMsisdn(msisdn string) (tracing.TraceRecord, error)
- func (connection *PfcpConnection) Handle(b []byte, addr *net.UDPAddr)
- func (connection *PfcpConnection) NeedSessionTrace(imsi, msisdn string) bool
- func (connection *PfcpConnection) Receive(b []byte) (n int, addr *net.UDPAddr, err error)
- func (connection *PfcpConnection) RefreshAssociations()
- func (connection *PfcpConnection) ReleaseResources(seID uint64)
- func (connection *PfcpConnection) ReleaseSessionByID(seid uint64) bool
- func (connection *PfcpConnection) ReleaseSessionByUserID(imsi string, msisdn string) bool
- func (connection *PfcpConnection) Run()
- func (connection *PfcpConnection) Send(b []byte, addr *net.UDPAddr) (int, error)
- func (connection *PfcpConnection) SendAssociationReleaseRequest()
- func (connection *PfcpConnection) SendMessage(msg message.Message, addr *net.UDPAddr) error
- func (connection *PfcpConnection) SendMessageWithTrace(msg message.Message, addr *net.UDPAddr, trace bool) error
- func (connection *PfcpConnection) SendReports()
- func (connection *PfcpConnection) SendReportsSDF(referenceID uint32, sdfFilter string)
- func (connection *PfcpConnection) SetRemoteNodes(nodes []AssociationConnector)
- func (connection *PfcpConnection) TraceMessage(b []byte, addr *net.UDPAddr, rx bool)
- func (connection *PfcpConnection) Update(pfcpAddress string, pfcpNodeId string) error
- func (connection *PfcpConnection) UpdateN3Address(n3addr net.IP)
- func (connection *PfcpConnection) UpdateN9Address(n9addr net.IP)
- func (connection *PfcpConnection) ValidateNetworkInstance(networkInstance string) bool
- type PfcpFunc
- type PfcpHandlerMap
- type PfcpProfile
- type SFarInfo
- type SPDRInfo
- type SQerInfo
- type SUrrInfo
- type Session
- func (s *Session) GetFar(id uint32) SFarInfo
- func (s *Session) GetPDR(id uint16) SPDRInfo
- func (s *Session) GetQer(id uint32) SQerInfo
- func (s *Session) GetSessionImsi() string
- func (s *Session) GetSessionMsisdn() string
- func (s *Session) GetUrr(id uint32) SUrrInfo
- func (s *Session) IsSessionTraced() bool
- func (s *Session) NewFar(id uint32, internalId uint32, farInfo ebpf.FarInfo)
- func (s *Session) NewQer(id uint32, internalId uint32, qerInfo ebpf.QerInfo)
- func (s *Session) NewUrr(id uint32, internalId uint32, urrInfo ebpf.UrrInfo)
- func (s *Session) PutPDR(id uint32, info SPDRInfo)
- func (s *Session) RemoveFar(id uint32) (SFarInfo, error)
- func (s *Session) RemovePDR(id uint32) (SPDRInfo, error)
- func (s *Session) RemoveQer(id uint32) (SQerInfo, error)
- func (s *Session) RemoveUrr(id uint32) (SUrrInfo, error)
- func (s *Session) UpdateFar(id uint32, farInfo ebpf.FarInfo)
- func (s *Session) UpdateQer(id uint32, qerInfo ebpf.QerInfo)
- func (s *Session) UpdateUrr(id uint32, urrInfo ebpf.UrrInfo)
- type SxaAssociationConnector
- type SxbAssociationConnector
Constants ¶
const ( N4PFCPKeyName = "n4" SxaPFCPKeyName = "Sxa" SxbPFCPKeyName = "Sxb" GTPPortStr = ":2152" )
Variables ¶
var ( ErrNilBPFObj = errors.New("BpfObjects is nil") ErrNilGtpPathManager = errors.New("GtpPathManager is nil") ErrNilInterface = errors.New("interface is nil") ErrAttachXDP = errors.New("could not attach XDP program") ErrLookupIface = errors.New("lookup network iface failed") ErrCloseOldLink = errors.New("close old link failed") ErrNonePFCPConn = errors.New("none PFCP connection") )
var ( PfcpMessageRx = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "upf_pfcp_rx", Help: "The total number of received PFCP messages", }, []string{"message_name"}) PfcpMessageTx = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "upf_pfcp_tx", Help: "The total number of transmitted PFCP messages", }, []string{"message_name"}) PfcpMessageRxErrors = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "upf_pfcp_rx_errors", Help: "The total number of received PFCP messages with cause code", }, []string{"message_name", "cause_code"}) UpfXdpAborted prometheus.CounterFunc UpfXdpDrop prometheus.CounterFunc UpfXdpPass prometheus.CounterFunc UpfXdpTx prometheus.CounterFunc UpfXdpRedirect prometheus.CounterFunc UpfPfcpSessions prometheus.GaugeFunc UpfPfcpAssociationsTotal prometheus.GaugeFunc UpfRx = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "upf_rx", Help: "The total number of received packets", }, []string{"packet_type"}) UpfRoute = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "upf_route", Help: "The total number of packets routed", }, []string{"packet_type"}) UpfMessageRxLatency = promauto.NewSummaryVec(prometheus.SummaryOpts{ Name: "upf_pfcp_rx_latency", Subsystem: "pfcp", Help: "Duration of the PFCP message processing", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }, []string{"message_type"}) UpfPfcpAssociations = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "upf_pfcp_associations", Help: "The current status of PFCP associations", }, []string{"node_id"}) )
var (
ErrSessionNotFound = errors.New("session not found")
)
Functions ¶
func BindDataPlaneInterfaces ¶
func DecodeDigitsFromBytes ¶
func EncodeFQDN ¶
EncodeFQDN encodes the given string as the Name Syntax defined in RFC 2181, RFC 1035 and RFC 1123.
func EncodeFQDNHuawei ¶
func GatherMetrics ¶ added in v0.7.0
func GatherMetrics(stats ebpf.UpfXdpActionStatistic)
func GetTransportLevelMarking ¶ added in v0.3.4
func HandlePfcpAssociationSetupRequest ¶
func HandlePfcpAssociationSetupRequest(conn *PfcpConnection, msg message.Message, addr string) (message.Message, bool, error)
https://www.etsi.org/deliver/etsi_ts/129200_129299/129244/16.04.00_60/ts_129244v160400p.pdf page 95
func HandlePfcpAssociationSetupResponse ¶ added in v0.7.0
func HandlePfcpAssociationUpdateRequest ¶ added in v0.7.0
func HandlePfcpHeartbeatResponse ¶ added in v0.3.3
func InitLogger ¶ added in v0.5.0
func InitLogger()
func IsMessageTraceable ¶
func NewNodeIDHuawei ¶
func ParseProtocol ¶ added in v0.5.0
func ParseSdfFilter ¶ added in v0.5.0
func RegisterMetrics ¶
func RegisterMetrics(stats ebpf.UpfXdpActionStatistic, conn []*PfcpConnection)
func SendAssociationUpdate ¶
func SendAssociationUpdate( conn *PfcpConnection, assoc *NodeAssociation, traced bool, release bool, ) error
func SendHeartbeatRequest ¶ added in v0.3.3
func SendHeartbeatRequest(conn *PfcpConnection, sequenceID uint32, associationAddr string)
func SendSessionReportADC ¶
func SendSessionReportUsage ¶
func SetLoggerCaller ¶
func SetLoggerCaller(enableCaller bool)
func SetLoggerLevel ¶ added in v0.5.0
func StartMetrics ¶
func StringToXDPAttachMode ¶
func StringToXDPAttachMode(Mode string) link.XDPAttachFlags
func UpdateAssociationSetupTimeout ¶
func UpdateAssociationSetupTimeout( pfcpSrv map[string]*PfcpConnection, associationSetupTimeout uint32, )
func UpdateDataPlaneAddresses ¶
func UpdateDataPlaneAddresses( pfcpConnection map[string]*PfcpConnection, gtpPathManager *GtpPathManager, n3Addr net.IP, n9Addr net.IP, ) error
func UpdateGTPManager ¶
func UpdateGTPManager( gtpPathManager *GtpPathManager, gtpPeerAddresses []string, GtpEchoInterval uint32, )
func UpdateHeartbeatTimeout ¶
func UpdateHeartbeatTimeout( pfcpSrv map[string]*PfcpConnection, heartbeatTimeout uint32, )
func UpdateLogCaller ¶
func UpdateLogCaller(enableCaller bool)
func UpdateLogLevel ¶
func UpdatePFCPConnections ¶
Types ¶
type AssociationConnector ¶ added in v0.7.0
type AssociationConnector interface {
// contains filtered or unexported methods
}
type DefaultAssociationConnector ¶ added in v0.7.0
type DefaultAssociationConnector struct {
// contains filtered or unexported fields
}
func NewDefaultAssociationConnector ¶ added in v0.7.0
func NewDefaultAssociationConnector(address string) (*DefaultAssociationConnector, error)
type DefaultProfile ¶
type DefaultProfile struct{}
DefaultProfile implements the standard 3GPP PFCP dialect using the go-pfcp library. It does not parse enterprise-specific IEs and uses standard URR sequence numbering.
func (DefaultProfile) HeartbeatRequestAdditionalIEs ¶
func (DefaultProfile) HeartbeatRequestAdditionalIEs() []*ie.IE
func (DefaultProfile) N4Connector ¶
func (DefaultProfile) N4Connector(remoteNode string) (AssociationConnector, error)
func (DefaultProfile) ParseOuterHeaderCreation ¶
func (DefaultProfile) ParseOuterHeaderCreation(i *ie.IE) (FarHeaderFields, error)
func (DefaultProfile) ParseSubscriberData ¶
func (DefaultProfile) ParseSubscriberData(ieArr []*ie.IE) (imsi, msisdn string)
func (DefaultProfile) SessionEstablishmentResponseAdditionalIEs ¶
func (DefaultProfile) SessionReportReleaseVendorIE ¶
func (DefaultProfile) SessionReportReleaseVendorIE(pdrList []uint16) *ie.IE
func (DefaultProfile) SxaConnector ¶
func (DefaultProfile) SxaConnector(remoteNode string) (AssociationConnector, error)
func (DefaultProfile) SxbConnector ¶
func (DefaultProfile) SxbConnector(remoteNode string) (AssociationConnector, error)
func (DefaultProfile) UsageReportADCVendorIEs ¶
func (DefaultProfile) UsageReportADCVendorIEs(sdfFilter string) []*ie.IE
func (DefaultProfile) UsageReportDeletionVendorIEs ¶
func (DefaultProfile) UsageReportDeletionVendorIEs() []*ie.IE
func (DefaultProfile) UsageReportSessionReportVendorIEs ¶
func (DefaultProfile) UsageReportSessionReportVendorIEs() []*ie.IE
type FarHeaderFields ¶
type FarHeaderFields struct {
// OuterHeaderCreation is the pre-computed ebpf.FarInfo.OuterHeaderCreation
// value (profile-specific bit transformation of Description).
OuterHeaderCreation uint8
// Description is the raw OuterHeaderCreationDescription for display.
Description uint16
Teid uint32
IPv4Address net.IP
IPv6Address net.IP
PortNumber uint16
CTag uint32
STag uint32
}
FarHeaderFields is the profile-agnostic result of parsing an Outer Header Creation IE. Profiles project their dialect-specific representation into this struct so that the downstream code can map it to ebpf.FarInfo uniformly.
type GtpPathManager ¶ added in v0.6.0
type GtpPathManager struct {
// contains filtered or unexported fields
}
func NewGtpPathManager ¶ added in v0.6.0
func NewGtpPathManager(localAddress string, interval time.Duration) *GtpPathManager
func (*GtpPathManager) AddGtpPath ¶ added in v0.6.0
func (gtpPathManager *GtpPathManager) AddGtpPath(gtpPeerAddress string)
func (*GtpPathManager) Run ¶ added in v0.6.0
func (gtpPathManager *GtpPathManager) Run()
func (*GtpPathManager) Stop ¶ added in v0.6.0
func (gtpPathManager *GtpPathManager) Stop()
func (*GtpPathManager) UpdateCheckTicker ¶
func (gtpPathManager *GtpPathManager) UpdateCheckTicker(newTicker *time.Ticker)
func (*GtpPathManager) UpdateGtpPath ¶
func (gtpPathManager *GtpPathManager) UpdateGtpPath(gtpPeerAddresses []string)
func (*GtpPathManager) UpdateLocalAddress ¶
func (gtpPathManager *GtpPathManager) UpdateLocalAddress(newLocalAddress string)
type HuaweiProfile ¶
HuaweiProfile implements the Huawei SPGW-C PFCP dialect. It uses Huawei's Outer Header Creation encoding, enterprise-specific IEs for subscriber data and QFI, Huawei Node ID format, session-level URR sequence numbering, and a vendor-specific IE in usage reports.
func (HuaweiProfile) HeartbeatRequestAdditionalIEs ¶
func (h HuaweiProfile) HeartbeatRequestAdditionalIEs() []*ie.IE
func (HuaweiProfile) N4Connector ¶
func (h HuaweiProfile) N4Connector(remoteNode string) (AssociationConnector, error)
func (HuaweiProfile) ParseOuterHeaderCreation ¶
func (h HuaweiProfile) ParseOuterHeaderCreation(i *ie.IE) (FarHeaderFields, error)
func (HuaweiProfile) ParseSubscriberData ¶
func (h HuaweiProfile) ParseSubscriberData(ieArr []*ie.IE) (imsi, msisdn string)
func (HuaweiProfile) SessionEstablishmentResponseAdditionalIEs ¶
func (HuaweiProfile) SessionReportReleaseVendorIE ¶
func (h HuaweiProfile) SessionReportReleaseVendorIE(pdrList []uint16) *ie.IE
func (HuaweiProfile) SxaConnector ¶
func (h HuaweiProfile) SxaConnector(remoteNode string) (AssociationConnector, error)
func (HuaweiProfile) SxbConnector ¶
func (h HuaweiProfile) SxbConnector(remoteNode string) (AssociationConnector, error)
func (HuaweiProfile) UsageReportADCVendorIEs ¶
func (h HuaweiProfile) UsageReportADCVendorIEs(sdfFilter string) []*ie.IE
func (HuaweiProfile) UsageReportDeletionVendorIEs ¶
func (h HuaweiProfile) UsageReportDeletionVendorIEs() []*ie.IE
func (HuaweiProfile) UsageReportSessionReportVendorIEs ¶
func (h HuaweiProfile) UsageReportSessionReportVendorIEs() []*ie.IE
type NeValidator ¶
type NeValidator struct {
// contains filtered or unexported fields
}
func NewNeValidator ¶
func NewNeValidator(allowed string, denied string) (*NeValidator, error)
func (*NeValidator) IsNeAllowed ¶
func (v *NeValidator) IsNeAllowed(networkInstance string) bool
func (*NeValidator) IsNeDenied ¶
func (v *NeValidator) IsNeDenied(networkInstance string) bool
func (*NeValidator) Validate ¶
func (v *NeValidator) Validate(networkInstance string) bool
type NodeAssociation ¶
type NodeAssociation struct {
ID string
Addr string
NextSessionID uint64
NextSequenceID uint32
Sessions map[uint64]*Session
HeartbeatChannel chan uint32 `json:"-"`
HeartbeatsActive bool
sync.Mutex `json:"-"`
HeartbeatTimeout *time.Timer
// contains filtered or unexported fields
}
func NewNodeAssociation ¶ added in v0.3.3
func NewNodeAssociation(remoteNodeID string, addr string) *NodeAssociation
func (*NodeAssociation) Close ¶
func (association *NodeAssociation) Close()
func (*NodeAssociation) HandleHeartbeat ¶ added in v0.6.1
func (association *NodeAssociation) HandleHeartbeat(sequence uint32)
func (*NodeAssociation) NewLocalSEID ¶
func (association *NodeAssociation) NewLocalSEID() uint64
func (*NodeAssociation) NewSequenceID ¶ added in v0.3.5
func (association *NodeAssociation) NewSequenceID() uint32
func (*NodeAssociation) ScheduleHeartbeat ¶ added in v0.6.1
func (association *NodeAssociation) ScheduleHeartbeat(conn *PfcpConnection)
type OperationPool ¶
type OperationPool struct {
// contains filtered or unexported fields
}
func NewOperationPool ¶
func NewOperationPool() *OperationPool
func (*OperationPool) Add ¶
func (op *OperationPool) Add(operation Operation)
func (*OperationPool) Commit ¶
func (op *OperationPool) Commit() error
func (*OperationPool) Rollback ¶
func (op *OperationPool) Rollback()
type OuterHeaderCreationFields ¶
type OuterHeaderCreationFields struct {
OuterHeaderCreationDescription uint16
TEID uint32
IPv4Address net.IP
IPv6Address net.IP
PortNumber uint16
CTag uint32
STag uint32
}
OuterHeaderCreationFields represents a fields contained in OuterHeaderCreation IE.
func HuaweiOuterHeaderCreation ¶
func HuaweiOuterHeaderCreation(i *ie.IE) (*OuterHeaderCreationFields, error)
HuaweiOuterHeaderCreation extracts OuterHeaderCreationFields from the given IE using the Huawei SPGW-C dialect of Outer Header Creation encoding.
func NewOuterHeaderCreationFields ¶
func NewOuterHeaderCreationFields(desc uint16, teid uint32, v4, v6 string, port uint16, ctag, stag uint32) *OuterHeaderCreationFields
NewOuterHeaderCreationFields creates a new OuterHeaderCreationFields.
func ParseOuterHeaderCreationFields ¶
func ParseOuterHeaderCreationFields(b []byte) (*OuterHeaderCreationFields, error)
ParseOuterHeaderCreationFields parses b into OuterHeaderCreationFields.
func (*OuterHeaderCreationFields) HasCTag ¶
func (f *OuterHeaderCreationFields) HasCTag() bool
HasCTag reports wether C-TAG field is set.
func (*OuterHeaderCreationFields) HasIPv4 ¶
func (f *OuterHeaderCreationFields) HasIPv4() bool
HasIPv4 reports wether IPv4 Address field is set.
func (*OuterHeaderCreationFields) HasIPv6 ¶
func (f *OuterHeaderCreationFields) HasIPv6() bool
HasIPv6 reports wether IPv6 Address field is set.
func (*OuterHeaderCreationFields) HasPortNumber ¶
func (f *OuterHeaderCreationFields) HasPortNumber() bool
HasPortNumber reports wether Port Number field is set.
func (*OuterHeaderCreationFields) HasSTag ¶
func (f *OuterHeaderCreationFields) HasSTag() bool
HasSTag reports wether S-TAG field is set.
func (*OuterHeaderCreationFields) HasTEID ¶
func (f *OuterHeaderCreationFields) HasTEID() bool
HasTEID reports wether TEID field is set.
func (*OuterHeaderCreationFields) IsLLSSMCTEID ¶
func (f *OuterHeaderCreationFields) IsLLSSMCTEID() bool
IsLLSSMCTEID reports wether Outer Header Creation Description has Low Layer SSM and C-TEID This bit has been introduced in release 17.2
func (*OuterHeaderCreationFields) IsN6 ¶
func (f *OuterHeaderCreationFields) IsN6() bool
IsN6 reports wether Outer Header Creation Description has N9 Indication
func (*OuterHeaderCreationFields) IsN19 ¶
func (f *OuterHeaderCreationFields) IsN19() bool
IsN19 reports wether Outer Header Creation Description has N19 Indication.
func (*OuterHeaderCreationFields) Marshal ¶
func (f *OuterHeaderCreationFields) Marshal() ([]byte, error)
Marshal returns the serialized bytes of OuterHeaderCreationFields.
func (*OuterHeaderCreationFields) MarshalLen ¶
func (f *OuterHeaderCreationFields) MarshalLen() int
MarshalLen returns field length in integer.
func (*OuterHeaderCreationFields) MarshalTo ¶
func (f *OuterHeaderCreationFields) MarshalTo(b []byte) error
MarshalTo puts the byte sequence in the byte array given as b.
func (*OuterHeaderCreationFields) UnmarshalBinary ¶
func (f *OuterHeaderCreationFields) UnmarshalBinary(b []byte) error
UnmarshalBinary parses b into IE.
type PDRCreationContext ¶ added in v0.6.0
type PDRCreationContext struct {
Session *Session
ResourceManager *service.ResourceManager
TEIDCache map[uint8]uint32
}
func NewPDRCreationContext ¶ added in v0.6.0
func NewPDRCreationContext(session *Session, resourceManager *service.ResourceManager) *PDRCreationContext
type PfcpConnection ¶
type PfcpConnection struct {
NodeAssociations map[string]*NodeAssociation
RecoveryTimestamp time.Time
ResourceManager *service.ResourceManager
AssociationSetupTicker *time.Ticker
PCCRules map[string]PCCInfo
PCCRulesNameLinkURRID map[uint32][]string
// contains filtered or unexported fields
}
func NewPfcpConnection ¶ added in v0.7.0
func NewPfcpConnection( addr string, nodeId string, n3Ip string, n9Ip string, mapOperations ebpf.ForwardingPlaneController, resourceManager *service.ResourceManager, dumper utils.Dumper, sdfNotifyC <-chan ebpf.SdfFlowNotification, profile PfcpProfile, ) (*PfcpConnection, error)
func (*PfcpConnection) Close ¶
func (connection *PfcpConnection) Close()
func (*PfcpConnection) DeleteAllAssociations ¶
func (connection *PfcpConnection) DeleteAllAssociations()
func (*PfcpConnection) DeleteAssociation ¶ added in v0.3.3
func (connection *PfcpConnection) DeleteAssociation(assocAddr string)
DeleteAssociation deletes an association and all sessions associated with it.
func (*PfcpConnection) DeleteSession ¶ added in v0.3.3
func (connection *PfcpConnection) DeleteSession(session *Session)
DeleteSession deletes a session and all PDRs, FARs and QERs associated with it.
func (*PfcpConnection) DisableTracing ¶
func (connection *PfcpConnection) DisableTracing() ([]tracing.TraceRecord, error)
func (*PfcpConnection) DisableTracingByImsi ¶
func (connection *PfcpConnection) DisableTracingByImsi(imsi string) (tracing.TraceRecord, error)
func (*PfcpConnection) DisableTracingByMsisdn ¶
func (connection *PfcpConnection) DisableTracingByMsisdn(msisdn string) (tracing.TraceRecord, error)
func (*PfcpConnection) EnableTracingByImsi ¶
func (connection *PfcpConnection) EnableTracingByImsi(imsi string) error
func (*PfcpConnection) EnableTracingByMsisdn ¶
func (connection *PfcpConnection) EnableTracingByMsisdn(msisdn string) error
func (*PfcpConnection) GetAllTracingRecords ¶
func (connection *PfcpConnection) GetAllTracingRecords() ([]tracing.TraceRecord, error)
func (*PfcpConnection) GetAssiciationCount ¶ added in v0.3.6
func (connection *PfcpConnection) GetAssiciationCount() int
func (*PfcpConnection) GetAssociation ¶ added in v0.3.3
func (connection *PfcpConnection) GetAssociation(assocAddr string) *NodeAssociation
func (*PfcpConnection) GetConnAddr ¶
func (connection *PfcpConnection) GetConnAddr() string
func (*PfcpConnection) GetDumper ¶
func (connection *PfcpConnection) GetDumper() utils.Dumper
func (*PfcpConnection) GetLocalAddr ¶
func (connection *PfcpConnection) GetLocalAddr() string
func (*PfcpConnection) GetMapOperations ¶
func (connection *PfcpConnection) GetMapOperations() ebpf.ForwardingPlaneController
func (*PfcpConnection) GetN3Addr ¶
func (connection *PfcpConnection) GetN3Addr() string
func (*PfcpConnection) GetN9Addr ¶
func (connection *PfcpConnection) GetN9Addr() string
func (*PfcpConnection) GetResourceManager ¶
func (connection *PfcpConnection) GetResourceManager() *service.ResourceManager
func (*PfcpConnection) GetSessionCount ¶ added in v0.3.6
func (connection *PfcpConnection) GetSessionCount() int
func (*PfcpConnection) GetTracingRecordByImsi ¶
func (connection *PfcpConnection) GetTracingRecordByImsi(imsi string) (tracing.TraceRecord, error)
func (*PfcpConnection) GetTracingRecordByMsisdn ¶
func (connection *PfcpConnection) GetTracingRecordByMsisdn(msisdn string) (tracing.TraceRecord, error)
func (*PfcpConnection) Handle ¶
func (connection *PfcpConnection) Handle(b []byte, addr *net.UDPAddr)
func (*PfcpConnection) NeedSessionTrace ¶
func (connection *PfcpConnection) NeedSessionTrace(imsi, msisdn string) bool
func (*PfcpConnection) RefreshAssociations ¶ added in v0.3.3
func (connection *PfcpConnection) RefreshAssociations()
func (*PfcpConnection) ReleaseResources ¶ added in v0.6.0
func (connection *PfcpConnection) ReleaseResources(seID uint64)
func (*PfcpConnection) ReleaseSessionByID ¶
func (connection *PfcpConnection) ReleaseSessionByID(seid uint64) bool
func (*PfcpConnection) ReleaseSessionByUserID ¶
func (connection *PfcpConnection) ReleaseSessionByUserID(imsi string, msisdn string) bool
func (*PfcpConnection) Run ¶
func (connection *PfcpConnection) Run()
func (*PfcpConnection) SendAssociationReleaseRequest ¶
func (connection *PfcpConnection) SendAssociationReleaseRequest()
func (*PfcpConnection) SendMessage ¶
func (*PfcpConnection) SendMessageWithTrace ¶
func (*PfcpConnection) SendReports ¶
func (connection *PfcpConnection) SendReports()
func (*PfcpConnection) SendReportsSDF ¶
func (connection *PfcpConnection) SendReportsSDF(referenceID uint32, sdfFilter string)
func (*PfcpConnection) SetRemoteNodes ¶ added in v0.7.0
func (connection *PfcpConnection) SetRemoteNodes(nodes []AssociationConnector)
func (*PfcpConnection) TraceMessage ¶
func (connection *PfcpConnection) TraceMessage(b []byte, addr *net.UDPAddr, rx bool)
func (*PfcpConnection) Update ¶
func (connection *PfcpConnection) Update( pfcpAddress string, pfcpNodeId string, ) error
func (*PfcpConnection) UpdateN3Address ¶
func (connection *PfcpConnection) UpdateN3Address(n3addr net.IP)
func (*PfcpConnection) UpdateN9Address ¶
func (connection *PfcpConnection) UpdateN9Address(n9addr net.IP)
func (*PfcpConnection) ValidateNetworkInstance ¶
func (connection *PfcpConnection) ValidateNetworkInstance(networkInstance string) bool
type PfcpHandlerMap ¶
func (PfcpHandlerMap) Handle ¶
func (handlerMap PfcpHandlerMap) Handle(conn *PfcpConnection, buf []byte, addr *net.UDPAddr) error
type PfcpProfile ¶
type PfcpProfile interface {
// SxaConnector builds the AssociationConnector for an Sxa (S1U/S5S8) peer.
SxaConnector(remoteNode string) (AssociationConnector, error)
// SxbConnector builds the AssociationConnector for an Sxb (PA) peer.
SxbConnector(remoteNode string) (AssociationConnector, error)
// N4Connector builds the AssociationConnector for an N4 (5G SMF) peer.
// Both profiles use NewDefaultAssociationConnector (N4 is always
// standard 3GPP), but the method exists for symmetry with
// SxaConnector/SxbConnector.
N4Connector(remoteNode string) (AssociationConnector, error)
// ParseOuterHeaderCreation extracts FarHeaderFields from an Outer Header
// Creation IE (or a wrapping ForwardingParameters/UpdateForwardingParameters
// IE) according to the profile's dialect.
ParseOuterHeaderCreation(i *ie.IE) (FarHeaderFields, error)
// ParseSubscriberData extracts IMSI and MSISDN from enterprise-specific
// IEs if the profile supports them. Returns empty strings otherwise.
ParseSubscriberData(ieArr []*ie.IE) (imsi, msisdn string)
// ParseQFI extracts the QoS Flow Identifier from a QER IE. Returns false
// if the QFI could not be determined.
ParseQFI(qer *ie.IE) (uint8, bool)
// NodeID encodes a Node ID IE for every PFCP message that carries one
// (Association Setup/Update, Session Establishment Response, etc.).
NodeID(nodeID string) *ie.IE
// URSEQN builds a URSEQN IE for usage reports. The profile decides whether
// to use the session-level sequence (Huawei) or the per-URR report sequence
// (standard 3GPP).
URSEQN(sessionSeq, reportSeq uint32) *ie.IE
// HeartbeatRequestAdditionalIEs returns extra IEs to append to PFCP
// Heartbeat Request messages, or nil if none. HuaweiProfile adds
// ie.NewMetric(25); DefaultProfile adds none.
HeartbeatRequestAdditionalIEs() []*ie.IE
// SessionEstablishmentResponseAdditionalIEs returns extra IEs to append
// to the Session Establishment Response after the standard IEs, or nil.
// HuaweiProfile adds a second FSEID with a profile-specific IP;
// DefaultProfile adds none.
SessionEstablishmentResponseAdditionalIEs(localSEID uint64, nodeAddrV4 net.IP) []*ie.IE
// UsageReportDeletionVendorIEs returns vendor-specific IEs for the
// Usage Report within Session Deletion Response, or nil.
// HuaweiProfile returns Huawei enterprise IEs (enterprise-id 2011);
// DefaultProfile returns nil.
UsageReportDeletionVendorIEs() []*ie.IE
// UsageReportSessionReportVendorIEs returns vendor-specific IEs for
// SendSessionReportUsage (volume threshold report), or nil.
// HuaweiProfile returns Huawei enterprise IEs (enterprise-id 2011);
// DefaultProfile returns nil.
UsageReportSessionReportVendorIEs() []*ie.IE
// UsageReportADCVendorIEs returns vendor-specific IEs for
// SendSessionReportADC, or nil. sdfFilter is passed for the
// conditional 36017 IE.
// HuaweiProfile returns Huawei enterprise IEs (enterprise-id 2011);
// DefaultProfile returns nil.
UsageReportADCVendorIEs(sdfFilter string) []*ie.IE
// SessionReportReleaseVendorIE returns the vendor-specific grouped IE
// for Session Report Release (pdr-id-list), or nil. HuaweiProfile
// returns ie.NewVendorSpecificGroupedIE(32799, 2011, pdrListIE...);
// DefaultProfile returns nil.
SessionReportReleaseVendorIE(pdrList []uint16) *ie.IE
}
PfcpProfile encapsulates the dialect of PFCP interaction with a particular control plane (CP). Implementations decide how connectors are built, how IEs are parsed/encoded, and how URR sequence numbering works.
The profile is selected once at startup (see cmd/main.go) and injected into every PfcpConnection, replacing the scattered "if config.Conf.HuaweiSupport" branches that previously gated Huawei-specific behavior.
type Session ¶
type Session struct {
LocalSEID uint64
RemoteSEID uint64
IMSI string
MSISDN string
PDRs map[uint32]SPDRInfo
FARs map[uint32]SFarInfo
QERs map[uint32]SQerInfo
URRs map[uint32]SUrrInfo
URRSequence uint32
Traced bool
Is5G bool
}
func NewSession ¶ added in v0.3.3
func (*Session) GetSessionImsi ¶
func (*Session) GetSessionMsisdn ¶
func (*Session) IsSessionTraced ¶
type SxaAssociationConnector ¶
type SxaAssociationConnector struct {
// contains filtered or unexported fields
}
func NewSxaAssociationConnector ¶
func NewSxaAssociationConnector(address string, s1uAddress string, s5s8Address string) (*SxaAssociationConnector, error)
type SxbAssociationConnector ¶
type SxbAssociationConnector struct {
// contains filtered or unexported fields
}
func NewSxbAssociationConnector ¶
func NewSxbAssociationConnector(address string, paAddress string) (*SxbAssociationConnector, error)