Documentation ¶
Index ¶
- func CloseAllObjects(closers ...io.Closer) error
- func Copy16Ip[T ~[]byte](arr T) [16]byte
- func IncreaseResourceLimits() error
- func LoadAllObjects(opts *ebpf.CollectionOptions, loaders ...Loader) error
- func ResizeEbpfMap(eMap **ebpf.Map, eProg *ebpf.Program, newSize uint32) error
- type BpfMapProgArrayMember
- type BpfObjects
- func (bpfObjects *BpfObjects) Close() error
- func (bpfObjects *BpfObjects) DeleteDownlinkPdrIp6(ipv6 net.IP) error
- func (bpfObjects *BpfObjects) DeleteFar(intenalId uint32) error
- func (bpfObjects *BpfObjects) DeletePdrDownlink(ipv4 net.IP) error
- func (bpfObjects *BpfObjects) DeletePdrUplink(teid uint32) error
- func (bpfObjects *BpfObjects) DeleteQer(internalId uint32) error
- func (bpfObjects *BpfObjects) Load() error
- func (bpfObjects *BpfObjects) NewFar(farInfo FarInfo) (uint32, error)
- func (bpfObjects *BpfObjects) NewQer(qerInfo QerInfo) (uint32, error)
- func (bpfObjects *BpfObjects) PutDownlinkPdrIp6(ipv6 net.IP, pdrInfo PdrInfo) error
- func (bpfObjects *BpfObjects) PutPdrDownlink(ipv4 net.IP, pdrInfo PdrInfo) error
- func (bpfObjects *BpfObjects) PutPdrUplink(teid uint32, pdrInfo PdrInfo) error
- func (bpfObjects *BpfObjects) ResizeAllMaps(qerMapSize uint32, farMapSize uint32, pdrMapSize uint32) error
- func (bpfObjects *BpfObjects) UpdateDownlinkPdrIp6(ipv6 net.IP, pdrInfo PdrInfo) error
- func (bpfObjects *BpfObjects) UpdateFar(internalId uint32, farInfo FarInfo) error
- func (bpfObjects *BpfObjects) UpdatePdrDownlink(ipv4 net.IP, pdrInfo PdrInfo) error
- func (bpfObjects *BpfObjects) UpdatePdrUplink(teid uint32, pdrInfo PdrInfo) error
- func (bpfObjects *BpfObjects) UpdateQer(internalId uint32, qerInfo QerInfo) error
- type FarInfo
- type ForwardingPlaneController
- type IdTracker
- type IpWMask
- type Loader
- type LoaderFunc
- type PdrInfo
- type PortRange
- type QerInfo
- type QerMapElement
- type SdfFilter
- type UpfCounters
- type UpfStatistic
- type UpfXdpActionStatistic
- func (stat *UpfXdpActionStatistic) GetAborted() uint64
- func (stat *UpfXdpActionStatistic) GetDrop() uint64
- func (stat *UpfXdpActionStatistic) GetPass() uint64
- func (stat *UpfXdpActionStatistic) GetRedirect() uint64
- func (stat *UpfXdpActionStatistic) GetTx() uint64
- func (stat *UpfXdpActionStatistic) GetUpfExtStatField() UpfCounters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseAllObjects ¶
func IncreaseResourceLimits ¶
func IncreaseResourceLimits() error
IncreaseResourceLimits https://prototype-kernel.readthedocs.io/en/latest/bpf/troubleshooting.html#memory-ulimits
func LoadAllObjects ¶
func LoadAllObjects(opts *ebpf.CollectionOptions, loaders ...Loader) error
Types ¶
type BpfMapProgArrayMember ¶
type BpfMapProgArrayMember struct { ProgramId uint32 `json:"id"` ProgramRef uint32 `json:"fd"` ProgramName string `json:"name"` ProgramRunCount uint32 `json:"run_count"` ProgramRunCountEnabled bool `json:"run_count_enabled"` ProgramDuration uint32 `json:"duration"` ProgramDurationEnabled bool `json:"duration_enabled"` }
https://man7.org/linux/man-pages/man2/bpf.2.html A program array map is a special kind of array map whose map values contain only file descriptors referring to other eBPF programs. Thus, both the key_size and value_size must be exactly four bytes.
func ListMapProgArrayContents ¶
func ListMapProgArrayContents(m *ebpf.Map) ([]BpfMapProgArrayMember, error)
type BpfObjects ¶
func NewBpfObjects ¶
func NewBpfObjects() *BpfObjects
func (*BpfObjects) Close ¶
func (bpfObjects *BpfObjects) Close() error
func (*BpfObjects) DeleteDownlinkPdrIp6 ¶
func (bpfObjects *BpfObjects) DeleteDownlinkPdrIp6(ipv6 net.IP) error
func (*BpfObjects) DeleteFar ¶
func (bpfObjects *BpfObjects) DeleteFar(intenalId uint32) error
func (*BpfObjects) DeletePdrDownlink ¶ added in v0.6.0
func (bpfObjects *BpfObjects) DeletePdrDownlink(ipv4 net.IP) error
func (*BpfObjects) DeletePdrUplink ¶ added in v0.6.0
func (bpfObjects *BpfObjects) DeletePdrUplink(teid uint32) error
func (*BpfObjects) DeleteQer ¶
func (bpfObjects *BpfObjects) DeleteQer(internalId uint32) error
func (*BpfObjects) Load ¶
func (bpfObjects *BpfObjects) Load() error
func (*BpfObjects) PutDownlinkPdrIp6 ¶
func (bpfObjects *BpfObjects) PutDownlinkPdrIp6(ipv6 net.IP, pdrInfo PdrInfo) error
func (*BpfObjects) PutPdrDownlink ¶ added in v0.6.0
func (bpfObjects *BpfObjects) PutPdrDownlink(ipv4 net.IP, pdrInfo PdrInfo) error
func (*BpfObjects) PutPdrUplink ¶ added in v0.6.0
func (bpfObjects *BpfObjects) PutPdrUplink(teid uint32, pdrInfo PdrInfo) error
func (*BpfObjects) ResizeAllMaps ¶
func (bpfObjects *BpfObjects) ResizeAllMaps(qerMapSize uint32, farMapSize uint32, pdrMapSize uint32) error
func (*BpfObjects) UpdateDownlinkPdrIp6 ¶
func (bpfObjects *BpfObjects) UpdateDownlinkPdrIp6(ipv6 net.IP, pdrInfo PdrInfo) error
func (*BpfObjects) UpdateFar ¶
func (bpfObjects *BpfObjects) UpdateFar(internalId uint32, farInfo FarInfo) error
func (*BpfObjects) UpdatePdrDownlink ¶ added in v0.6.0
func (bpfObjects *BpfObjects) UpdatePdrDownlink(ipv4 net.IP, pdrInfo PdrInfo) error
func (*BpfObjects) UpdatePdrUplink ¶ added in v0.6.0
func (bpfObjects *BpfObjects) UpdatePdrUplink(teid uint32, pdrInfo PdrInfo) error
type FarInfo ¶
type FarInfo struct { Action uint8 OuterHeaderCreation uint8 Teid uint32 RemoteIP uint32 LocalIP uint32 TransportLevelMarking uint16 }
func (FarInfo) MarshalJSON ¶
type ForwardingPlaneController ¶
type ForwardingPlaneController interface { PutPdrUplink(teid uint32, pdrInfo PdrInfo) error PutPdrDownlink(ipv4 net.IP, pdrInfo PdrInfo) error UpdatePdrUplink(teid uint32, pdrInfo PdrInfo) error UpdatePdrDownlink(ipv4 net.IP, pdrInfo PdrInfo) error DeletePdrUplink(teid uint32) error DeletePdrDownlink(ipv4 net.IP) error PutDownlinkPdrIp6(ipv6 net.IP, pdrInfo PdrInfo) error UpdateDownlinkPdrIp6(ipv6 net.IP, pdrInfo PdrInfo) error DeleteDownlinkPdrIp6(ipv6 net.IP) error NewFar(farInfo FarInfo) (uint32, error) UpdateFar(internalId uint32, farInfo FarInfo) error DeleteFar(internalId uint32) error NewQer(qerInfo QerInfo) (uint32, error) UpdateQer(internalId uint32, qerInfo QerInfo) error DeleteQer(internalId uint32) error }
type IdTracker ¶
type IdTracker struct {
// contains filtered or unexported fields
}
func NewIdTracker ¶
type Loader ¶
type Loader struct { LoaderFunc // contains filtered or unexported fields }
type LoaderFunc ¶
type LoaderFunc func(obj interface{}, opts *ebpf.CollectionOptions) error
type QerMapElement ¶
type QerMapElement struct { Id uint32 `json:"id"` GateStatusUL uint8 `json:"gate_status_ul"` GateStatusDL uint8 `json:"gate_status_dl"` Qfi uint8 `json:"qfi"` MaxBitrateUL uint32 `json:"max_bitrate_ul"` MaxBitrateDL uint32 `json:"max_bitrate_dl"` }
func ListQerMapContents ¶
func ListQerMapContents(m *ebpf.Map) ([]QerMapElement, error)
type SdfFilter ¶ added in v0.5.0
type UpfCounters ¶
type UpfCounters struct { RxArp uint64 RxIcmp uint64 RxIcmp6 uint64 RxIp4 uint64 RxIp6 uint64 RxTcp uint64 RxUdp uint64 RxOther uint64 RxGtpEcho uint64 RxGtpPdu uint64 RxGtpOther uint64 RxGtpUnexp uint64 }
func (*UpfCounters) Add ¶
func (current *UpfCounters) Add(new UpfCounters)
type UpfStatistic ¶
type UpfStatistic struct { Counters UpfCounters XdpStats [5]uint64 }
type UpfXdpActionStatistic ¶
type UpfXdpActionStatistic struct {
BpfObjects *BpfObjects
}
func (*UpfXdpActionStatistic) GetAborted ¶
func (stat *UpfXdpActionStatistic) GetAborted() uint64
func (*UpfXdpActionStatistic) GetDrop ¶
func (stat *UpfXdpActionStatistic) GetDrop() uint64
func (*UpfXdpActionStatistic) GetPass ¶
func (stat *UpfXdpActionStatistic) GetPass() uint64
func (*UpfXdpActionStatistic) GetRedirect ¶
func (stat *UpfXdpActionStatistic) GetRedirect() uint64
func (*UpfXdpActionStatistic) GetTx ¶
func (stat *UpfXdpActionStatistic) GetTx() uint64
func (*UpfXdpActionStatistic) GetUpfExtStatField ¶
func (stat *UpfXdpActionStatistic) GetUpfExtStatField() UpfCounters
Getters for the upf_ext_stat (upf_counters) #TODO: Do not retrieve the whole struct each time.
Click to show internal directories.
Click to hide internal directories.