Documentation ¶
Index ¶
- func PingEndpoint(endpointIP string) (bool, error)
- type UsageStats
- type XDPGTP
- func (x XDPGTP) AddClient(clientIP net.IP, teid uint32, upfIP net.IP) error
- func (x XDPGTP) AddUpf(upfIP net.IP) error
- func (x XDPGTP) AttachClientFacingProgramToInterface(clientIfindex int) error
- func (x XDPGTP) AttachCommonProgramToInterface(commonIfindex int) error
- func (x XDPGTP) AttachUpfFacingProgramToInterface(upfIfindex int) error
- func (x XDPGTP) ClientIsRegistered(clientIP net.IP) bool
- func (x XDPGTP) Close() error
- func (x XDPGTP) DetachProgramFromInterface(ifindex int) error
- func (x XDPGTP) GetClients() ([]net.IP, []uint32, []net.IP)
- func (x XDPGTP) GetClientsForUpf(upfIP net.IP) []net.IP
- func (x XDPGTP) GetUpfs() []net.IP
- func (x XDPGTP) GetUsageStats() ([2]UsageStats, error)
- func (x XDPGTP) RemoveClient(clientIP net.IP) error
- func (x XDPGTP) RemoveUpf(upfIP net.IP) error
- func (x XDPGTP) UpfIsRegistered(upfIP net.IP) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PingEndpoint ¶
This Function reports whether an IP address is reachable with an ICMP echo request.
Types ¶
type UsageStats ¶
type UsageStats struct { Packets uint64 // Number of packets sent since program was loaded Bytes uint64 // Number of bytes sent since program was loaded }
Struct for storing usage statistics in BPF map.
type XDPGTP ¶
type XDPGTP struct {
// contains filtered or unexported fields
}
XDPGTP holds the state of the running application.
func NewXDPGTP ¶
func NewXDPGTP(xdpFlags link.XDPAttachFlags) (*XDPGTP, error)
NewXDPGTP loads compiled eBPF programs and maps into the kernel and returns a new XDPGTP.
Users must call x.Close() to safely unload eBPF programs and maps from the kernel.
func (XDPGTP) AttachClientFacingProgramToInterface ¶
Method for attaching the client-facing eBPF program to an interface given its index.
Users must call x.DetachProgramFromInterface(ifindex) to safely detach the eBPF program.
func (XDPGTP) AttachCommonProgramToInterface ¶
Method for attaching the common eBPF program to an interface given its index.
Users must call x.DetachProgramFromInterface(ifindex) to safely detach the eBPF program.
func (XDPGTP) AttachUpfFacingProgramToInterface ¶
Method for attaching the UPF-facing eBPF program to an interface given its index.
Users must call x.DetachProgramFromInterface(ifindex) to safely detach the eBPF program.
func (XDPGTP) ClientIsRegistered ¶
ClientIsRegistered reports whether the indicated client is present in the corresponding BPF map.
func (XDPGTP) DetachProgramFromInterface ¶
Method for safely detaching an eBPF program from an interface.
func (XDPGTP) GetClients ¶ added in v0.2.1
func (XDPGTP) GetClientsForUpf ¶
GetClientsForUpf returns a net.IP slice containing all the clients' IPs which are attached to a certain UPF.
func (XDPGTP) GetUsageStats ¶
func (x XDPGTP) GetUsageStats() ([2]UsageStats, error)
Method for extracting the stats of transmitted packets in both directions (client->UPF and UPF->client).
This function returns an array of UsageStats of length 2 ([0] for client->UPF and [1] for UPF->client).
func (XDPGTP) RemoveClient ¶
Method for removing a client from the BPF map.