Each packet is specified by the following two components:
\see <a href="../../../../HowTos/NewPacket/doc/html/index.html">NewPacket HowTo</a>
The protocol parser is simply a composite parser. It defines all the protocol fields. Additionally, the protocol parser may have additional members which will then be accessible via the \c -> operator of the packet. Possibilities here are e.g. checksum calculation and validation, packet validation as a whole and so on. Defining a protocol parser is quite simple:
There are a lot of other possibilities to define fields. See \ref packetparsermacros for a detailed description of the macro language which is used to define composite parsers. \see \ref packetparsermacros
This is a class which provides all the information needed to integrate the new packet type into the packet library: \li It provides the type of the protocol parser to use \li It provides information on how the next protocol can be found and where the payload resides in this packet \li It provides methods to initialize a new packet and get information about the packet size All this information is provided via static or typedef members.
The definition of senf::EthernetPacket is quite straight forward. This template works for most simple packet types. \see \ref senf::PacketTypeMixin \n \ref senf::PacketTypeBase \n \ref senf::PacketRegistry