// Custom includes
#include <iomanip>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
#include <boost/io/ios_state.hpp>
#include <senf/Utils/IpChecksum.hh>
#include "EthernetPacket.hh"
#define prefix_
-///////////////////////////////cc.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
namespace {
SENF_PACKET_REGISTRY_REGISTER( senf::EtherTypes, 0x0800, senf::IPv4Packet);
SENF_PACKET_REGISTRY_REGISTER( senf::IpTypes, 4, senf::IPv4Packet); // IP-in-IP encapsulation
}
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::IPv4PacketParser
prefix_ boost::uint16_t senf::IPv4PacketParser::calcChecksum()
return summer.sum();
}
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::IPv4PacketType
prefix_ void senf::IPv4PacketType::dump(packet p, std::ostream & os)
<< senf::fieldName("ttl") << unsigned(p->ttl()) << "\n"
<< senf::fieldName("protocol") << unsigned(p->protocol()) << "\n"
<< senf::fieldName("checksum")
- << "0x" << std::hex << std::setw(4) << std::setfill('0') << p->checksum() << std::dec << "\n"
+ << "0x" << std::hex << std::setw(4) << std::setfill('0') << std::right << p->checksum() << std::dec << "\n"
<< senf::fieldName("source") << p->source() << "\n"
<< senf::fieldName("destination") << p->destination() << "\n";
}
p->checksum() << p->calcChecksum();
}
-///////////////////////////////cc.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
#undef prefix_
\f