pub struct Header { /* private fields */ }
Expand description
This structure represents the output header of this plugin.
A header is defined as a set of columns. Each column is defined by its short name, long name and a definition of the type of data it contains.
Implementations§
source§impl Header
impl Header
sourcepub fn _internal(&self) -> *mut BinaryValue
pub fn _internal(&self) -> *mut BinaryValue
Returns Tranalyzer2 internal buffer representing the built header.
This method does not need to be manually called when the t2plugin!
macro is used.
sourcepub fn add_simple_col(
&mut self,
long_name: &str,
short_name: &str,
repeating: bool,
bin_type: BinaryType
)
pub fn add_simple_col( &mut self, long_name: &str, short_name: &str, repeating: bool, bin_type: BinaryType )
Adds a simple column (without compound values) to the header.
Example
impl T2Plugin for ExamplePlugin {
...
fn print_header() -> Header {
let mut header = Header::new();
header.add_simple_col("IPv4 source address", "srcIP4", false,
BinaryType::bt_ip4_addr);
header.add_simple_col("HTTP cookies", "httpCookies", true,
BinaryType::bt_string);
header
}
}
sourcepub fn add_compound_col(
&mut self,
long_name: &str,
short_name: &str,
repeating: bool,
bin_types: &[BinaryType]
)
pub fn add_compound_col( &mut self, long_name: &str, short_name: &str, repeating: bool, bin_types: &[BinaryType] )
Adds a compound column to the header.
Example
impl T2Plugin for ExamplePlugin {
...
fn print_header() -> Header {
let mut header = Header::new();
// column which contains for each cookie a compound: count_key_value
header.add_compound_col("HTTP cookies", "httpCookies", true,
&[BinaryType::bt_uint_16, BinaryType::bt_string, BinaryType::bt_string]);
header
}
}
Auto Trait Implementations§
impl RefUnwindSafe for Header
impl !Send for Header
impl !Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more