Versions in this module Expand all Collapse all v0 v0.28.1 Aug 29, 2024 Changes in this version + type ALUOp uint16 + const ALUOpAdd + const ALUOpAnd + const ALUOpDiv + const ALUOpMod + const ALUOpMul + const ALUOpOr + const ALUOpShiftLeft + const ALUOpShiftRight + const ALUOpSub + const ALUOpXor + type ALUOpConstant struct + Op ALUOp + Val uint32 + func (a ALUOpConstant) Assemble() (RawInstruction, error) + func (a ALUOpConstant) String() string + type ALUOpX struct + Op ALUOp + func (a ALUOpX) Assemble() (RawInstruction, error) + func (a ALUOpX) String() string + type Extension int + const ExtCPUID + const ExtInterfaceIndex + const ExtLen + const ExtLinkLayerType + const ExtMark + const ExtNetlinkAttr + const ExtNetlinkAttrNested + const ExtPayloadOffset + const ExtProto + const ExtQueue + const ExtRXHash + const ExtRand + const ExtType + const ExtVLANProto + const ExtVLANTag + const ExtVLANTagPresent + type Instruction interface + Assemble func() (RawInstruction, error) + func Disassemble(raw []RawInstruction) (insts []Instruction, allDecoded bool) + type Jump struct + Skip uint32 + func (a Jump) Assemble() (RawInstruction, error) + func (a Jump) String() string + type JumpIf struct + Cond JumpTest + SkipFalse uint8 + SkipTrue uint8 + Val uint32 + func (a JumpIf) Assemble() (RawInstruction, error) + func (a JumpIf) String() string + type JumpIfX struct + Cond JumpTest + SkipFalse uint8 + SkipTrue uint8 + func (a JumpIfX) Assemble() (RawInstruction, error) + func (a JumpIfX) String() string + type JumpTest uint16 + const JumpBitsNotSet + const JumpBitsSet + const JumpEqual + const JumpGreaterOrEqual + const JumpGreaterThan + const JumpLessOrEqual + const JumpLessThan + const JumpNotEqual + type LoadAbsolute struct + Off uint32 + Size int + func (a LoadAbsolute) Assemble() (RawInstruction, error) + func (a LoadAbsolute) String() string + type LoadConstant struct + Dst Register + Val uint32 + func (a LoadConstant) Assemble() (RawInstruction, error) + func (a LoadConstant) String() string + type LoadExtension struct + Num Extension + func (a LoadExtension) Assemble() (RawInstruction, error) + func (a LoadExtension) String() string + type LoadIndirect struct + Off uint32 + Size int + func (a LoadIndirect) Assemble() (RawInstruction, error) + func (a LoadIndirect) String() string + type LoadMemShift struct + Off uint32 + func (a LoadMemShift) Assemble() (RawInstruction, error) + func (a LoadMemShift) String() string + type LoadScratch struct + Dst Register + N int + func (a LoadScratch) Assemble() (RawInstruction, error) + func (a LoadScratch) String() string + type NegateA struct + func (a NegateA) Assemble() (RawInstruction, error) + func (a NegateA) String() string + type RawInstruction struct + Jf uint8 + Jt uint8 + K uint32 + Op uint16 + func Assemble(insts []Instruction) ([]RawInstruction, error) + func (ri RawInstruction) Assemble() (RawInstruction, error) + func (ri RawInstruction) Disassemble() Instruction + type Register uint16 + const RegA + const RegX + type RetA struct + func (a RetA) Assemble() (RawInstruction, error) + func (a RetA) String() string + type RetConstant struct + Val uint32 + func (a RetConstant) Assemble() (RawInstruction, error) + func (a RetConstant) String() string + type Setter interface + SetBPF func(filter []RawInstruction) error + type StoreScratch struct + N int + Src Register + func (a StoreScratch) Assemble() (RawInstruction, error) + func (a StoreScratch) String() string + type TAX struct + func (a TAX) Assemble() (RawInstruction, error) + func (a TAX) String() string + type TXA struct + func (a TXA) Assemble() (RawInstruction, error) + func (a TXA) String() string + type VM struct + func NewVM(filter []Instruction) (*VM, error) + func (v *VM) Run(in []byte) (int, error)