PPI: Checkin of first compiling (yet not working) version
[senf.git] / Packets / DefaultBundle / IpV4Packet.cc
index 4241379..b88987b 100644 (file)
@@ -20,7 +20,8 @@
 // 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"
@@ -44,12 +45,6 @@ namespace {
 
 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"
@@ -62,8 +57,8 @@ prefix_ void senf::IpV4PacketType::dump(packet p, std::ostream & os)
        << "  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////////////////////////////////////////