#[repr(C, packed(4))]pub struct BytecodeOp {
pub code: u8,
pub yes: u8,
pub no: u16,
}inet-diag only.Expand description
Bytecode is sequence of 4 byte commands followed by variable arguments. All the commands identified by "code" are conditional jumps forward: to offset cc+"yes" (bytes) or to offset cc+"no" (bytes). "yes" is supposed to be length of the command and its arguments (in bytes).
Termination condition is to land excactly on a len'th instruction (on address of one after the last one), overshooting means an unsucessfull termination.
If you reading this, for your own sanity, I advice you to first try
reverse-lookup on the ss command with filters you need, and copy
bytecode from there.
Fields§
§code: u8Associated type: BytecodeOpCode (enum)
yes: u8offset to jump on match
no: u16offset to jump on non-match
Implementations§
Source§impl BytecodeOp
impl BytecodeOp
Sourcepub fn new_from_slice(other: &[u8]) -> Option<Self>
pub fn new_from_slice(other: &[u8]) -> Option<Self>
Copy from contents from slice
Sourcepub fn new_from_zeroed(other: &[u8]) -> Self
pub fn new_from_zeroed(other: &[u8]) -> Self
Copy from contents from another slice, padding with zeros or truncating when needed