package ebpf
|
|
|
|
import "fmt"
|
|
|
|
// Call function.
|
|
type Call uint32
|
|
|
|
const (
|
|
Unspec Call = iota
|
|
MapLookupElem
|
|
MapUpdateElem
|
|
MapDeleteElem
|
|
ProbeRead
|
|
KtimeGetNs
|
|
TracePrintk
|
|
GetPrandomU32
|
|
GetSmpProcessorId
|
|
SKBStoreBytes
|
|
L3CsumReplace
|
|
L4CsumReplace
|
|
TailCall
|
|
CloneRedirect
|
|
GetCurrentPidTgid
|
|
GetCurrentUidGid
|
|
GetCurrentComm
|
|
GetCgroupClassid
|
|
SKBVlanPush
|
|
SKBVlanPop
|
|
SKBGetTunnelKey
|
|
SKBSetTunnelKey
|
|
PerfEventRead
|
|
Redirect
|
|
GetRouteRealm
|
|
PerfEventOutput
|
|
SKBLoadBytes
|
|
GetStackid
|
|
CsumDiff
|
|
SKBGetTunnelOpt
|
|
SKBSetTunnelOpt
|
|
SKBChangeProto
|
|
SKBChangeType
|
|
SKBUnderCgroup
|
|
GetHashRecalc
|
|
GetCurrentTask
|
|
ProbeWriteUser
|
|
CurrentTaskUnderCgroup
|
|
SKBChangeTail
|
|
SKBPullData
|
|
CsumUpdate
|
|
SetHashInvalid
|
|
GetNumaNodeId
|
|
SKBChangeHead
|
|
XDPAdjustHead
|
|
ProbeReadStr
|
|
GetSocketCookie
|
|
GetSocketUid
|
|
SetHash
|
|
Setsockopt
|
|
SKBAdjustRoom
|
|
RedirectMap
|
|
SkRedirectMap
|
|
SockMapUpdate
|
|
XDPAdjustMeta
|
|
PerfEventReadValue
|
|
PerfProgReadValue
|
|
Getsockopt
|
|
OverrideReturn
|
|
SockOpsCbFlagsSet
|
|
MsgRedirectMap
|
|
MsgApplyBytes
|
|
MsgCorkBytes
|
|
MsgPullData
|
|
Bind
|
|
XDPAdjustTail
|
|
SKBGetXfrmState
|
|
GetStack
|
|
SKBLoadBytesRelative
|
|
FIBLookup
|
|
SockHashUpdate
|
|
MsgRedirectHash
|
|
SkRedirectHash
|
|
LwtPushEncap
|
|
LwtSeg6StoreBytes
|
|
LwtSeg6AdjustSrh
|
|
LwtSeg6Action
|
|
RcRepeat
|
|
RcKeydown
|
|
SKBCgroupId
|
|
GetCurrentCgroupId
|
|
GetLocalStorage
|
|
SkSelectReuseport
|
|
SKBAncestorCgroupId
|
|
SkLookupTcp
|
|
SkLookupUdp
|
|
SkRelease
|
|
MapPushElem
|
|
MapPopElem
|
|
MapPeekElem
|
|
MsgPushData
|
|
MsgPopData
|
|
RcPointerRel
|
|
SpinLock
|
|
SpinUnlock
|
|
SkFullsock
|
|
TcpSock
|
|
SKBEcnSetCe
|
|
GetListenerSock
|
|
SkcLookupTcp
|
|
TcpCheckSyncookie
|
|
SysctlGetName
|
|
SysctlGetCurrentValue
|
|
SysctlGetNewValue
|
|
SysctlSetNewValue
|
|
Strtol
|
|
Strtoul
|
|
SkStorageGet
|
|
SkStorageDelete
|
|
SendSignal
|
|
TCPGenSynCookie
|
|
SKBOutput
|
|
ProbeReadUser
|
|
ProbeReadKernel
|
|
ProbeReadUserStr
|
|
ProbeReadKernelStr
|
|
TCPSendACK
|
|
SendSignalThread
|
|
Jiffies64
|
|
)
|
|
|
|
// Assemble implements the Instruction Assemble method.
|
|
func (a Call) Assemble() (RawInstruction, error) {
|
|
return RawInstruction{
|
|
Op: opClassJump | jumpOpCall,
|
|
Immediate: uint64(a),
|
|
}, nil
|
|
}
|
|
|
|
func (a Call) String() string {
|
|
return fmt.Sprintf("call %d", uint32(a))
|
|
}
|
|
|
|
func (a Call) CString() string {
|
|
return "" // TODO
|
|
}
|
|
|
|
var (
|
|
_ Instruction = (*Call)(nil)
|
|
)
|