Function t2plugin::output_bytes

source ·
pub fn output_bytes(val: &[u8])
Expand description

Appends bytes to Tranalyzer2 output buffer.

This function can be called in the T2Plugin::on_flow_terminate function to append raw bytes in Tranalyzer2 output buffer. This can be used to output types which are neither a string, nor a number (e.g. MAC addresses).

Example

struct ExamplePlugin {
    mac_address: [u8; 6],
}

impl T2Plugin for ExamplePlugin {
    #[allow(unused_variables)]
    fn on_flow_terminate(&mut self, flow: &mut Flow) {
        output_bytes(&self.mac_address);
    }
}