Interface for protocol header widgets. More...
#include <wscout_gui_abstract_header.hh>
Public Types | |
typedef std::pair < protocol::id, const void * > | next_header |
typedef wpl::pcap::indexed_file::packet | packet |
Public Member Functions | |
virtual | ~AbstractHeader () |
virtual next_header | setup (const void *bytes, size_t caplen, const Trace &trace, const packet &desc)=0 |
Interface for protocol header widgets.
WScout models packets as a list of protocol headers. Each header is a Qt Widget that gets embedded inside the packet widget (Packet). In order to have Packet be independent of protocols, each protocol must satisfy a unified interface. AbstractHeader specify this interface.
To implement a new protocol, subclass HeaderBase and implement setup().
typedef std::pair<protocol::id, const void*> wscout::gui::AbstractHeader::next_header |
Identify this header's next header.
The first element specifies the next header's protocol. The second one points to the next header's beginning of data.
If there is no next protocol, use protocol::NONE. If the next protocol is unknown, use protocol::UNKNOWN.
typedef wpl::pcap::indexed_file ::packet wscout::gui::AbstractHeader::packet |
Frame descriptor type used by setup().
wscout::gui::AbstractHeader::~AbstractHeader | ( | ) | [virtual] |
Default destructor.
virtual next_header wscout::gui::AbstractHeader::setup | ( | const void * | bytes, | |
size_t | caplen, | |||
const Trace & | trace, | |||
const packet & | desc | |||
) | [pure virtual] |
Setup the widget for a specific packet.
This method is purely abstract. You must define it when subclassing.
[in] | packet | Pointer to the packet's begining. |
[in] | caplen | Number of availabe bytes for this packet. |
[in] | trace | Packet's corresponding gui::Trace. |
[in] | desc | Packet's corresponding frame descriptor. |
Implemented in wscout::gui::AVSHeader, wscout::gui::IEEE80211BeaconHeader, wscout::gui::IEEE80211Header, wscout::gui::IPv4Header, wscout::gui::IPv6Header, wscout::gui::LLCHeader, wscout::gui::PcapHeader, and wscout::gui::PrismHeader.
Referenced by wscout::gui::Packet::setup().