#include <wscout_gui_packet.hh>
Public Types | |
typedef pcapxx::descriptor::iterator::value_type | packet |
typedef pcapxx::descriptor::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 (const Trace &t, const packet &p) |
QBoxLayout * | layout () |
Static Public Member Functions | |
static void | registerProtocol (protocol::id, header_allocator) |
static protocol_map & | protocols () |
Each instance represent a single packet. Protocol header widgets register themselves to this class using the registerProtocol() static method.
typedef pcapxx::descriptor ::iterator::value_type wscout::gui::Packet::packet |
PCAP packet.
typedef pcapxx::descriptor ::link_type wscout::gui::Packet::link_type |
PCAP 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.
wscout::gui::Packet::Packet | ( | QWidget * | parent = 0 |
) | [inline] |
Default constructor.
Setup the widget for a given link type, sequence number and PCAP packet.
QBoxLayout * wscout::gui::Packet::layout | ( | ) | [inline] |
Packet layout.
void wscout::gui::Packet::registerProtocol | ( | protocol::id | id, | |
header_allocator | a | |||
) | [inline, 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.
Packet::protocol_map & wscout::gui::Packet::protocols | ( | ) | [inline, 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 |
) | [inline, slot] |
Select/unselect the packet.