Merged revisions 570-572,574-575,578-579,581-595,598-611 via svnmerge from
[senf.git] / Socket / Protocols / DatagramSocketProtocol.cc
similarity index 70%
rename from Socket/Protocols/INet/RawInetProtocol.cc
rename to Socket/Protocols/DatagramSocketProtocol.cc
index e46b50a..196a0b1 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 //
 // Copyright (C) 2007 
-// Fraunhofer Institute for Open Communication Systems (FOKUS) 
-// Competence Center NETwork research (NET), St. Augustin, GERMANY 
-//     David Wagner <dw6@berlios.de>
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+//     Stefan Bund <g0dil@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+/** \file
+    \brief DatagramSocketProtocol non-inline non-template implementation */
 
-#include "RawInetProtocol.hh"
+#include "DatagramSocketProtocol.hh"
+//#include "DatagramSocketProtocol.ih"
 
 // Custom includes
+#include <sys/types.h>
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <sys/ioctl.h>
-#include <linux/sockios.h> // for SIOCINQ / SIOCOUTQ
-#include <net/if.h> // for if_nametoindex
-#include "../../../Socket/SocketHandle.hh"
 
-//#include "UDPProtocol.mpp"
+//#include "DatagramSocketProtocol.mpp"
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
 
-prefix_ unsigned senf::RawInetProtocol::available()
+prefix_ struct timeval senf::DatagramSocketProtocol::timestamp()
     const
 {
-    int n;
-    if (::ioctl(fd(),SIOCINQ,&n) < 0)
+    struct timeval tv;
+    if (::ioctl(fd(), SIOCGSTAMP, &tv) < 0)
         throwErrno();
-    return n;
-}
-
-prefix_ bool senf::RawInetProtocol::eof()
-    const
-{
-    return false;
+    return tv;
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_
-//#include "UDPProtocol.mpp"
+//#include "DatagramSocketProtocol.mpp"
 
 \f
 // Local Variables: