21 #include <boost/io/ios_state.hpp> 36 if (! ipv6)
return 0u;
42 summer.
feed( ipv6->source().i(),
43 ipv6->source().i() + IPv6Packet::Parser::source_t::fixed_bytes );
46 summer.
feed( ipv6->destination().i(),
49 boost::uint32_t size (
data().size());
50 summer.
feed((size>>24)&0xff);
51 summer.
feed((size>>16)&0xff);
52 summer.
feed((size>> 8)&0xff);
53 summer.
feed((size )&0xff);
62 summer.
feed(
i(),
i()+checksum_offset );
65 summer.
feed(
i()+checksum_offset+2,
data().end() );
67 boost::uint16_t rv (summer.
sum());
68 return rv ? rv : 0xffffu;
73 boost::io::ios_all_saver ias(os);
74 os <<
"ICMPv6 protocol:\n" 78 <<
"0x" << std::hex << std::setw(4) << unsigned(p->checksum()) <<
"\n";
IPv6Packet public header.
static void dump(packet p, std::ostream &os)
Packet packet() const
Get packet this parser is parsing from.
std::string fieldName(std::string const &s)
SENF_PACKET_INSTANTIATE_TEMPLATE(senf::ICMPv6Packet)
Protocol specific packet handle.
data_iterator i() const
Return beginning of data to parse.
SENF_PACKET_REGISTRY_REGISTER(senf::IPTypes, senf::ICMPv6PacketType::ipType, senf::ICMPv6Packet)
boost::uint16_t calcChecksum() const
PacketData & data() const
Access the packets raw data container.
ICMPv6Packet public header.
static const IPTypes::key_t ipType
IP protocol number registry.
boost::uint16_t sum() const
static size_type const fixed_bytes
void feed(boost::uint8_t byte)