X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FDefaultBundle%2FUDPPacket.hh;h=e85c182dcf9f2f3be46aff0bd9f78bddb817547c;hb=9a4ab28bb53bc1a7719141a2263282d4cf73b258;hp=dc82ea2ffa2acd0317f435f80cd29fabc0cb5118;hpb=a1a6c76a214ad1935032826713cabaf9ac57bf07;p=senf.git diff --git a/Packets/DefaultBundle/UDPPacket.hh b/Packets/DefaultBundle/UDPPacket.hh index dc82ea2..e85c182 100644 --- a/Packets/DefaultBundle/UDPPacket.hh +++ b/Packets/DefaultBundle/UDPPacket.hh @@ -23,8 +23,8 @@ /** \file \brief UDPPacket public header */ -#ifndef HH_UDPPacket_ -#define HH_UDPPacket_ 1 +#ifndef HH_SENF_Packets_DefaultBundle_UDPPacket_ +#define HH_SENF_Packets_DefaultBundle_UDPPacket_ 1 // Custom includes #include "../../Packets/Packets.hh" @@ -37,7 +37,8 @@ namespace senf { /** \brief Parse a UDP packet Parser implementing the UDP header. The fields implemented are: - + \image html UDPPacket.png + \see UDPPacketType \n RFC 768 */ @@ -52,11 +53,14 @@ namespace senf { SENF_PARSER_FINALIZE(UDPPacketParser); - boost::uint16_t calcChecksum() const; - + boost::uint16_t calcChecksum() const; ///< calculate (pseudo-)header checksum + /**< calculate and return the checksum of the + (pseudo-)header \see \ref senf::IpChecksum */ bool validateChecksum() const { return checksum() == 0u || checksum() == calcChecksum(); - } + } ///< validate header checksum + /**< return \c true if the \ref checksum() "checksum" + field is equal to the \ref calcChecksum() "calculated checksum" */ }; /** \brief UDP packet @@ -67,9 +71,21 @@ namespace senf { \par Fields: \ref UDPPacketParser +
0 | 8 | 16 | +24 | 31 | +
---|---|---|---|---|
\ref UDPPacketParser::source() "Source Port" | +\ref UDPPacketParser::destination() "Destination Port" | +|||
\ref UDPPacketParser::length() "Length" | +\ref UDPPacketParser::checksum() "Checksum" | +