Class: SeccompTools::Instruction::Base
- Inherits:
-
Object
- Object
- SeccompTools::Instruction::Base
- Includes:
- Const::BPF
- Defined in:
- lib/seccomp-tools/instruction/base.rb
Overview
Base class of instructions.
Constant Summary
Constants included from Const::BPF
Const::BPF::ACTION, Const::BPF::COMMAND, Const::BPF::JMP, Const::BPF::MISCOP, Const::BPF::MODE, Const::BPF::OP, Const::BPF::PR_SET_SECCOMP, Const::BPF::SECCOMP_MODE_FILTER, Const::BPF::SECCOMP_RET_ACTION_FULL, Const::BPF::SECCOMP_RET_DATA, Const::BPF::SECCOMP_SET_MODE_FILTER, Const::BPF::SIZEOF_SECCOMP_DATA, Const::BPF::SRC
Instance Method Summary collapse
-
#branch(_context) ⇒ Array<(Integer, Context)>
Returns the possible branches after executing this instruction.
-
#initialize(bpf) ⇒ Base
constructor
Instantiate a Base object.
-
#invalid(msg = 'unknown') ⇒ Object
Helper to raise exception with message.
-
#symbolize ⇒ Array<Symbol, Integer>
Return tokens stand for this instruction.
Constructor Details
#initialize(bpf) ⇒ Base
Instantiate a SeccompTools::Instruction::Base object.
15 16 17 |
# File 'lib/seccomp-tools/instruction/base.rb', line 15 def initialize(bpf) @bpf = bpf end |
Instance Method Details
#branch(_context) ⇒ Array<(Integer, Context)>
Returns the possible branches after executing this instruction.
36 37 |
# File 'lib/seccomp-tools/instruction/base.rb', line 36 def branch(_context); raise NotImplmentedError end |
#invalid(msg = 'unknown') ⇒ Object
Helper to raise exception with message.
23 24 25 |
# File 'lib/seccomp-tools/instruction/base.rb', line 23 def invalid(msg = 'unknown') raise ArgumentError, "Line #{line} is invalid: #{msg}" end |
#symbolize ⇒ Array<Symbol, Integer>
Return tokens stand for this instruction.
45 46 |
# File 'lib/seccomp-tools/instruction/base.rb', line 45 def symbolize; raise NotImplmentedError end |