22 #include <boost/io/ios_state.hpp> 42 summer.
feed(
i(),
i()+checksum_offset );
43 summer.
feed(
i()+checksum_offset+2,
i()+
bytes(*
this) );
52 boost::io::ios_all_saver ias(os);
53 os <<
"Internet protocol Version 4:\n" 66 <<
"0x" << std::hex << std::setw(4) << std::setfill(
'0') << std::right << p->checksum() << std::dec <<
"\n" 73 p->length() << p.
size();
75 p->checksum() << p->calcChecksum();
static const EtherTypes::key_t etherType
boost::uint16_t calcChecksum() const
calculate header checksum
std::string fieldName(std::string const &s)
static void dump(packet p, std::ostream &os)
Dump given IPv4Packet in readable form to given output stream.
DefaultBundle packet registries public header.
PacketParserBase::size_type bytes(Parser const &p)
Return raw size parsed by the given parser object.
static void finalize(packet p)
Finalize packet.
Protocol specific packet handle.
Packet next() const
Get next packet in chain.
data_iterator i() const
Return beginning of data to parse.
SENF_PACKET_REGISTRY_REGISTER(senf::EtherTypes, senf::IPv4PacketType::etherType, senf::IPv4Packet)
size_type size() const
Return size of packet in bytes.
SENF_PACKET_INSTANTIATE_TEMPLATE(senf::IPv4Packet)
IPv4Packet public header.
void validate(size_type size) const
Validate size of data container.
IP protocol number registry.
boost::uint16_t sum() const
void feed(boost::uint8_t byte)