wscout::gui::Packet Class Reference

Packet widget. More...

#include <wscout_gui_packet.hh>

List of all members.

Public Types

typedef
pcap::Trace::iterator::value_type 
packet
typedef
pcap::Trace::link_type 
link_type
typedef
AbstractHeader *(* 
header_allocator )()
typedef std::map
< protocol::id,
header_allocator
protocol_map

Public Slots

void setSelected (bool state=true)

Public Member Functions

 Packet (QWidget *parent=0)
void setup (link_type t, unsigned n, const packet &p)
QBoxLayout * layout ()

Static Public Member Functions

static void registerProtocol (protocol::id, header_allocator)
static protocol_mapprotocols ()


Detailed Description

Packet widget.

Each instance represent a single packet. Protocol header widgets register themselves to this class using the registerProtocol() static method.

See also:
AbstractHeader, HeaderBase

Member Typedef Documentation

typedef pcap::Trace::iterator::value_type wscout::gui::Packet::packet

PCAP packet.

See also:
pcap::Trace::PacketIterator::Packet

typedef pcap::Trace::link_type wscout::gui::Packet::link_type

PCAP link type.

See also:
pcap::Trace::link_type

typedef AbstractHeader*(* wscout::gui::Packet::header_allocator)()

Protocol header widget allocation function.

typedef std::map<protocol::id, header_allocator> wscout::gui::Packet::protocol_map

Map from protocol identifiers to protocol header allocators.


Constructor & Destructor Documentation

wscout::gui::Packet::Packet ( QWidget *  parent = 0  ) 

Default constructor.


Member Function Documentation

void wscout::gui::Packet::setup ( link_type  t,
unsigned  n,
const packet p 
)

Setup the widget for a given link type, sequence number and PCAP packet.

QBoxLayout * wscout::gui::Packet::layout (  ) 

Packet layout.

void wscout::gui::Packet::registerProtocol ( protocol::id  id,
header_allocator  a 
) [static]

Register a protocol header allocator for a given protocol.

All Packet instances share a common structure that maps protocol ids to protocol header allocators. Whenever Packet::setup() encounters a registered protocol, it calls the corresponding allocator to create a protocol header widget to embed.

This function registers protocol ids and header allocators.

See also:
AbstractHeader, header_allocator

Packet::protocol_map & wscout::gui::Packet::protocols (  )  [static]

Get the global protocol map.

Not a static variable to avoid cross-module initialization order issues.

void wscout::gui::Packet::setSelected ( bool  state = true  )  [slot]

Select/unselect the packet.


The documentation for this class was generated from the following files:
Generated on Wed Sep 12 16:02:50 2007 for WScout by  doxygen 1.5.3