Function t2plugin::output_ip

source ·
pub fn output_ip(val: &IpAddr, ip_type: BinaryType)
Expand description

Appends an IP address to Tranalyzer2 output buffer.

This function can be called in the T2Plugin::on_flow_terminate function to append an IP address in Tranalyzer2 output buffer. This functions will panic if the IP address type is not compatible with the column type.

Example

impl T2Plugin for ExamplePlugin {
    ...
    #[allow(unused_variables)]
    fn on_flow_terminate(&mut self, flow: &mut Flow) {
        ...
        // output flow source IP address in a bt_ipx_addr column
        output_ip(flow.src_ip(), BinaryType::bt_ipx_addr);
    }
}