Documentation ¶
Index ¶
- Constants
- func LoadProg(progType string, data []byte, licenseStr string, pinPath string) (int, error)
- func PinObject(objFD int, pinPath string) error
- func PinProg(progFD int, pinPath string) error
- func TCIngressAttach(interfaceName string, progFD int) error
- func XDPAttach(interfaceName string, progFD int) error
- func XDPDetach(interfaceName string) error
- type BpfMapData
- type BpfMapDef
- type BpfPin
Constants ¶
View Source
const ( // BPF map type constants. Must match enum bpf_map_type from linux/bpf.h BPF_MAP_TYPE_UNSPEC = 0 BPF_MAP_TYPE_HASH = 1 BPF_MAP_TYPE_ARRAY = 2 BPF_MAP_TYPE_PROG_ARRAY = 3 BPF_MAP_TYPE_PERF_EVENT_ARRAY = 4 BPF_MAP_TYPE_PERCPU_HASH = 5 BPF_MAP_TYPE_PERCPU_ARRAY = 6 BPF_MAP_TYPE_STACK_TRACE = 7 BPF_MAP_TYPE_CGROUP_ARRAY = 8 BPF_MAP_TYPE_LRU_HASH = 9 BPF_MAP_TYPE_LRU_PERCPU_HASH = 10 BPF_MAP_TYPE_LPM_TRIE = 11 BPF_MAP_TYPE_ARRAY_OF_MAPS = 12 BPF_MAP_TYPE_HASH_OF_MAPS = 13 BPF_MAP_TYPE_DEVMAP = 14 // BPF syscall command constants. Must match enum bpf_cmd from linux/bpf.h BPF_MAP_CREATE = 0 BPF_MAP_LOOKUP_ELEM = 1 BPF_MAP_UPDATE_ELEM = 2 BPF_MAP_DELETE_ELEM = 3 BPF_MAP_GET_NEXT_KEY = 4 BPF_PROG_LOAD = 5 BPF_OBJ_PIN = 6 BPF_OBJ_GET = 7 BPF_PROG_ATTACH = 8 BPF_PROG_DETACH = 9 BPF_PROG_TEST_RUN = 10 BPF_PROG_GET_NEXT_ID = 11 BPF_MAP_GET_NEXT_ID = 12 BPF_PROG_GET_FD_BY_ID = 13 BPF_MAP_GET_FD_BY_ID = 14 BPF_OBJ_GET_INFO_BY_FD = 15 // Flags for BPF_MAP_UPDATE_ELEM. Must match values from linux/bpf.h BPF_ANY = 0 BPF_NOEXIST = 1 BPF_EXIST = 2 BPF_F_NO_PREALLOC = 1 << 0 BPF_F_NO_COMMON_LRU = 1 << 1 // BPF MAP pinning PIN_NONE = 0 PIN_OBJECT_NS = 1 PIN_GLOBAL_NS = 2 PIN_CUSTOM_NS = 3 BPF_DIR_MNT = "/sys/fs/bpf/" BPF_DIR_GLOBALS = "globals" )
View Source
const ( XDP_ATTACH_MODE_NONE = 0 XDP_ATTACH_MODE_SKB = 1 XDP_ATTACH_MODE_DRV = 2 XDP_ATTACH_MODE_HW = 3 )
Variables ¶
This section is empty.
Functions ¶
func TCIngressAttach ¶
Types ¶
type BpfMapData ¶
type BpfMapData struct { Def BpfMapDef //Name [16]byte Name string // contains filtered or unexported fields }
func (*BpfMapData) CreateMap ¶
func (m *BpfMapData) CreateMap() (int, error)
Click to show internal directories.
Click to hide internal directories.