123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- package bpf
- type Register uint16
- const (
-
-
- RegA Register = iota
-
-
- RegX
- )
- type ALUOp uint16
- const (
- ALUOpAdd ALUOp = iota << 4
- ALUOpSub
- ALUOpMul
- ALUOpDiv
- ALUOpOr
- ALUOpAnd
- ALUOpShiftLeft
- ALUOpShiftRight
- aluOpNeg
- ALUOpMod
- ALUOpXor
- )
- type JumpTest uint16
- const (
-
- JumpEqual JumpTest = iota
-
- JumpNotEqual
-
- JumpGreaterThan
-
- JumpLessThan
-
- JumpGreaterOrEqual
-
- JumpLessOrEqual
-
- JumpBitsSet
-
- JumpBitsNotSet
- )
- type Extension int
- const (
-
-
- extOffset = -0x1000
-
- ExtLen Extension = 1
-
- ExtProto Extension = 0
-
-
-
-
- ExtType Extension = 4
-
-
-
- ExtPayloadOffset Extension = 52
-
-
- ExtInterfaceIndex Extension = 8
-
-
- ExtNetlinkAttr Extension = 12
-
-
- ExtNetlinkAttrNested Extension = 16
-
- ExtMark Extension = 20
-
- ExtQueue Extension = 24
-
-
- ExtLinkLayerType Extension = 28
-
-
-
- ExtRXHash Extension = 32
-
-
- ExtCPUID Extension = 36
-
- ExtVLANTag Extension = 44
-
-
-
-
-
-
- ExtVLANTagPresent Extension = 48
-
-
-
- ExtVLANProto Extension = 60
-
- ExtRand Extension = 56
- )
- const (
- opMaskCls uint16 = 0x7
-
- opMaskLoadDest = 0x01
- opMaskLoadWidth = 0x18
- opMaskLoadMode = 0xe0
-
- opMaskOperandSrc = 0x08
- opMaskOperator = 0xf0
-
- opMaskJumpConst = 0x0f
- opMaskJumpCond = 0xf0
- )
- const (
-
-
-
- opClsLoadA uint16 = iota
-
-
-
- opClsLoadX
-
-
-
- opClsStoreA
-
-
-
- opClsStoreX
-
-
-
- opClsALU
-
-
-
- opClsJump
-
-
-
- opClsReturn
-
-
-
- opClsMisc
- )
- const (
- opAddrModeImmediate uint16 = iota << 5
- opAddrModeAbsolute
- opAddrModeIndirect
- opAddrModeScratch
- opAddrModePacketLen
- opAddrModeMemShift
- )
- const (
- opLoadWidth4 uint16 = iota << 3
- opLoadWidth2
- opLoadWidth1
- )
- const (
- opALUSrcConstant uint16 = iota << 3
- opALUSrcX
- )
- const (
- opJumpAlways = iota << 4
- opJumpEqual
- opJumpGT
- opJumpGE
- opJumpSet
- )
- const (
- opRetSrcConstant uint16 = iota << 4
- opRetSrcA
- )
- const (
- opMiscTAX = 0x00
- opMiscTXA = 0x80
- )
|