Packets: Fix VariantParser invalid parser access bug
[senf.git] / Socket / Protocols / BSDSocketProtocol.hh
index 3b800c1..715837f 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 //
 // Copyright (C) 2006
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-//     Stefan Bund <stefan.bund@fokus.fraunhofer.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
 /** \file
     \brief BSDSocketProtocol public header */
 
-#ifndef HH_BSDSocketProtocol_
-#define HH_BSDSocketProtocol_ 1
+#ifndef HH_SENF_Socket_Protocols_BSDSocketProtocol_
+#define HH_SENF_Socket_Protocols_BSDSocketProtocol_ 1
 
 // Custom includes
-#include <sys/time.h>
 #include "../../Socket/SocketProtocol.hh"
+#include <boost/cstdint.hpp>
 
 //#include "BSDSocketProtocol.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -59,15 +59,42 @@ namespace senf {
                                              forever.
                                              \param[in] enable \c true to activate linger
                                              \param[in] timeout linger timeout in seconds */
-
-        struct timeval timestamp() const; ///< Return packet timestamp of last packet
-                                        /**< The returned timestamp represents the time, at which
-                                             the last network packet passed to the user has been
-                                             received from the network. This allows precise network
-                                             timing.
-                                             \returns timestamp when packet was received 
-                                             \todo Move this to DatagramSocketProtocol class */
-    };
+       boost::uint8_t priority() const;  ///< Get packet priority assigned to outgoing packets
+                                        /**< This call will return the priority value assigned to
+                                             packets sent via this socket. Depending on the
+                                             protocol, this value may also be placed inside the
+                                             packet headers (for IPv4, this is the TOS value).
+                                             \returns current socket priority */
+        void priority(boost::uint8_t value) const; ///< Set packet priority (e.g. TOS)
+                                        /**< Changes the packet queueing priority. Additionally may
+                                             set protocol specific options. For IPv4 sockets, it
+                                             sets the TOS field.
+                                             \param[in] value new socket priority */
+
+        int error() const;              ///< Get and clear pending socket error
+                                        /**< This call will get <em>and clear</em> a pending socket
+                                             error. This includes asynchronous errors received via
+                                             the network (e.g. via ICMP). */
+
+        unsigned rcvbuf() const;        ///< Check receive buffer size
+                                        /**< \returns size of receive buffer in bytes 
+                                             \internal Linux doubles the buffer size internally when
+                                                 changing it to cater for additional space needed by
+                                                 the linux kernel. This call will therefore return
+                                                 only half the value reported by the kernel. */
+        void rcvbuf(unsigned size) const; ///< Change receive buffer size
+                                        /**< \param[in] size new receive buffer size */
+
+        unsigned sndbuf() const;        ///< Check send buffer size
+                                        /**< \returns size of send buffer in bytes 
+                                             \internal Linux doubles the buffer size internally when
+                                                 changing it to cater for additional space needed by
+                                                 the linux kernel. This call will therefore return
+                                                 only half the value reported by the kernel. */
+        void sndbuf(unsigned size) const; ///< Change size of send buffer
+                                        /**< \param[in] size new send buffer size */
+        
+     };
 
     /** \brief Protocol facet providing basic connection oriented BSD socket functions