Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

libtrace_format_t Struct Reference

Module definition structure. More...

Collaboration diagram for libtrace_format_t:

Collaboration graph
[legend]

Data Fields

const char * name
 the uri name of this module
const char * version
 the version of this module
enum base_format_t type
 the RT protocol type of this module
int(* init_input )(libtrace_t *libtrace)
 initialise an trace (or NULL if input is not supported)
int(* config_input )(libtrace_t *libtrace, trace_option_t option, void *value)
 configure an trace (or NULL if input is not supported)
int(* start_input )(libtrace_t *libtrace)
 start/unpause an trace (or NULL if input not supported)
int(* pause_input )(libtrace_t *libtrace)
 pause an trace (or NULL if input not supported)
int(* init_output )(libtrace_out_t *libtrace)
 initialise output traces (or NULL if output not supported)
int(* config_output )(libtrace_out_t *libtrace, trace_option_output_t option, void *)
 configure output traces (or NULL if output not supported)
int(* start_output )(libtrace_out_t *libtrace)
 start output traces (or NULL if output not supported) There is no pause for output traces, as packets are not arriving asyncronously
int(* fin_input )(libtrace_t *libtrace)
 finish an input trace, cleanup (or NULL if input not supported) if the trace is not paused, libtrace will pause the trace before calling this function.
int(* fin_output )(libtrace_out_t *libtrace)
 finish an output trace, cleanup (or NULL if output not supported)
int(* read_packet )(libtrace_t *libtrace, libtrace_packet_t *packet)
 read a packet from a trace into the provided packet structure
void(* fin_packet )(libtrace_packet_t *packet)
 finalise a packet cleanup any resources used by a packet that can't be reused for the next packet.
int(* write_packet )(libtrace_out_t *libtrace, libtrace_packet_t *packet)
 write a packet to a trace from the provided packet (or NULL if output not supported)
libtrace_linktype_t(* get_link_type )(const libtrace_packet_t *packet)
 return the libtrace link type for this packet
libtrace_direction_t(* get_direction )(const libtrace_packet_t *packet)
 return the direction of this packet
libtrace_direction_t(* set_direction )(libtrace_packet_t *packet, libtrace_direction_t direction)
 set the direction of this packet
uint64_t(* get_erf_timestamp )(const libtrace_packet_t *packet)
 return the erf timestamp of the packet.
timeval(* get_timeval )(const libtrace_packet_t *packet)
 return the timeval of this packet.
double(* get_seconds )(const libtrace_packet_t *packet)
 return the timestamp of this packet.
int(* seek_erf )(libtrace_t *trace, uint64_t timestamp)
 move the pointer within the trace.
int(* seek_timeval )(libtrace_t *trace, struct timeval tv)
 move the pointer within the trace.
int(* seek_seconds )(libtrace_t *trace, double seconds)
 move the pointer within the trace.
int(* get_capture_length )(const libtrace_packet_t *packet)
 return the captured payload length
int(* get_wire_length )(const libtrace_packet_t *packet)
 return the original length of the packet on the wire.
int(* get_framing_length )(const libtrace_packet_t *packet)
 return the length of the trace framing header
size_t(* set_capture_length )(struct libtrace_packet_t *packet, size_t size)
 truncate (snap) the packet
uint64_t(* get_received_packets )(libtrace_t *trace)
 Report the number of packets ever seen as early as possible.
uint64_t(* get_filtered_packets )(libtrace_t *trace)
 Report the number of filtered packets.
uint64_t(* get_dropped_packets )(libtrace_t *trace)
 Return the number of dropped packets.
uint64_t(* get_captured_packets )(libtrace_t *trace)
 Report number of captured packets.
int(* get_fd )(const libtrace_t *trace)
 return the filedescriptor associated with this interface.
libtrace_eventobj_t(* trace_event )(libtrace_t *trace, libtrace_packet_t *packet)
 return the next event from this source
void(* help )(void)
 return information about this trace format to standard out
libtrace_format_tnext
 next pointer, should be NULL

Detailed Description

Module definition structure.


Field Documentation

int(* libtrace_format_t::config_input)(libtrace_t *libtrace, trace_option_t option, void *value)
 

configure an trace (or NULL if input is not supported)

int(* libtrace_format_t::config_output)(libtrace_out_t *libtrace, trace_option_output_t option, void *)
 

configure output traces (or NULL if output not supported)

int(* libtrace_format_t::fin_input)(libtrace_t *libtrace)
 

finish an input trace, cleanup (or NULL if input not supported) if the trace is not paused, libtrace will pause the trace before calling this function.

int(* libtrace_format_t::fin_output)(libtrace_out_t *libtrace)
 

finish an output trace, cleanup (or NULL if output not supported)

void(* libtrace_format_t::fin_packet)(libtrace_packet_t *packet)
 

finalise a packet cleanup any resources used by a packet that can't be reused for the next packet.

int(* libtrace_format_t::get_capture_length)(const libtrace_packet_t *packet)
 

return the captured payload length

Returns:
the amount of data captured in a trace. This is the number of bytes actually in the trace. This does not include the trace framing length. This is usually shorter or equal to the wire length.

uint64_t(* libtrace_format_t::get_captured_packets)(libtrace_t *trace)
 

Report number of captured packets.

libtrace_direction_t(* libtrace_format_t::get_direction)(const libtrace_packet_t *packet)
 

return the direction of this packet

Note:
This callback may be NULL if not supported.

uint64_t(* libtrace_format_t::get_dropped_packets)(libtrace_t *trace)
 

Return the number of dropped packets.

uint64_t(* libtrace_format_t::get_erf_timestamp)(const libtrace_packet_t *packet)
 

return the erf timestamp of the packet.

