namespace senf {
- ///\addtogroup protocolbundle_default
- ///@{
+ /** \brief Ethernet MAC address
+
+ The Ethernet MAC is modelled as a fixed-size container/sequence of 6 bytes.
+ \todo Move to someplace else when implementing the addressing classes
+ */
struct MACAddress
: boost::array<PacketParserBase::byte,6>
{
{ virtual char const * what() const throw() { return "invalid mac address syntax"; } };
};
+ /** \brief Parse an Ethernet MAC address
+
+ The ethernet MAC is returned by value as a 6-byte sequence
+
+ \see MACAddress \n
+ EthernetPacket
+ */
struct Parse_MAC : public PacketParserBase
{
Parse_MAC(data_iterator i, state_type s) : PacketParserBase(i,s,fixed_bytes) {}
Parse_MAC const & operator= (value_type const & other) { value(other); return *this; }
};
+
+ /** \brief Parse an Ethernet packet
+
+ Parser implementing an ethernet header. The fields implemented are
+
+ <table class="senf">
+ <tr> <th>Field name</th> <th>Parser type</th> </tr>
+ <tr> <td>destination</td> <td>\ref Parse_MAC</td> </tr>
+ <tr> <td>source</td> <td>\ref Parse_MAC</td> </tr>
+ <tr> <td>type</td> <td>\ref Parse_Type</td> </tr>
+ </table>
+ \see EthernetPacketType
+ */
struct Parse_Ethernet : public PacketParserBase
{
SENF_PACKET_PARSER_INIT(Parse_Ethernet);
((Field)( type, Parse_Type )) );
};
+ /** \brief EtherType registry
+
+ This registry registers packet types with their EtherType number.
+
+ \see <a href="http://www.iana.org/assignments/ethernet-numbers">Ethernet numbers</a>
+ \ref PacketRegistry
+ */
struct EtherTypes {
- // See http://www.iana.org/assignments/ethernet-numbers
+ // See
typedef boost::uint16_t key_t;
};
+ /** \brief Ethernet packet
+
+ \par Packet type (typedef):
+ \ref EthernetPacket
+
+ \par Fields:
+ \ref Parse_Ethernet
+
+ \par Associated registries:
+ \ref EtherTypes
+
+ \ingroup protocolbundle_default
+ */
struct EthernetPacketType
: public PacketTypeBase,
public PacketTypeMixin<EthernetPacketType, EtherTypes>
static void dump(packet p, std::ostream & os);
};
+ /** \brief Ethernet packet typedef */
typedef EthernetPacketType::packet EthernetPacket;
+ /** \brief Parse an ethernet VLAN tag
+
+ Parser interpreting the ethernet VLAN tag. Fields are
+
+ <table class="senf">
+ <tr> <th>Field name</th><th>Parser type</th></tr>
+ <tr><td>priority</td><td>\ref Parse_Priority</td></tr>
+ <tr><td>cfi</td><td>\ref Parse_CFI</td></tr>
+ <tr><td>vlanId</td><td>\ref Parse_VLanId</td></tr>
+ <tr><td>type</td><td>\ref Parse_Type</td></tr>
+ </table>
+
+ \see EthVLanPacketType
+ */
struct Parse_EthVLan : public PacketParserBase
{
SENF_PACKET_PARSER_INIT(Parse_EthVLan);
((Field )( type, Parse_Type )) );
};
+ /** \brief Ethernet VLAN tag
+
+ \par Packet type (typedef):
+ \ref EthVLanPacket
+
+ \par Fields:
+ \ref Parse_EthVLan
+
+ \par Associated registries:
+ \ref EtherTypes
+
+ \ingroup protocolbundle_default
+ */
struct EthVLanPacketType
: public PacketTypeBase,
public PacketTypeMixin<EthVLanPacketType, EtherTypes>
static void dump(packet p, std::ostream & os);
};
+ /** \brief Ethernet VLAN tag typedef */
typedef EthVLanPacketType::packet EthVLanPacket;
-
- ///@}
}
namespace senf {
- ///\addtogroup protocolbundle_default
- ///@{
-
+ /** \brief Parse an IpV4 packet
+
+ Parser implementing the IpV4 header. The fields implemented are:
+
+ <table class="senf">
+ <tr><th>Field name</th><th>Parser type</th></tr>
+ <tr><td>version</td><td>\ref Parse_Version</td></tr>
+ <tr><td>ihl</td><td>\ref Parse_IHL</td></tr>
+ <tr><td>tos</td><td>\ref Parse_8bit</td></tr>
+ <tr><td>length</td><td>\ref Parse_16bit</td></tr>
+ <tr><td>identifier</td><td>\ref Parse_16bit</td></tr>
+ <tr><td>reserved</td><td>\ref Parse_R</td></tr>
+ <tr><td>df</td><td>\ref Parse_DF</td></tr>
+ <tr><td>mf</td><td>\ref Parse_MF</td></tr>
+ <tr><td>frag</td><td>\ref Parse_Frag</td></tr>
+ <tr><td>ttl</td><td>\ref Parse_8bit</td></tr>
+ <tr><td>protocol</td><td>\ref Parse_8bit</td></tr>
+ <tr><td>crc</td><td>\ref Parse_16bit</td></tr>
+ <tr><td>source</td><td>\ref Parse_32bit</td></tr>
+ <tr><td>destination</td><td>\ref Parse_32bit</td></tr>
+ </table>
+
+ \see IpV4PacketType \n
+ <a href="http://tools.ietf.org/html/rfc791">RFC 791</a>
+
+ \todo Implement options
+ */
struct Parse_IpV4 : public PacketParserBase
{
SENF_PACKET_PARSER_NO_INIT(Parse_IpV4);
}
};
+ /** \brief IP protocol number registry
+
+ This registeres packets with their IP protocol number.
+
+ \see <a href="http://www.iana.org/assignments/protocol-numbers">Protocol numbers</a>
+ PacketRegistry
+ */
struct IpTypes {
- // See http://www.iana.org/assignments/protocol-numbers
- // Also used by IPv6
typedef boost::uint16_t key_t;
};
+ /** \brief IpV4 packet
+
+ \par Packet type (typedef):
+ \ref IpV4Packet
+
+ \par Fields:
+ \ref Parse_IpV4
+
+ \par Associated registries:
+ \ref IpTypes
+
+ \ingroup protocolbundle_default
+ */
struct IpV4PacketType
: public PacketTypeBase,
public PacketTypeMixin<IpV4PacketType, IpTypes>
static void dump(packet p, std::ostream & os);
};
+ /** \brief IpV4 packet typedef */
typedef IpV4PacketType::packet IpV4Packet;
-
- ///@}
}
namespace senf {
- ///\addtogroup protocolbundle_default
- ///@{
-
- // See RFC2460
+ /** \brief Parse in IpV6 fragment extension header
+
+ Parser implementing the IpV6 fragment extension. The fields implemented are:
+
+ <table class="senf">
+ <tr><th>Field name</th><th>Parser type</th></tr>
+ <tr><td>nextHeader</td><td>\ref Parse_8bit</td></tr>
+ <tr><td>reserved1</td><td>\ref Parse_8bit</td></tr>
+ <tr><td>fragmentOffset</td><td>\ref Parse_Offset</td></tr>
+ <tr><td>reserved2</td><td>\ref Parse_Reserved</td></tr>
+ <tr><td>moreFragments</td><td>\ref Parse_More</td></tr>
+ <tr><td>id</td><td>\ref Parse_32bit</td></tr>
+ </table>
+
+ \see IpV6ExtensionType_Fragment \n
+ <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
+ */
struct Parse_IpV6Extension_Fragment : public PacketParserBase
{
SENF_PACKET_PARSER_INIT(Parse_IpV6Extension_Fragment);
((Field )( id , Parse_32bit )) );
};
+ /** \brief IpV6 fragment extension
+
+ \par Packet type (typedef):
+ \ref IpV6Extension_Fragment
+
+ \par Fields:
+ \ref Parse_IpV6Extension_Fragment
+
+ \par Associated registries:
+ \par IpTypes
+
+ \ingroup protocolbundle_default
+ */
struct IpV6ExtensionType_Fragment
: public PacketTypeBase,
public PacketTypeMixin<IpV6ExtensionType_Fragment, IpTypes>
static void dump(packet p, std::ostream & os);
};
+ /** \brief IpV6 fragment extension packet typedef */
typedef IpV6ExtensionType_Fragment::packet IpV6Extension_Fragment;
-
- ///@}
}
///////////////////////////////hh.e////////////////////////////////////////
namespace senf {
- ///\addtogroup protocolbundle_default
- ///@{
-
- // See RFC2460
+ /** \brief Parse an IpV6 packet
+
+ Parser implementing the IpV6 header. The fields implemented are:
+
+ <table class="senf">
+ <tr><th>Field name</th><th>Parser type</th></tr>
+ <tr><td>version</td><td>\ref Parse_Version</td></tr>
+ <tr><td>trafficClass</td><td>\ref Parse_Class</td></tr>
+ <tr><td>flowLabel</td><td>\ref Parse_FlowLabel</td></tr>
+ <tr><td>length</td><td>\ref Parse_16bit</td></tr>
+ <tr><td>nextHeader</td><td>\ref Parse_8bit</td></tr>
+ <tr><td>hopLimit</td><td>\ref Parse_8bit</td></tr>
+ <tr><td>source</td><td>\ref Parse_Addr</td></tr>
+ <tr><td>destination</td><td>\ref Parse_Addr</td></tr>
+ </table>
+
+ \see IpV6PacketType \n
+ <a href="http://tools.ietf.org/html/rfc2460">RFC 2460</a>
+ */
struct Parse_IpV6 : public PacketParserBase
{
SENF_PACKET_PARSER_NO_INIT(Parse_IpV6);
}
};
+ /** \brief IpV6 packet
+
+ \par Packet type (typedef):
+ \ref IpV6Packet
+
+ \par Fields:
+ \ref Parse_IpV6
+
+ \par Associated registries:
+ \ref IpTypes
+
+ \ingroup protocolbundle_default
+ */
struct IpV6PacketType
: public PacketTypeBase,
public PacketTypeMixin<IpV6PacketType, IpTypes>
static void dump(packet p, std::ostream & os);
};
+ /** \brief IpV6 packet typedef */
typedef IpV6PacketType::packet IpV6Packet;
///@}
/** \mainpage The Default Bundle
- The default bundle combines a set of basic low level protocols like Ethernet or IP. You can find
- the list of implemented protocols at \ref protocolbundle_default (see the list of typedefs)
+ The default bundle combines a set of basic low level protocols like Ethernet or IP. Find the
+ list of protocols implemented at \ref protocolbundle_default
*/
-/** \defgroup protocolbundle_default Protocols of the default bundle
+/** \defgroup protocolbundle_default Protocols contained in the DefaultBundle
Each protocol consists of several objects
\li The packet \c typedef symbol. This is the only object explicitly accessed from the outside
\li The associated parser object. This is, where the field names are documented
\li The internal packet type object
+
+ Below you find a list of the internal packet type object for each of the implemented
+ protocols. You will never use this type directly, however the documentation will reference the
+ packet typedef to use and will document the parser used to parse the packet's fields.
*/
\f
namespace senf {
- ///\addtogroup protocolbundle_default
- ///@{
+ /** \brief Parse a UDP packet
- // See RFC768
+ Parser implementing the UDP header. The fields implemented are:
+
+ <table class="senf">
+ <tr><th>Field name</th><th>Parser type</th></tr>
+ <tr><td>source</td><td>\ref Parse_16bit</td></tr>
+ <tr><td>destination</td><td>\ref Parse_16bit</td></tr>
+ <tr><td>length</td><td>\ref Parse_16bit</td></tr>
+ <tr><td>crc</td><td>\ref Parse_16bit</td></tr>
+ </table>
+
+ \see UDPPacketType
+ <a href="http://tools.ietf.org/html/rfc768">RFC 768</a>
+ */
struct Parse_UDP : public PacketParserBase
{
SENF_PACKET_PARSER_INIT(Parse_UDP);
((Field)( crc, Parse_16bit )) );
};
+ /** \brief UDP packet
+
+ \par Packet type (typedef):
+ \ref UDPPacket
+
+ \par Fields:
+ \ref Parse_UDP
+
+ \ingroup protocolbundle_default
+ */
struct UDPPacketType
: public PacketTypeBase,
public PacketTypeMixin<UDPPacketType>
static void dump(packet p, std::ostream & os);
};
+ /** \brief UDP packet typedef */
typedef UDPPacketType::packet UDPPacket;
-
- ///@}
}