Output Traces

An output Trace is a trace, indentified by a URI, that a python-libtrace progrm can write Packets to.  As with input traces, you must create (output_trace() ) and start (output_trace.start)()  an output trace before you can write Packets to it with output_trace.write_packet().

Class OutputTrace

Global Constants
compression types See the libtrace documentation for more details

NO_COMPRESSION Write uncompressed trace

ZLIB_COMPRESSION Write using zlib compression

BZIP2_COMPRESSION Write using bzip2 compresion

LZO_COMPRESSION Write using LZO compression

Class Methods
output_trace()
output_trace.new(uri) -> aNewOutputTrace

Returns a libtrace OutputTrace object.  The object's name is given by a string containing its URI, e.g. pcapfile:xxx.pcap,  int:eth0, ...
conf_file_flags() output_trace.conf_file_flags(Integer)

Sets file creation flags for an OutputTrace; e.g. O_APPEND or  0iii (linux user/group/other permissions).
Throws a plt_exc_libtrace  exception if the conf  fails.
conf_compress_type()  output_trace.conf_compress_type(compression_type)

Sets the compression type that libtrace will use when writing the OutputTrace.
Throws a plt_exc_libtrace exception if the conf  fails.
conf_compress_level()  output_trace.conf_compress_level(Integer)

Sets the compression level that libtrace will use when writing the OutputTrace.  Higher levels give more compression, but lower writing speed.
Levels may be from 1 (minimum) to  9 (maximum),
the default level is 5.
Throws a plt_exc_libtrace exception if the conf  fails.
start_output() output_trace.start_output()

Starts the sending of packets (from a live inteferace), or opens  a trace file for writing.
Throws a plt_exc_libtrace exception if the start fails.
close_output() output_trace.close_output()

Shuts down a live interface, or closes a trace file.
write_packet()output_trace.write_packet(Packet)

Writes the data from a Packet to an OutputTrace.
Throws a plt_exc_libtrace exception if the write fails.

Nevil Brownlee
Thu, 17 Jul 14 (NZST)