PPI: Add missing TargetDgramWriter doku
[senf.git] / Socket / Protocols / Raw / TunTapSocketHandle.cc
index e8c5266..f2be645 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 //
-// Copyright (C) 2006
+// Copyright (C) 2008
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
-//     Stefan Bund <g0dil@berlios.de>
+//     Thorsten Horstmann <tho@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
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
 
-prefix_ std::string senf::TapSocketProtocol::init_client()
+prefix_ void senf::TapSocketProtocol::init_client()
     const
 {
-    return init_client(std::string());
+    init_client(std::string());
 }
 
-prefix_ std::string senf::TapSocketProtocol::init_client(std::string const & interface_name, bool const NO_PI)
+prefix_ void senf::TapSocketProtocol::init_client(std::string const & interface_name, bool NO_PI)
     const
 {
     int f;
@@ -61,19 +61,18 @@ prefix_ std::string senf::TapSocketProtocol::init_client(std::string const & int
         SENF_THROW_SYSTEM_EXCEPTION( "Could not create tap device: ") << ifr.ifr_name << ".";
     ifaceIndex_ = if_nametoindex(ifr.ifr_name);
     fd(f);
-    return ifaceName();
 }
 
 prefix_ unsigned senf::TapSocketProtocol::available()
   const
 {
-  if (! fh().readable())
-      return 0;
-  ssize_t l = ::recv(fd(),0,0,MSG_PEEK | MSG_TRUNC);
-  if (l < 0)
-      //SENF_THROW_SYSTEM_EXCEPTION("");
-      return 1588;
-  return l;
+    if (!fh().readable())
+        return 0;
+    ssize_t l = ::recv(fd(), 0, 0, MSG_PEEK | MSG_TRUNC);
+    if (l < 0)
+        //SENF_THROW_SYSTEM_EXCEPTION("");
+        return 1588;
+    return l;
 }
 
 /*
@@ -98,17 +97,17 @@ prefix_ bool senf::TapSocketProtocol::eof()
 }
 
 prefix_ unsigned int senf::TapSocketProtocol::ifaceIndex()
-       const
+    const
 {
-       return ifaceIndex_;
+    return ifaceIndex_;
 }
 
 prefix_ std::string senf::TapSocketProtocol::ifaceName()
-       const
+    const
 {
-       char buf[IF_NAMESIZE];
-       if_indextoname(ifaceIndex_, buf);
-       return std::string(buf);
+    char buf[IF_NAMESIZE];
+    if_indextoname(ifaceIndex_, buf);
+    return std::string(buf);
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////