X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FDefaultBundle%2FUDPPacket.hh;h=456b3259b2a8f0265168be192ba87a73615bb3fc;hb=8674fb1d184e7d620eb7c604957b5b4203df37a6;hp=8b1aa70f996a2a5e6ff357917838c2baa025f4a4;hpb=412024ed31a4ab4eaea7a4165a434f8efebee325;p=senf.git diff --git a/Packets/DefaultBundle/UDPPacket.hh b/Packets/DefaultBundle/UDPPacket.hh index 8b1aa70..456b325 100644 --- a/Packets/DefaultBundle/UDPPacket.hh +++ b/Packets/DefaultBundle/UDPPacket.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 1624 31
\ref UDPPacketParser::source() "Source Port"\ref UDPPacketParser::destination() "Destination Port"
\ref UDPPacketParser::length() "Length"\ref UDPPacketParser::checksum() "Checksum"
+ \par Finalize action: - Set \a length from payload size\n - Calculate \a checksum + \copydetails finalize() \ingroup protocolbundle_default */ @@ -79,16 +95,22 @@ namespace senf { { #ifndef DOXYGEN typedef PacketTypeMixin mixin; - typedef ConcretePacket packet; - typedef UDPPacketParser parser; #endif + typedef ConcretePacket packet; ///< UDP packet typedef + typedef UDPPacketParser parser; ///< typedef to the parser of UDP packet + using mixin::nextPacketRange; using mixin::initSize; using mixin::init; + /** \brief Dump given UDPPacket in readable form to given output stream */ static void dump(packet p, std::ostream & os); - - static void finalize(packet p); + + static void finalize(packet p); ///< Finalize packet. + /**< \li set \ref UDPPacketParser::length() "length" from + payload size + \li calculate and set \ref UDPPacketParser::checksum() + "checksum" */ }; /** \brief UDP packet typedef */ @@ -97,9 +119,7 @@ namespace senf { ///////////////////////////////hh.e//////////////////////////////////////// -#endif -#ifndef SENF_PACKETS_DECL_ONLY -//#include UDPPacket.cci" +//#include "UDPPacket.cci" //#include "UDPPacket.ct" //#include "UDPPacket.cti" #endif