22 #include <boost/io/ios_state.hpp> 45 summer.
feed( ipv4->source().i(),
46 ipv4->source().i() + IPv4Packet::Parser::source_t::fixed_bytes );
48 summer.
feed( ipv4->destination().i(),
57 summer.
feed(boost::uint16_t(
data().size()) & 0xff00);
58 summer.
feed(boost::uint16_t(
data().size()) & 0x00ff);
65 summer.
feed( ipv6->source().i(),
66 ipv6->source().i() + IPv6Packet::Parser::source_t::fixed_bytes );
69 summer.
feed( ipv6->destination().i(),
76 summer.
feed(boost::uint16_t(
data().size()) & 0xff00);
77 summer.
feed(boost::uint16_t(
data().size()) & 0x00ff);
90 summer.
feed(
i(),
i()+16 );
93 boost::uint16_t rv (summer.
sum());
94 return rv ? rv : 0xffffu;
103 boost::io::ios_all_saver ias(os);
108 <<
senf::fieldName(
"acknowledgment number") << p->acknowledgmentnumber() <<
"\n" 118 <<
"0x" << std::hex << std::setw(4) << std::setfill(
'0') << std::right << p->checksum() <<
"\n" 124 p->dataoffset() << p.
size();
125 p->checksum() << p->calcChecksum();
IPv6Packet public header.
Packet packet() const
Get packet this parser is parsing from.
SENF_PACKET_REGISTRY_REGISTER(senf::IPTypes, senf::TCPPacketType::ipType, senf::TCPPacket)
std::string fieldName(std::string const &s)
boost::uint16_t calcChecksum() const
calculate (pseudo-)header checksum
static void finalize(packet p)
Finalize packet.
static const IPTypes::key_t ipType
Protocol specific packet handle.
data_iterator i() const
Return beginning of data to parse.
static void dump(packet p, std::ostream &os)
Dump given TCPPacket in readable form to given output stream.
SENF_PACKET_INSTANTIATE_TEMPLATE(senf::TCPPacket)
size_type size() const
Return size of packet in bytes.
PacketData & data() const
Access the packets raw data container.
IPv4Packet public header.
IP protocol number registry.
boost::uint16_t sum() const
static size_type const fixed_bytes
void feed(boost::uint8_t byte)