Class: SeccompTools::Instruction::RET
- Defined in:
- lib/seccomp-tools/instruction/ret.rb
Overview
Instruction ret, terminates the filter with an action such as ALLOW or KILL.
The action comes from either the accumulator register A or the immediate k.
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_MODE_STRICT, Const::BPF::SECCOMP_RET_ACTION_FULL, Const::BPF::SECCOMP_RET_DATA, Const::BPF::SECCOMP_SET_MODE_FILTER, Const::BPF::SECCOMP_SET_MODE_STRICT, Const::BPF::SIZEOF_SECCOMP_DATA, Const::BPF::SRC
Instance Method Summary collapse
-
#branch ⇒ Array
See Base#branch.
-
#decompile ⇒ String
Decompile instruction.
-
#symbolize ⇒ [:ret, (:a, Integer)]
See Base#symbolize.
Methods inherited from Base
Methods included from Const::BPF
Constructor Details
This class inherits a constructor from SeccompTools::Instruction::Base
Instance Method Details
#branch ⇒ Array
See Base#branch.
Accepts and ignores any arguments, the state is irrelevant here.
30 31 32 |
# File 'lib/seccomp-tools/instruction/ret.rb', line 30 def branch(*) [] end |
#decompile ⇒ String
Decompile instruction.
14 15 16 |
# File 'lib/seccomp-tools/instruction/ret.rb', line 14 def decompile "return #{ret_str}" end |
#symbolize ⇒ [:ret, (:a, Integer)]
See Base#symbolize.
21 22 23 |
# File 'lib/seccomp-tools/instruction/ret.rb', line 21 def symbolize [:ret, code & 0x18 == SRC[:a] ? :a : k] end |