Returns:
the 64bit erf timestamp This field may be NULL in the structure, and libtrace will synthesise the result from get_timeval or get_seconds if they exist. AT least one of get_erf_timestamp, get_timeval or get_seconds must be implemented.

int(* libtrace_format_t::get_fd)(const libtrace_t *trace)
 

return the filedescriptor associated with this interface.

Note:
This callback may be NULL if not supported. This function is only needed if you use trace_event_interface as the pointer for trace_event

uint64_t(* libtrace_format_t::get_filtered_packets)(libtrace_t *trace)
 

Report the number of filtered packets.

int(* libtrace_format_t::get_framing_length)(const libtrace_packet_t *packet)
 

return the length of the trace framing header

Returns:
the length of the framing header The framing header is the extra metadata a trace stores about a packet. This does not include the wire or capture length of the packet. Usually get_framing_length()+get_capture_length() is the size returned by read_packet

libtrace_linktype_t(* libtrace_format_t::get_link_type)(const libtrace_packet_t *packet)
 

return the libtrace link type for this packet

Returns:
the libtrace link type, or -1 if this link type is unknown

uint64_t(* libtrace_format_t::get_received_packets)(libtrace_t *trace)
 

Report the number of packets ever seen as early as possible.

double(* libtrace_format_t::get_seconds)(const libtrace_packet_t *packet)
 

return the timestamp of this packet.

Returns:
the floating point seconds since 1970-01-01 00:00:00 This field may be NULL in the structure, and libtrace will synthesise the result from get_timeval or get_erf_timestamp if they exist. AT least one of get_erf_timestamp, get_timeval or get_seconds must be implemented.

struct timeval(* libtrace_format_t::get_timeval)(const libtrace_packet_t *packet)
 

return the timeval of this packet.

Returns:
the timeval This field may be NULL in the structure, and libtrace will synthesise the result from get_erf_timestamp or get_seconds if they exist. AT least one of get_erf_timestamp, get_timeval or get_seconds must be implemented.

int(* libtrace_format_t::get_wire_length)(const libtrace_packet_t *packet)
 

return the original length of the packet on the wire.

Returns:
the length of the packet on the wire before truncation. This is the number of bytes actually in the trace. This does not include the trace framing length. This is usually shorter or equal to the wire length.

void(* libtrace_format_t::help)(void)
 

return information about this trace format to standard out

int(* libtrace_format_t::init_input)(libtrace_t *libtrace)
 

initialise an trace (or NULL if input is not supported)

int(* libtrace_format_t::init_output)(libtrace_out_t *libtrace)
 

initialise output traces (or NULL if output not supported)

const char* libtrace_format_t::name
 

the uri name of this module

struct libtrace_format_t* libtrace_format_t::next
 

next pointer, should be NULL

int(* libtrace_format_t::pause_input)(libtrace_t *libtrace)
 

pause an trace (or NULL if input not supported)

int(* libtrace_format_t::read_packet)(libtrace_t *libtrace, libtrace_packet_t *packet)
 

read a packet from a trace into the provided packet structure

Returns:
-1 on error, or get_framing_length()+get_capture_length() \ on success. if this function is not supported, this field may be NULL.

int(* libtrace_format_t::seek_erf)(libtrace_t *trace, uint64_t timestamp)
 

move the pointer within the trace.

Returns:
0 on success, -1 on failure. The next packet returned by read_packet be the first packet in the trace to have a timestamp equal or greater than timestamp.
Note:
this function may be NULL if the format does not support this feature. If the format implements seek_timeval and/or seek_seconds then libtrace will call those functions instead.

int(* libtrace_format_t::seek_seconds)(libtrace_t *trace, double seconds)
 

move the pointer within the trace.

Returns:
0 on success, -1 on failure. The next packet returned by read_packet be the first packet in the trace to have a timestamp equal or greater than tv.
Note:
this function may be NULL if the format does not support this feature. If the format implements seek_erf and/or seek_timeval then libtrace will call those functions instead.

int(* libtrace_format_t::seek_timeval)(libtrace_t *trace, struct timeval tv)
 

move the pointer within the trace.

Returns:
0 on success, -1 on failure. The next packet returned by read_packet be the first packet in the trace to have a timestamp equal or greater than timestamp.
Note:
this function may be NULL if the format does not support this feature. If the format implements seek_erf and/or seek_seconds then libtrace will call those functions instead.

size_t(* libtrace_format_t::set_capture_length)(struct libtrace_packet_t *packet, size_t size)
 

truncate (snap) the packet

Returns:
the new size
Note:
This callback may be NULL if not supported.

libtrace_direction_t(* libtrace_format_t::set_direction)(libtrace_packet_t *packet, libtrace_direction_t direction)
 

set the direction of this packet

Note:
This callback may be NULL if not supported.

int(* libtrace_format_t::start_input)(libtrace_t *libtrace)
 

start/unpause an trace (or NULL if input not supported)

int(* libtrace_format_t::start_output)(libtrace_out_t *libtrace)
 

start output traces (or NULL if output not supported) There is no pause for output traces, as packets are not arriving asyncronously

struct libtrace_eventobj_t(* libtrace_format_t::trace_event)(libtrace_t *trace, libtrace_packet_t *packet)
 

return the next event from this source

Note:
may be NULL if not supported.

enum base_format_t libtrace_format_t::type
 

the RT protocol type of this module

const char* libtrace_format_t::version
 

the version of this module

int(* libtrace_format_t::write_packet)(libtrace_out_t *libtrace, libtrace_packet_t *packet)
 

write a packet to a trace from the provided packet (or NULL if output not supported)


The documentation for this struct was generated from the following file:
Generated on Thu Jan 3 10:28:49 2008 for WAND Trace processing by  doxygen 1.4.2