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 LoadN3Entrypoint() (*ebpf.CollectionSpec, error)
- func LoadN3EntrypointObjects(obj interface{}, opts *ebpf.CollectionOptions) error
- func LoadN6Entrypoint() (*ebpf.CollectionSpec, error)
- func LoadN6EntrypointObjects(obj interface{}, opts *ebpf.CollectionOptions) error
- type BpfObjects
- func (bpfObjects *BpfObjects) Close() error
- func (bpfObjects *BpfObjects) DeleteDownlinkPdrIP6(ipv6 net.IP) error
- func (bpfObjects *BpfObjects) DeleteFar(internalID 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) UpdateFar(internalID uint32, farInfo FarInfo) error
- func (bpfObjects *BpfObjects) UpdateQer(internalID uint32, qerInfo QerInfo) error
- type FarInfo
- type IDTracker
- type IPWMask
- type Loader
- type LoaderFunc
- type N3EntrypointFarInfo
- type N3EntrypointIn6Addr
- type N3EntrypointMapSpecs
- type N3EntrypointMaps
- type N3EntrypointN3PdrInfo
- func CombineN3PdrWithSdf(defaultPdr *N3EntrypointN3PdrInfo, sdfPdr PdrInfo) N3EntrypointN3PdrInfo
- func PreprocessN3PdrWithSdf(lookup func(interface{}, interface{}) error, key interface{}, pdrInfo PdrInfo) (N3EntrypointN3PdrInfo, error)
- func ToN3EntrypointPdrInfo(defaultPdr PdrInfo) N3EntrypointN3PdrInfo
- type N3EntrypointObjects
- type N3EntrypointProgramSpecs
- type N3EntrypointPrograms
- type N3EntrypointQerInfo
- type N3EntrypointRouteStat
- type N3EntrypointSpecs
- type N3EntrypointUpfN3Statistic
- type N3EntrypointVariableSpecs
- type N3EntrypointVariables
- type N6EntrypointFarInfo
- type N6EntrypointIn6Addr
- type N6EntrypointMapSpecs
- type N6EntrypointMaps
- type N6EntrypointObjects
- type N6EntrypointPdrInfo
- type N6EntrypointProgramSpecs
- type N6EntrypointPrograms
- type N6EntrypointQerInfo
- type N6EntrypointRouteStat
- type N6EntrypointSpecs
- type N6EntrypointUpfN6Statistic
- type N6EntrypointVariableSpecs
- type N6EntrypointVariables
- type PdrInfo
- type PortRange
- type QerInfo
- type SdfFilter
- type UpfN3Counters
- type UpfStatistic
- type UpfXdpActionStatistic
- func (stat *UpfXdpActionStatistic) GetN3Aborted() uint64
- func (stat *UpfXdpActionStatistic) GetN3Drop() uint64
- func (stat *UpfXdpActionStatistic) GetN3Pass() uint64
- func (stat *UpfXdpActionStatistic) GetN3Redirect() uint64
- func (stat *UpfXdpActionStatistic) GetN3Tx() uint64
- func (stat *UpfXdpActionStatistic) GetN3UplinkThroughputStats() uint64
- func (stat *UpfXdpActionStatistic) GetN6Aborted() uint64
- func (stat *UpfXdpActionStatistic) GetN6DownlinkThroughputStats() uint64
- func (stat *UpfXdpActionStatistic) GetN6Drop() uint64
- func (stat *UpfXdpActionStatistic) GetN6Redirect() uint64
- func (stat *UpfXdpActionStatistic) GetN6Tx() uint64
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
func LoadN3Entrypoint ¶
func LoadN3Entrypoint() (*ebpf.CollectionSpec, error)
LoadN3Entrypoint returns the embedded CollectionSpec for N3Entrypoint.
func LoadN3EntrypointObjects ¶
func LoadN3EntrypointObjects(obj interface{}, opts *ebpf.CollectionOptions) error
LoadN3EntrypointObjects loads N3Entrypoint and converts it into a struct.
The following types are suitable as obj argument:
*N3EntrypointObjects *N3EntrypointPrograms *N3EntrypointMaps
See ebpf.CollectionSpec.LoadAndAssign documentation for details.
func LoadN6Entrypoint ¶
func LoadN6Entrypoint() (*ebpf.CollectionSpec, error)
LoadN6Entrypoint returns the embedded CollectionSpec for N6Entrypoint.
func LoadN6EntrypointObjects ¶
func LoadN6EntrypointObjects(obj interface{}, opts *ebpf.CollectionOptions) error
LoadN6EntrypointObjects loads N6Entrypoint and converts it into a struct.
The following types are suitable as obj argument:
*N6EntrypointObjects *N6EntrypointPrograms *N6EntrypointMaps
See ebpf.CollectionSpec.LoadAndAssign documentation for details.
Types ¶
type BpfObjects ¶
type BpfObjects struct { N3EntrypointObjects N6EntrypointObjects FarIDTracker *IDTracker QerIDTracker *IDTracker }
func NewBpfObjects ¶
func NewBpfObjects(farMapSize uint32, qerMapSize uint32) *BpfObjects
func (*BpfObjects) Close ¶
func (bpfObjects *BpfObjects) Close() error
func (*BpfObjects) DeleteDownlinkPdrIP6 ¶ added in v0.0.11
func (bpfObjects *BpfObjects) DeleteDownlinkPdrIP6(ipv6 net.IP) error
func (*BpfObjects) DeleteFar ¶
func (bpfObjects *BpfObjects) DeleteFar(internalID uint32) error
func (*BpfObjects) DeletePdrDownlink ¶
func (bpfObjects *BpfObjects) DeletePdrDownlink(ipv4 net.IP) error
func (*BpfObjects) DeletePdrUplink ¶
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 ¶ added in v0.0.11
func (bpfObjects *BpfObjects) PutDownlinkPdrIP6(ipv6 net.IP, pdrInfo PdrInfo) error
func (*BpfObjects) PutPdrDownlink ¶
func (bpfObjects *BpfObjects) PutPdrDownlink(ipv4 net.IP, pdrInfo PdrInfo) error
func (*BpfObjects) PutPdrUplink ¶
func (bpfObjects *BpfObjects) PutPdrUplink(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 IDTracker ¶ added in v0.0.11
type IDTracker struct {
// contains filtered or unexported fields
}
func NewIDTracker ¶ added in v0.0.11
type Loader ¶
type Loader struct { LoaderFunc // contains filtered or unexported fields }
type LoaderFunc ¶
type LoaderFunc func(obj interface{}, opts *ebpf.CollectionOptions) error
type N3EntrypointFarInfo ¶ added in v0.0.8
type N3EntrypointIn6Addr ¶ added in v0.0.8
type N3EntrypointIn6Addr struct{ In6U struct{ U6Addr8 [16]uint8 } }
type N3EntrypointMapSpecs ¶
type N3EntrypointMapSpecs struct { FarMap *ebpf.MapSpec `ebpf:"far_map"` N3PdrMapDownlinkIp4 *ebpf.MapSpec `ebpf:"n3_pdr_map_downlink_ip4"` N3PdrMapDownlinkIp6 *ebpf.MapSpec `ebpf:"n3_pdr_map_downlink_ip6"` N3PdrMapUplinkIp4 *ebpf.MapSpec `ebpf:"n3_pdr_map_uplink_ip4"` QerMap *ebpf.MapSpec `ebpf:"qer_map"` UpfN3Stat *ebpf.MapSpec `ebpf:"upf_n3_stat"` UpfRouteStat *ebpf.MapSpec `ebpf:"upf_route_stat"` }
N3EntrypointMapSpecs contains maps before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type N3EntrypointMaps ¶
type N3EntrypointMaps struct { FarMap *ebpf.Map `ebpf:"far_map"` N3PdrMapDownlinkIp4 *ebpf.Map `ebpf:"n3_pdr_map_downlink_ip4"` N3PdrMapDownlinkIp6 *ebpf.Map `ebpf:"n3_pdr_map_downlink_ip6"` N3PdrMapUplinkIp4 *ebpf.Map `ebpf:"n3_pdr_map_uplink_ip4"` QerMap *ebpf.Map `ebpf:"qer_map"` UpfN3Stat *ebpf.Map `ebpf:"upf_n3_stat"` UpfRouteStat *ebpf.Map `ebpf:"upf_route_stat"` }
N3EntrypointMaps contains all maps after they have been loaded into the kernel.
It can be passed to LoadN3EntrypointObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*N3EntrypointMaps) Close ¶
func (m *N3EntrypointMaps) Close() error
type N3EntrypointN3PdrInfo ¶ added in v0.0.8
type N3EntrypointN3PdrInfo struct { FarId uint32 QerId uint32 OuterHeaderRemoval uint8 SdfMode uint8 N3SdfRules struct { N3SdfFilter struct { Protocol uint8 SrcAddr struct { Type uint8 Ip [16]byte /* uint128 */ Mask [16]byte /* uint128 */ // contains filtered or unexported fields } SrcPort struct { LowerBound uint16 UpperBound uint16 } DstAddr struct { Type uint8 Ip [16]byte /* uint128 */ Mask [16]byte /* uint128 */ // contains filtered or unexported fields } DstPort struct { LowerBound uint16 UpperBound uint16 } // contains filtered or unexported fields } OuterHeaderRemoval uint8 FarId uint32 QerId uint32 // contains filtered or unexported fields } // contains filtered or unexported fields }
func CombineN3PdrWithSdf ¶ added in v0.0.8
func CombineN3PdrWithSdf(defaultPdr *N3EntrypointN3PdrInfo, sdfPdr PdrInfo) N3EntrypointN3PdrInfo
func PreprocessN3PdrWithSdf ¶ added in v0.0.8
func PreprocessN3PdrWithSdf(lookup func(interface{}, interface{}) error, key interface{}, pdrInfo PdrInfo) (N3EntrypointN3PdrInfo, error)
func ToN3EntrypointPdrInfo ¶ added in v0.0.8
func ToN3EntrypointPdrInfo(defaultPdr PdrInfo) N3EntrypointN3PdrInfo
type N3EntrypointObjects ¶
type N3EntrypointObjects struct { N3EntrypointPrograms N3EntrypointMaps N3EntrypointVariables }
N3EntrypointObjects contains all objects after they have been loaded into the kernel.
It can be passed to LoadN3EntrypointObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*N3EntrypointObjects) Close ¶
func (o *N3EntrypointObjects) Close() error
type N3EntrypointProgramSpecs ¶
type N3EntrypointProgramSpecs struct {
UpfN3EntrypointFunc *ebpf.ProgramSpec `ebpf:"upf_n3_entrypoint_func"`
}
N3EntrypointProgramSpecs contains programs before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type N3EntrypointPrograms ¶
type N3EntrypointPrograms struct {
UpfN3EntrypointFunc *ebpf.Program `ebpf:"upf_n3_entrypoint_func"`
}
N3EntrypointPrograms contains all programs after they have been loaded into the kernel.
It can be passed to LoadN3EntrypointObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*N3EntrypointPrograms) Close ¶
func (p *N3EntrypointPrograms) Close() error
type N3EntrypointQerInfo ¶ added in v0.0.8
type N3EntrypointRouteStat ¶ added in v0.0.8
type N3EntrypointSpecs ¶
type N3EntrypointSpecs struct { N3EntrypointProgramSpecs N3EntrypointMapSpecs N3EntrypointVariableSpecs }
N3EntrypointSpecs contains maps and programs before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type N3EntrypointUpfN3Statistic ¶ added in v0.0.8
type N3EntrypointVariableSpecs ¶ added in v0.0.7
type N3EntrypointVariableSpecs struct { }
N3EntrypointVariableSpecs contains global variables before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type N3EntrypointVariables ¶ added in v0.0.7
type N3EntrypointVariables struct { }
N3EntrypointVariables contains all global variables after they have been loaded into the kernel.
It can be passed to LoadN3EntrypointObjects or ebpf.CollectionSpec.LoadAndAssign.
type N6EntrypointFarInfo ¶ added in v0.0.8
type N6EntrypointIn6Addr ¶ added in v0.0.8
type N6EntrypointIn6Addr struct{ In6U struct{ U6Addr8 [16]uint8 } }
type N6EntrypointMapSpecs ¶
type N6EntrypointMapSpecs struct { FarMap *ebpf.MapSpec `ebpf:"far_map"` PdrMapDownlinkIp4 *ebpf.MapSpec `ebpf:"pdr_map_downlink_ip4"` PdrMapDownlinkIp6 *ebpf.MapSpec `ebpf:"pdr_map_downlink_ip6"` PdrMapUplinkIp4 *ebpf.MapSpec `ebpf:"pdr_map_uplink_ip4"` QerMap *ebpf.MapSpec `ebpf:"qer_map"` UpfN6Stat *ebpf.MapSpec `ebpf:"upf_n6_stat"` UpfRouteStat *ebpf.MapSpec `ebpf:"upf_route_stat"` }
N6EntrypointMapSpecs contains maps before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type N6EntrypointMaps ¶
type N6EntrypointMaps struct { FarMap *ebpf.Map `ebpf:"far_map"` PdrMapDownlinkIp4 *ebpf.Map `ebpf:"pdr_map_downlink_ip4"` PdrMapDownlinkIp6 *ebpf.Map `ebpf:"pdr_map_downlink_ip6"` PdrMapUplinkIp4 *ebpf.Map `ebpf:"pdr_map_uplink_ip4"` QerMap *ebpf.Map `ebpf:"qer_map"` UpfN6Stat *ebpf.Map `ebpf:"upf_n6_stat"` UpfRouteStat *ebpf.Map `ebpf:"upf_route_stat"` }
N6EntrypointMaps contains all maps after they have been loaded into the kernel.
It can be passed to LoadN6EntrypointObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*N6EntrypointMaps) Close ¶
func (m *N6EntrypointMaps) Close() error
type N6EntrypointObjects ¶
type N6EntrypointObjects struct { N6EntrypointPrograms N6EntrypointMaps N6EntrypointVariables }
N6EntrypointObjects contains all objects after they have been loaded into the kernel.
It can be passed to LoadN6EntrypointObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*N6EntrypointObjects) Close ¶
func (o *N6EntrypointObjects) Close() error
type N6EntrypointPdrInfo ¶ added in v0.0.8
type N6EntrypointPdrInfo struct { FarId uint32 QerId uint32 OuterHeaderRemoval uint8 SdfMode uint8 SdfRules struct { SdfFilter struct { Protocol uint8 SrcAddr struct { Type uint8 Ip [16]byte /* uint128 */ Mask [16]byte /* uint128 */ // contains filtered or unexported fields } SrcPort struct { LowerBound uint16 UpperBound uint16 } DstAddr struct { Type uint8 Ip [16]byte /* uint128 */ Mask [16]byte /* uint128 */ // contains filtered or unexported fields } DstPort struct { LowerBound uint16 UpperBound uint16 } // contains filtered or unexported fields } OuterHeaderRemoval uint8 FarId uint32 QerId uint32 // contains filtered or unexported fields } // contains filtered or unexported fields }
func CombineN6PdrWithSdf ¶ added in v0.0.8
func CombineN6PdrWithSdf(defaultPdr *N6EntrypointPdrInfo, sdfPdr PdrInfo) N6EntrypointPdrInfo
func PreprocessN6PdrWithSdf ¶ added in v0.0.8
func PreprocessN6PdrWithSdf(lookup func(interface{}, interface{}) error, key interface{}, pdrInfo PdrInfo) (N6EntrypointPdrInfo, error)
func ToN6EntrypointPdrInfo ¶ added in v0.0.8
func ToN6EntrypointPdrInfo(defaultPdr PdrInfo) N6EntrypointPdrInfo
type N6EntrypointProgramSpecs ¶
type N6EntrypointProgramSpecs struct {
UpfN6EntrypointFunc *ebpf.ProgramSpec `ebpf:"upf_n6_entrypoint_func"`
}
N6EntrypointProgramSpecs contains programs before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type N6EntrypointPrograms ¶
type N6EntrypointPrograms struct {
UpfN6EntrypointFunc *ebpf.Program `ebpf:"upf_n6_entrypoint_func"`
}
N6EntrypointPrograms contains all programs after they have been loaded into the kernel.
It can be passed to LoadN6EntrypointObjects or ebpf.CollectionSpec.LoadAndAssign.
func (*N6EntrypointPrograms) Close ¶
func (p *N6EntrypointPrograms) Close() error
type N6EntrypointQerInfo ¶ added in v0.0.8
type N6EntrypointRouteStat ¶ added in v0.0.8
type N6EntrypointSpecs ¶
type N6EntrypointSpecs struct { N6EntrypointProgramSpecs N6EntrypointMapSpecs N6EntrypointVariableSpecs }
N6EntrypointSpecs contains maps and programs before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type N6EntrypointUpfN6Statistic ¶ added in v0.0.8
type N6EntrypointVariableSpecs ¶ added in v0.0.7
type N6EntrypointVariableSpecs struct { }
N6EntrypointVariableSpecs contains global variables before they are loaded into the kernel.
It can be passed ebpf.CollectionSpec.Assign.
type N6EntrypointVariables ¶ added in v0.0.7
type N6EntrypointVariables struct { }
N6EntrypointVariables contains all global variables after they have been loaded into the kernel.
It can be passed to LoadN6EntrypointObjects or ebpf.CollectionSpec.LoadAndAssign.
type SdfFilter ¶
type UpfN3Counters ¶ added in v0.0.8
type UpfStatistic ¶
type UpfStatistic struct { N3Counters UpfN3Counters XdpStats [5]uint64 }
type UpfXdpActionStatistic ¶
type UpfXdpActionStatistic struct {
BpfObjects *BpfObjects
}
func (*UpfXdpActionStatistic) GetN3Aborted ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN3Aborted() uint64
func (*UpfXdpActionStatistic) GetN3Drop ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN3Drop() uint64
func (*UpfXdpActionStatistic) GetN3Pass ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN3Pass() uint64
func (*UpfXdpActionStatistic) GetN3Redirect ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN3Redirect() uint64
func (*UpfXdpActionStatistic) GetN3Tx ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN3Tx() uint64
func (*UpfXdpActionStatistic) GetN3UplinkThroughputStats ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN3UplinkThroughputStats() uint64
func (*UpfXdpActionStatistic) GetN6Aborted ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN6Aborted() uint64
func (*UpfXdpActionStatistic) GetN6DownlinkThroughputStats ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN6DownlinkThroughputStats() uint64
func (*UpfXdpActionStatistic) GetN6Drop ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN6Drop() uint64
func (*UpfXdpActionStatistic) GetN6Redirect ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN6Redirect() uint64
func (*UpfXdpActionStatistic) GetN6Tx ¶ added in v0.0.8
func (stat *UpfXdpActionStatistic) GetN6Tx() uint64