// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// Definition of non-inline non-template functions
+/** \file
+ \brief IpV4Packet non-inline non-template implementation */
#include "IpV4Packet.hh"
//#include "IpV4Packet.ih"
///////////////////////////////cc.p////////////////////////////////////////
namespace {
- senf::PacketRegistry<senf::EtherTypes>::RegistrationProxy<senf::IpV4PacketType>
+ senf::PacketRegistry<senf::EtherTypes>::RegistrationProxy<senf::IpV4Packet>
registerIpV4Packet (0x0800);
- senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IpV4PacketType>
+ senf::PacketRegistry<senf::IpTypes>::RegistrationProxy<senf::IpV4Packet>
regsiterIpV4Packet2 (4); // IP-in-IP encapsulation
}
prefix_ void senf::IpV4PacketType::dump(packet p, std::ostream & os)
{
- struct in_addr in;
- in.s_addr = htonl(p->source());
- char buffer[128];
- std::string src (inet_ntop(AF_INET,&in,buffer,128));
- in.s_addr = htonl(p->destination());
- std::string dst (inet_ntop(AF_INET,&in,buffer,128));
os << "Internet protocol Version 4:\n"
<< " version : " << p->version() << "\n"
<< " IHL : " << p->ihl() << "\n"
<< " TTL : " << unsigned(p->ttl()) << "\n"
<< " protocol : " << unsigned(p->protocol()) << "\n"
<< " CRC : " << std::hex << p->crc() << std::dec << "\n"
- << " source : " << src << "\n"
- << " destination : " << dst << "\n";
+ << " source : " << p->source() << "\n"
+ << " destination : " << p->destination() << "\n";
}
///////////////////////////////cc.e////////////////////////////////////////