#include <wscout_pcap_trace.hh>
Public Types | |
enum | link_type { LOOP = 0, EN10MB = 1, EN3MB = 2, AX25 = 3, PRONET = 4, CHAOS = 5, IEEE802 = 6, ARCNET = 7, SLIP = 8, PPP = 9, FDDI = 10, IEEE802_11 = 105, PRISM_HEADER = 119 } |
typedef PacketIterator | iterator |
Public Member Functions | |
Trace (const std::string &) | |
template<typename ProgressInfoSetupType, typename ProgressInfoUpdateType> | |
Trace (const std::string &filename, ProgressInfoSetupType &pi_setup, ProgressInfoUpdateType &pi_update) | |
PacketIterator | operator[] (size_t) |
PacketIterator | end_of_trace () |
size_t | size () const |
link_type | linktype () const |
std::streampos | file_size () const |
const std::string & | file_name () const |
Protected Types | |
enum | { mark_step = 512, junk_len = 4096 } |
Classes | |
struct | interrupted |
A callback asked the trace construction to stop. More... | |
struct | invalid_operation |
A file operation (open, seek, etc.) reported an error. More... | |
struct | PacketIterator |
Iterator over PCAP packets. More... | |
struct | pcap_file_header |
PCAP file format internal header. More... | |
struct | pcap_packet_header |
PCAP file format representation of a packet header. More... |
PCAP packet iterator.
PCAP file link types.
anonymous enum [protected] |
wscout::pcap::Trace::Trace | ( | const std::string & | filename | ) | [inline] |
Construct a trace from a file name.
wscout::pcap::Trace::Trace | ( | const std::string & | filename, | |
ProgressInfoSetupType & | pi_setup, | |||
ProgressInfoUpdateType & | pi_update | |||
) | [inline] |
Construct a trace from a file name, with progress indicator callbacks.
[in] | filename | The file's name. |
[in] | pi_setup | Called before reading packets with two arguments. The first one is the first packet's offset, the last one is the file size. |
[in] | pi_update | Called periodically when reading packets. The current offset in the file is passed as argument. Returns either 0 (continue) or a pointer to a string (stop and throws interrupted(string) ). |
Trace::PacketIterator wscout::pcap::Trace::operator[] | ( | size_t | i | ) |
Get an iterator pointing to a specific packet.
Trace::PacketIterator wscout::pcap::Trace::end_of_trace | ( | ) |
Get an iterator to the end of trace.
size_t wscout::pcap::Trace::size | ( | ) | const |
Get the number of packets in the trace.
Trace::link_type wscout::pcap::Trace::linktype | ( | ) | const |
Get the trace's link type.
std::streampos wscout::pcap::Trace::file_size | ( | ) | const |
Get the trace size in bytes.
const std::string & wscout::pcap::Trace::file_name | ( | ) | const |
Get the trace's name.