The Interpreter Chain
This image depicts a packet with several headers. Each interpreter is responsible for a specific sub-range of the complete packet. This range always includes the packets payload (This is, why we call the data structure interpreter and not header: The interpreter is responsible for interpreting a range of the packet according to a specific protocol), the packet interpreters are nested inside each other.
For each interpreter, this structure automatically divides the packet into three areas (each of which are optional): The header, the payload and the trailer. Every packet will have either a header or a payload section while most don't have a trailer.
As user of the library you always interact with the chain through one (or more) of the interpreters. The interpreter provides methods to traverse to the following or preceding header (interpreter) and provides two levels of access to the packet data: Generic low-level access in the form of an STL compatible sequence and access to the parsed fields which are provided by the parser associated with the concrete packet type.
Classes |
|
struct | senf::DataPacketType |
Generic payload-only packet. More... |
|
class | senf::Packet |
Main Packet class. More... |
|
class | senf::ConcretePacket< PacketType > |
Protocol specific packet handle. More... |
|
class | senf::PacketData |
Packet data STL-sequence view. More... |
|
class | senf::PacketRegistry< Tag > |
Packet registration facility More... |
|
struct | senf::PacketTypeBase |
Helper base-class implementing the PacketType interface. More... |
|
class | senf::PacketTypeMixin< Self, Registry > |
Mixin to provide standard implementations for nextPacketRange and nextPacketType. More... |
|
Defines |
|
#define | SENF_PACKET_REGISTRY_REGISTER(registry, value, type) |
Statically add an entry to a packet registry. |
|
#define | SENF_PACKET_REGISTRY_REGISTER_PRIORITY(registry, value, priority, type) |
Statically add an entry to a packet registry with explicit priority. |
|
Functions |
|
template<class PacketType , class Parser > | |
Parser | senf::operator<< (Parser target, ConcretePacket< PacketType > const &packet) |
Generic parser copying. |
#define | ||||
SENF_PACKET_REGISTRY_REGISTER | ( | registry, | ||
value, | ||||
type | ) | |||
Statically add an entry to a packet registry.
This macro will declare an anonymous global variable in such a way, that constructing this variable will add a registration to the given packet registry.
Definition at line 242 of file PacketRegistry.hh.
#define | ||||
SENF_PACKET_REGISTRY_REGISTER_PRIORITY | ( | registry, | ||
value, | ||||
priority, | ||||
type | ) | |||
Statically add an entry to a packet registry with explicit priority.
This macro will declare an anonymous global variable in such a way, that constructing this variable will add a registration to the given packet registry.
Definition at line 256 of file PacketRegistry.hh.
Parser senf:: | ||||
operator<< | ( | Parser | target, | |
ConcretePacket< PacketType > const & | packet | ) | ||
Generic parser copying.
This operator allows to copy the value of identical parsers. This operation does not depend on the parsers detailed implementation, it will just replace the data bytes of the target parser with those from the source packet.
Definition at line 204 of file Packet.cci.