Versions in this module Expand all Collapse all v0 v0.10.1 Jun 27, 2023 v0.10.0 Jun 26, 2023 Changes in this version + const DefaultVerifierLogSize + const LogLevelBranch + const LogLevelInstruction + const LogLevelStats + var ErrIterationAborted = errors.New("iteration aborted") + var ErrKeyExist = errors.New("key already exists") + var ErrKeyNotExist = errors.New("key does not exist") + var ErrMapIncompatible = errors.New("map spec is incompatible with existing map") + var ErrNotSupported = internal.ErrNotSupported + func EnableStats(which uint32) (io.Closer, error) + func SanitizeName(name string, replacement rune) string + type AttachFlags uint32 + type AttachType uint32 + const AttachCGroupDevice + const AttachCGroupGetsockopt + const AttachCGroupInet4Bind + const AttachCGroupInet4Connect + const AttachCGroupInet4PostBind + const AttachCGroupInet6Bind + const AttachCGroupInet6Connect + const AttachCGroupInet6PostBind + const AttachCGroupInetEgress + const AttachCGroupInetIngress + const AttachCGroupInetSockCreate + const AttachCGroupSetsockopt + const AttachCGroupSockOps + const AttachCGroupSysctl + const AttachCGroupUDP4Recvmsg + const AttachCGroupUDP4Sendmsg + const AttachCGroupUDP6Recvmsg + const AttachCGroupUDP6Sendmsg + const AttachCgroupInet4GetPeername + const AttachCgroupInet4GetSockname + const AttachCgroupInet6GetPeername + const AttachCgroupInet6GetSockname + const AttachCgroupInetSockRelease + const AttachFlowDissector + const AttachLSMMac + const AttachLircMode2 + const AttachModifyReturn + const AttachNone + const AttachPerfEvent + const AttachSkLookup + const AttachSkMsgVerdict + const AttachSkReuseportSelect + const AttachSkReuseportSelectOrMigrate + const AttachSkSKBStreamParser + const AttachSkSKBStreamVerdict + const AttachSkSKBVerdict + const AttachTraceFEntry + const AttachTraceFExit + const AttachTraceIter + const AttachTraceKprobeMulti + const AttachTraceRawTp + const AttachXDP + const AttachXDPCPUMap + const AttachXDPDevMap + func (i AttachType) String() string + type BatchOptions struct + ElemFlags uint64 + Flags uint64 + type Collection struct + Maps map[string]*Map + Programs map[string]*Program + func LoadCollection(file string) (*Collection, error) + func NewCollection(spec *CollectionSpec) (*Collection, error) + func NewCollectionWithOptions(spec *CollectionSpec, opts CollectionOptions) (*Collection, error) + func (coll *Collection) Close() + func (coll *Collection) DetachMap(name string) *Map + func (coll *Collection) DetachProgram(name string) *Program + type CollectionOptions struct + MapReplacements map[string]*Map + Maps MapOptions + Programs ProgramOptions + type CollectionSpec struct + ByteOrder binary.ByteOrder + Maps map[string]*MapSpec + Programs map[string]*ProgramSpec + Types *btf.Spec + func LoadCollectionSpec(file string) (*CollectionSpec, error) + func LoadCollectionSpecFromReader(rd io.ReaderAt) (*CollectionSpec, error) + func (cs *CollectionSpec) Assign(to interface{}) error + func (cs *CollectionSpec) Copy() *CollectionSpec + func (cs *CollectionSpec) LoadAndAssign(to interface{}, opts *CollectionOptions) error + func (cs *CollectionSpec) RewriteConstants(consts map[string]interface{}) error + func (cs *CollectionSpec) RewriteMaps(maps map[string]*Map) error + type LoadPinOptions struct + Flags uint32 + ReadOnly bool + WriteOnly bool + func (lpo *LoadPinOptions) Marshal() uint32 + type LogLevel = sys.LogLevel + type Map struct + func LoadPinnedMap(fileName string, opts *LoadPinOptions) (*Map, error) + func NewMap(spec *MapSpec) (*Map, error) + func NewMapFromFD(fd int) (*Map, error) + func NewMapFromID(id MapID) (*Map, error) + func NewMapWithOptions(spec *MapSpec, opts MapOptions) (*Map, error) + func (m *Map) BatchDelete(keys interface{}, opts *BatchOptions) (int, error) + func (m *Map) BatchLookup(prevKey, nextKeyOut, keysOut, valuesOut interface{}, opts *BatchOptions) (int, error) + func (m *Map) BatchLookupAndDelete(prevKey, nextKeyOut, keysOut, valuesOut interface{}, opts *BatchOptions) (int, error) + func (m *Map) BatchUpdate(keys, values interface{}, opts *BatchOptions) (int, error) + func (m *Map) Clone() (*Map, error) + func (m *Map) Close() error + func (m *Map) Delete(key interface{}) error + func (m *Map) FD() int + func (m *Map) Flags() uint32 + func (m *Map) Freeze() error + func (m *Map) Info() (*MapInfo, error) + func (m *Map) IsPinned() bool + func (m *Map) Iterate() *MapIterator + func (m *Map) KeySize() uint32 + func (m *Map) Lookup(key, valueOut interface{}) error + func (m *Map) LookupAndDelete(key, valueOut interface{}) error + func (m *Map) LookupAndDeleteWithFlags(key, valueOut interface{}, flags MapLookupFlags) error + func (m *Map) LookupBytes(key interface{}) ([]byte, error) + func (m *Map) LookupWithFlags(key, valueOut interface{}, flags MapLookupFlags) error + func (m *Map) MaxEntries() uint32 + func (m *Map) NextKey(key, nextKeyOut interface{}) error + func (m *Map) NextKeyBytes(key interface{}) ([]byte, error) + func (m *Map) Pin(fileName string) error + func (m *Map) Put(key, value interface{}) error + func (m *Map) String() string + func (m *Map) Type() MapType + func (m *Map) Unpin() error + func (m *Map) Update(key, value any, flags MapUpdateFlags) error + func (m *Map) ValueSize() uint32 + type MapID uint32 + func MapGetNextID(startID MapID) (MapID, error) + type MapInfo struct + Flags uint32 + KeySize uint32 + MaxEntries uint32 + Name string + Type MapType + ValueSize uint32 + func (mi *MapInfo) ID() (MapID, bool) + type MapIterator struct + func (mi *MapIterator) Err() error + func (mi *MapIterator) Next(keyOut, valueOut interface{}) bool + type MapKV struct + Key interface{} + Value interface{} + type MapLookupFlags uint64 + const LookupLock + type MapOptions struct + LoadPinOptions LoadPinOptions + PinPath string + type MapSpec struct + Contents []MapKV + Extra *bytes.Reader + Flags uint32 + Freeze bool + InnerMap *MapSpec + Key btf.Type + KeySize uint32 + MaxEntries uint32 + Name string + NumaNode uint32 + Pinning PinType + Type MapType + Value btf.Type + ValueSize uint32 + func (ms *MapSpec) Compatible(m *Map) error + func (ms *MapSpec) Copy() *MapSpec + func (ms *MapSpec) String() string + type MapType uint32 + const Array + const ArrayOfMaps + const CGroupArray + const CGroupStorage + const CPUMap + const DevMap + const DevMapHash + const Hash + const HashOfMaps + const InodeStorage + const LPMTrie + const LRUCPUHash + const LRUHash + const PerCPUArray + const PerCPUCGroupStorage + const PerCPUHash + const PerfEventArray + const ProgramArray + const Queue + const ReusePortSockArray + const RingBuf + const SkStorage + const SockHash + const SockMap + const Stack + const StackTrace + const StructOpsMap + const TaskStorage + const UnspecifiedMap + const XSKMap + func (i MapType) String() string + type MapUpdateFlags uint64 + const UpdateAny + const UpdateExist + const UpdateLock + const UpdateNoExist + type MissingConstantsError struct + Constants []string + func (m *MissingConstantsError) Error() string + type PinType int + const PinByName + const PinNone + func (i PinType) String() string + type Program struct + VerifierLog string + func LoadPinnedProgram(fileName string, opts *LoadPinOptions) (*Program, error) + func NewProgram(spec *ProgramSpec) (*Program, error) + func NewProgramFromFD(fd int) (*Program, error) + func NewProgramFromID(id ProgramID) (*Program, error) + func NewProgramWithOptions(spec *ProgramSpec, opts ProgramOptions) (*Program, error) + func (p *Program) Benchmark(in []byte, repeat int, reset func()) (uint32, time.Duration, error) + func (p *Program) BindMap(m *Map) error + func (p *Program) Clone() (*Program, error) + func (p *Program) Close() error + func (p *Program) FD() int + func (p *Program) Handle() (*btf.Handle, error) + func (p *Program) Info() (*ProgramInfo, error) + func (p *Program) IsPinned() bool + func (p *Program) Pin(fileName string) error + func (p *Program) Run(opts *RunOptions) (uint32, error) + func (p *Program) String() string + func (p *Program) Test(in []byte) (uint32, []byte, error) + func (p *Program) Type() ProgramType + func (p *Program) Unpin() error + type ProgramID uint32 + func ProgramGetNextID(startID ProgramID) (ProgramID, error) + type ProgramInfo struct + Name string + Tag string + Type ProgramType + func (pi *ProgramInfo) BTFID() (btf.ID, bool) + func (pi *ProgramInfo) CreatedByUID() (uint32, bool) + func (pi *ProgramInfo) ID() (ProgramID, bool) + func (pi *ProgramInfo) Instructions() (asm.Instructions, error) + func (pi *ProgramInfo) MapIDs() ([]MapID, bool) + func (pi *ProgramInfo) RunCount() (uint64, bool) + func (pi *ProgramInfo) Runtime() (time.Duration, bool) + type ProgramOptions struct + KernelTypes *btf.Spec + LogDisabled bool + LogLevel LogLevel + LogSize int + type ProgramSpec struct + AttachTarget *Program + AttachTo string + AttachType AttachType + ByteOrder binary.ByteOrder + Flags uint32 + Instructions asm.Instructions + KernelVersion uint32 + License string + Name string + SectionName string + Type ProgramType + func (ps *ProgramSpec) Copy() *ProgramSpec + func (ps *ProgramSpec) Tag() (string, error) + type ProgramType uint32 + const Boesfs + const CGroupDevice + const CGroupSKB + const CGroupSock + const CGroupSockAddr + const CGroupSockopt + const CGroupSysctl + const Extension + const FlowDissector + const Kprobe + const LSM + const LWTIn + const LWTOut + const LWTSeg6Local + const LWTXmit + const LircMode2 + const PerfEvent + const RawTracepoint + const RawTracepointWritable + const SchedACT + const SchedCLS + const SkLookup + const SkMsg + const SkReuseport + const SkSKB + const SockOps + const SocketFilter + const StructOps + const Syscall + const TracePoint + const Tracing + const UnspecifiedProgram + const XDP + func (i ProgramType) String() string + type RunOptions struct + CPU uint32 + Context interface{} + ContextOut interface{} + Data []byte + DataOut []byte + Flags uint32 + Repeat uint32 + Reset func() + type VerifierError = internal.VerifierError