// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// Custom includes
-#include "../../Packets/Packets.hh"
+/** \file
+ \brief ICMPv6Packet non-inline non-template implementation */
+
#include "ICMPv6Packet.hh"
+//#include "ICMPv6Packet.ih"
+
+// Custom includes
#include <boost/io/ios_state.hpp>
#include "../../Packets/DefaultBundle/IPv6Packet.hh"
#include "../../Utils/IpChecksum.hh"
#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
namespace {
senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::ICMPv6Packet>
registerICMPv6Packet (58);
}
-prefix_ boost::uint16_t senf::ICMPv6PacketParser::calcChecksum() const {
+prefix_ boost::uint16_t senf::ICMPv6PacketParser::calcChecksum()
+ const
+{
senf::IpChecksum summer;
senf::IPv6Packet ipv6 (packet().rfind<senf::IPv6Packet>(senf::nothrow));
+
+ if (! ipv6)
+ return 0u;
summer.feed( ipv6->source().i(),
ipv6->source().i() + senf::IPv6Packet::Parser::source_t::fixed_bytes );
{
boost::io::ios_all_saver ias(os);
os << "ICMPv6 protocol:\n"
- << "Type : " << p->type() <<"\n"
- << "Code : " << p->code() <<"\n"
- << "Checksum : " << p->checksum() << "\n";
+ << " type : " << p->type() <<"\n"
+ << " code : " << p->code() <<"\n"
+ << " checksum : " << p->checksum() << "\n";
}
+///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
+
+\f
+// Local Variables:
+// mode: c++
+// fill-column: 100
+// c-file-style: "senf"
+// indent-tabs-mode: nil
+// ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
+// End: