Crate t2plugin [] [src]

This crate allows to easily develop Rust plugins for Tranalyzer2, a network traffic analysis tool.

An example Rust plugin for Tranalyzer2 using this crate can be found here: https://github.com/Tranalyzer/rustExample

Create a new plugin

  1. Download and install Tranalyzer2.

  2. Clone the Tranalyzer2 Rust plugin template and rename it.

    cd $T2HOME
    git clone https://github.com/Tranalyzer/rustTemplate.git myPluginName
    cd myPluginName
    ./autogen.sh --rename
    
  3. Optional: change the PLUGINORDER at the top of autogen.sh.

  4. Fill the different methods of the T2Plugin trait implementation in src/lib.rs.

Modules

nethdr

Contains the definition of a Flow, a Packet and the different protocol headers.

slread

Contains the SliceReader which allows to easily read integers and strings from a byte slice.

Macros

t2plugin

This macro transforms a struct implementing the T2Plugin trait into a plugin which can be loaded by Tranalyzer2.

Structs

Header

This structure represents the output header of this plugin.

Enums

BinaryType

Types of values which can be outputted in Tranalyzer2 flow files.

BinaryValue

Rust opaque representation of binart_valut_t struct from Tranalyzer2

OutputBuffer

Rust opaque representation of outputBuffer_t struct from Tranalyzer2

Constants

HASHTABLE_ENTRY_NOT_FOUND

flow_index value representing a non-existing Flow.

Traits

T2Plugin

Trait to tranform a per flow struct into a Tranalyzer2 plugin.

Functions

getflow

Returns the Flow structure of the flow with flow_index=index.

hashchaintable_size

Returns the number of flows that Tranalyzer2 can store in its internal hashtable.

output_bytes

Appends bytes to Tranalyzer2 output buffer.

output_num

Appends a number (integer or float) to Tranalyzer2 output buffer.

output_nums

Appends a list of numbers (integers or floats) to Tranalyzer2 output buffer.

output_string

Appends a string to Tranalyzer2 output buffer.

output_strings

Appends a list of strings to Tranalyzer2 output buffer.

Type Definitions

c_ulong

unsigned long in C: u32 on 32-bit systems and u64 on 64-bit systems.