wpl::pkt::stream< Bottom > Struct Template Reference

Packet stream. More...

#include <wipal/pcap/pkt.hh>

Inheritance diagram for wpl::pkt::stream< Bottom >:
wpl::tool::iterable< Bottom > wpl::tool::static_base< Bottom > wpl::pcap::stream< Bottom > wpl::pcap::istream< Bottom > wpl::pcap::file< Bottom > wpl::pcap::indexed_file< Bottom >

List of all members.

Public Types

typedef HIDDEN exact_type
typedef tool::iterable
< exact_type
super_type
typedef HIDDEN iterator
typedef iterator const_iterator
typedef iterator::value_type packet

Public Member Functions

bool swapped () const
pkt::type type () const
void expect (pkt::type t) const
std::ostream & print (std::ostream &) const
std::ostream & print_impl (std::ostream &) const
iterator begin () const
iterator end () const
template<class OutputIterator >
void operator() (const OutputIterator &output) const
template<class O >
void operator() (const O &o) const
template<class F >
void for_each (F &f) const
template<class F >
void for_each (const F &f) const

opt::listmeta ()
const opt::listmeta () const
Apply a function/functor to each element

template<class Functor >
void for_each (Functor &f) const
template<class Functor >
void for_each (const Functor &f) const
Downcast methods

const exact_typeexact () const
exact_typeexact ()
const exact_typeexact_ptr () const
exact_typeexact_ptr ()

Detailed Description

template<class Bottom>
struct wpl::pkt::stream< Bottom >

Packet stream.

This is the base class for all packet streams, e.g. pcap::stream or pcap::file. A packet stream is an iterable object. You may iterate over packets like this:

 // typedef typename pkt::stream<...>::iterator iterator;
 // pkt::stream<...>& s = ...

 for (iterator i = s.begin(); i != s.end(); ++i)
   {
     // Access to i->meta() and i->bytes().
     //
     // *i is of type pkt::packet.
   }

Member Function Documentation

template<class B >
const opt::list & wpl::pkt::stream< B >::meta (  )  const [inline]

Access to the stream metadata.

Todo:
FIXME: Document.
template<class B >
opt::list & wpl::pkt::stream< B >::meta (  )  [inline]

Access to the stream metadata.

Todo:
FIXME: Document.
template<class B >
bool wpl::pkt::stream< B >::swapped (  )  const [inline]

Get the stream's endianness w.r.t.

the host system.

Some packet streams might be encoded with a custom endianness by packet sniffers. This should not impact users in theory because it is up to the stream implementation to decode it. However sometimes the capture system's endianness might affect packet bytes (e.g. Prism headers) and nothing can be done at the stream implementation level to fix this. Thus this function.

template<class B >
pkt::type wpl::pkt::stream< B >::type (  )  const [inline]

Get the stream's link type.

See also:
type.

The documentation for this struct was generated from the following files:

Generated by  doxygen 1.6.2