Class: Crabstone::BPF::Operand

Inherits:
FFI::Struct
  • Object
show all
Includes:
Extension::Operand
Defined in:
lib/crabstone/arch/5/bpf.rb

Instance Method Summary collapse

Methods included from Extension::Operand

#valid?, #value

Instance Method Details

#ext?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/crabstone/arch/5/bpf.rb', line 67

def ext?
  self[:type] == OP_EXT
end

#imm?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/crabstone/arch/5/bpf.rb', line 44

def imm?
  self[:type] == OP_IMM
end

#mem?Boolean

Returns:

  • (Boolean)


52
53
54
55
56
57
# File 'lib/crabstone/arch/5/bpf.rb', line 52

def mem?
  [
    OP_MEM,
    OP_MMEM
  ].include?(self[:type])
end

#mmem?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/crabstone/arch/5/bpf.rb', line 59

def mmem?
  self[:type] == OP_MMEM
end

#msh?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/crabstone/arch/5/bpf.rb', line 63

def msh?
  self[:type] == OP_MSH
end

#off?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/crabstone/arch/5/bpf.rb', line 48

def off?
  self[:type] == OP_OFF
end

#reg?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/crabstone/arch/5/bpf.rb', line 40

def reg?
  self[:type] == OP_REG
end