Documentation ¶
Index ¶
- Constants
- Variables
- func Attach(prog *ebpf.Program, device string) error
- func CreateLPMtrieKey(s string) *net.IPNet
- func CreateMap(mapType int, keySize, valueSize, maxEntries, flags, innerID uint32) (int, error)
- func DeleteElement(fd int, key unsafe.Pointer) error
- func Detach(device string) error
- func GetNextKey(fd int, key, nextKey unsafe.Pointer) error
- func LoadElf(filepath string) (*ebpf.Collection, error)
- func LookupElement(fd int, key, value unsafe.Pointer) error
- func ObjGet(pathname string) (int, error)
- func ObjPin(fd int, pathname string) error
- func PossibleCpuInit()
- func UpdateElement(fd int, key, value unsafe.Pointer, flags uint64) error
- type Fd
Constants ¶
View Source
const ( BPF_MAP_TYPE_UNSPEC = iota BPF_MAP_TYPE_HASH BPF_MAP_TYPE_ARRAY BPF_MAP_TYPE_PROG_ARRAY BPF_MAP_TYPE_PERF_EVENT_ARRAY BPF_MAP_TYPE_PERCPU_HASH BPF_MAP_TYPE_PERCPU_ARRAY BPF_MAP_TYPE_STACK_TRACE BPF_MAP_TYPE_CGROUP_ARRAY BPF_MAP_TYPE_LRU_HASH BPF_MAP_TYPE_LRU_PERCPU_HASH BPF_MAP_TYPE_LPM_TRIE BPF_MAP_TYPE_ARRAY_OF_MAPS BPF_MAP_TYPE_HASH_OF_MAPS BPF_MAP_TYPE_DEVMAP BPF_MAP_TYPE_SOCKMAP BPF_MAP_TYPE_CPUMAP BPF_MAP_TYPE_XSKMAP BPF_MAP_TYPE_SOCKHASH BPF_MAP_TYPE_CGROUP_STORAGE BPF_MAP_TYPE_REUSEPORT_SOCKARRAY )
See https://github.com/cilium/cilium/blob/master/pkg/bpf/bpf.go BPF map type constants. Must match enum bpf_map_type from linux/bpf.h
View Source
const ( BPF_MAP_CREATE = iota BPF_MAP_LOOKUP_ELEM BPF_MAP_UPDATE_ELEM BPF_MAP_DELETE_ELEM BPF_MAP_GET_NEXT_KEY BPF_PROG_LOAD BPF_OBJ_PIN BPF_OBJ_GET BPF_PROG_ATTACH BPF_PROG_DETACH BPF_PROG_TEST_RUN BPF_PROG_GET_NEXT_ID BPF_MAP_GET_NEXT_ID BPF_PROG_GET_FD_BY_ID BPF_MAP_GET_FD_BY_ID BPF_OBJ_GET_INFO_BY_FD BPF_PROG_QUERY BPF_RAW_TRACEPOINT_OPEN BPF_BTF_LOAD BPF_BTF_GET_FD_BY_ID BPF_TASK_FD_QUERY )
BPF syscall command constants. Must match enum bpf_cmd from linux/bpf.h
View Source
const ( BPF_ANY = iota BPF_NOEXIST BPF_EXIST )
Flags for BPF_MAP_UPDATE_ELEM. Must match values from linux/bpf.h
View Source
const ( BPF_F_NO_PREALLOC = 1 << 0 BPF_F_NO_COMMON_LRU = 1 << 1 BPF_F_NUMA_NODE = 1 << 2 )
Flags for BPF_MAP_CREATE. Must match values from linux/bpf.h
View Source
const BpfFsPath = "/sys/fs/bpf"
Variables ¶
View Source
var (
PossibleCpus int
)
Functions ¶
func CreateLPMtrieKey ¶
func DeleteElement ¶
DeleteElement deletes the map element with the given key.
func GetNextKey ¶
GetNextKey stores, in nextKey, the next key after the key of the map in fd.
func PossibleCpuInit ¶
func PossibleCpuInit()
Types ¶
Click to show internal directories.
Click to hide internal directories.