Skip to main content

Module opcode

Module opcode 

Source
Expand description

Opcode and bytecode wire-format contract (version 1).

§File layout (RUSO + version byte)

  1. Metadata (name, description, impact, severity, author, report title)
  2. Probe table (HTTP / DNS / TCP specs)
  3. String pool
  4. Matcher pool (QualifiedMatch)
  5. Extract pool (ExtractSource)
  6. Evidence pool (EvidenceKind)
  7. Payload pool (raw bytes for Send overrides)
  8. Instruction stream (Opcode discriminants)

§Instruction opcodes (wire u8)

ByteVariantPayload
1Setname_id: u32, value_id: u32
2Sendprobe_id: u32, optional payload index
3Matchmatcher_id: u32
4MatchAllstart: u32, len: u16
5MatchAnystart: u32, len: u16
6Assertmatcher_id: u32
7Extractname_id: u32, source_id: u32
8IfMatchmatcher_id: u32, else_pc: u32
9Savefrom_id: u32, to_id: u32
10Evidencekind_id: u32
11Retryprobe_id: u32, count: u32
12RetryDelayduration_id: u32
13Sleepduration_id: u32
14Stop
15Fail
16Continue
17Exit
18(reserved)was Repeat, removed
19LoopBack
20Break
21SetListname_id: u32, start: u32, len: u16
22ForListitem_id: u32, start: u32, len: u16, end_pc: u32
23ForVaritem_id: u32, list_id: u32, end_pc: u32

Compilers must emit crate::BytecodeProgram compatible with crate::VERSION.

Structs§

BytecodeProgram
Compiled script ready for the executor (probes, metadata, and instruction stream).

Enums§

Opcode

Constants§

MAGIC
OP_ASSERT
OP_BREAK
OP_CONTINUE
OP_EVIDENCE
OP_EXIT
OP_EXTRACT
OP_FAIL
OP_FOR_LIST
OP_FOR_VAR
OP_IF_MATCH
OP_LOOP_BACK
OP_MATCH
OP_MATCH_ALL
OP_MATCH_ANY
OP_RETRY
OP_RETRY_DELAY
OP_SAVE
OP_SEND
OP_SET
OP_SET_LIST
OP_SLEEP
OP_STOP
VERSION

Type Aliases§

Pc
Instruction pointer index into BytecodeProgram::code.