X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FDefaultBundle%2FIpV4Packet.hh;h=9d451c56402cdaee61a9c37d1448e5aa3e94a5ca;hb=e61f824b022bb50e9e04598db860a67b644b6818;hp=4c3d9776860a55c7d01aefd095087c4d35a2ea08;hpb=2d6585ff852e9d282c17003ba1db0b73eb3a8500;p=senf.git diff --git a/Packets/DefaultBundle/IpV4Packet.hh b/Packets/DefaultBundle/IpV4Packet.hh index 4c3d977..9d451c5 100644 --- a/Packets/DefaultBundle/IpV4Packet.hh +++ b/Packets/DefaultBundle/IpV4Packet.hh @@ -31,15 +31,17 @@ namespace senf { - ///\addtogroup protocolbundle_default - ///@{ + /** \brief Parse an IpV4 packet - struct Parse_IpV4 : public PacketParserBase - { - SENF_PACKET_PARSER_NO_INIT(Parse_IpV4); + Parser implementing the IpV4 header. The fields implemented are: - /////////////////////////////////////////////////////////////////////////// + \see IpV4PacketType \n + RFC 791 + \todo Implement options + */ + struct Parse_IpV4 : public PacketParserBase + { typedef Parse_UIntField < 0, 4 > Parse_Version; typedef Parse_UIntField < 4, 8 > Parse_IHL; typedef Parse_UInt8 Parse_8bit; @@ -50,6 +52,10 @@ namespace senf { typedef Parse_UIntField < 3, 16 > Parse_Frag; typedef Parse_UInt32 Parse_32bit; +# ifndef DOXYGEN + + SENF_PACKET_PARSER_NO_INIT(Parse_IpV4); + SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS( ((OverlayField)( version, Parse_Version )) ((Field )( ihl, Parse_IHL )) @@ -66,17 +72,54 @@ namespace senf { ((Field )( source, Parse_32bit )) ((Field )( destination, Parse_32bit )) ); +# else + + Parse_Version version(); + Parse_IHL ihl(); + Parse_8bit tos(); + Parse_16bit length(); + Parse_16bit identifier(); + Parse_R reserved(); + Parse_DF df(); + Parse_MF mf(); + Parse_Frag frag(); + Parse_8bit ttl(); + Parse_8bit protocol(); + Parse_16bit crc(); + Parse_32bit source(); + Parse_32bit destination(); + +# endif + void init() { version() = 4; } }; + /** \brief IP protocol number registry + + This registeres packets with their IP protocol number. + + \see Protocol numbers \n + 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 @@ -96,9 +139,8 @@ namespace senf { static void dump(packet p, std::ostream & os); }; + /** \brief IpV4 packet typedef */ typedef IpV4PacketType::packet IpV4Packet; - - ///@} }