X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FDefaultBundle%2FIPv4Packet.hh;h=e124ee4c6dd01ef9daddbbcced5e133d2523503c;hb=1ac8479aaaa1491e2668c6f09d042ae9de1f2113;hp=496c9b8e4aa7cfcf50b4993684669328d072aaf0;hpb=7baaacae27c02c86ceda5c7ee41d3172d1e23ffa;p=senf.git diff --git a/Packets/DefaultBundle/IPv4Packet.hh b/Packets/DefaultBundle/IPv4Packet.hh index 496c9b8..e124ee4 100644 --- a/Packets/DefaultBundle/IPv4Packet.hh +++ b/Packets/DefaultBundle/IPv4Packet.hh @@ -23,8 +23,8 @@ /** \file \brief IPv4Packet public header */ -#ifndef HH_IPv4Packet_ -#define HH_IPv4Packet_ 1 +#ifndef HH_SENF_Packets_DefaultBundle_IPv4Packet_ +#define HH_SENF_Packets_DefaultBundle_IPv4Packet_ 1 // Custom includes #include "../../Socket/Protocols/INet/INet4Address.hh" @@ -60,6 +60,8 @@ namespace senf { Parser implementing the IPv4 header. + \image html IPv4Packet.png + \see IPv4PacketType \n RFC 791 @@ -76,10 +78,10 @@ namespace senf { SENF_PARSER_FIELD( length, UInt16Parser ); SENF_PARSER_FIELD( identifier, UInt16Parser ); - SENF_PARSER_BITFIELD( reserved, 1, bool ); - SENF_PARSER_BITFIELD( df, 1, bool ); - SENF_PARSER_BITFIELD( mf, 1, bool ); - SENF_PARSER_BITFIELD( frag, 13, unsigned ); + SENF_PARSER_PRIVATE_BITFIELD( reserved, 1, bool ); + SENF_PARSER_BITFIELD ( df, 1, bool ); + SENF_PARSER_BITFIELD ( mf, 1, bool ); + SENF_PARSER_BITFIELD ( frag, 13, unsigned ); SENF_PARSER_FIELD( ttl, UInt8Parser ); SENF_PARSER_FIELD( protocol, UInt8Parser ); @@ -95,11 +97,16 @@ namespace senf { SENF_PARSER_FINALIZE(IPv4PacketParser); - boost::uint16_t calcChecksum() const; + boost::uint16_t calcChecksum() const; ///< calculate header checksum + /**< calculate and return the checksum of the header + \see \ref senf::IpChecksum */ bool validateChecksum() const { return checksum() == calcChecksum(); - } + } ///< validate header checksum + /**< return \c true if the \ref checksum() "checksum" + field is equal to the \ref calcChecksum() + "calculated checksum" */ }; /** \brief IP protocol number registry @@ -114,6 +121,12 @@ namespace senf { }; /** \brief IPv4 packet + + \par Packet type (typedef): + \ref IPv4Packet + + \par Fields: + see \ref IPv4PacketParser
\ref IPv4PacketParser::length() "Length" | ||||||||||||||||||||||||
\ref IPv4PacketParser::identifier() "Identifier" | -\ref IPv4PacketParser::reserved() "R" | +R | \ref IPv4PacketParser::df() "DF" | \ref IPv4PacketParser::mf() "MF" | \ref IPv4PacketParser::frag() "Fragment Offset" | @@ -143,21 +156,13 @@ namespace senf {\ref IPv4PacketParser::destination() "Destination Address" |