Packets: Fix VariantParser invalid parser access bug
[senf.git] / Socket / Protocols / INet / TCPSocketHandle.hh
index d0bb8bf..476afad 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
     protocol interface
  */
 
-#ifndef HH_TCPSocketHandle_
-#define HH_TCPSocketHandle_ 1
+#ifndef HH_SENF_Socket_Protocols_INet_TCPSocketHandle_
+#define HH_SENF_Socket_Protocols_INet_TCPSocketHandle_ 1
 
 // Custom includes
-#include "Utils/pool_alloc_mixin.hh"
-#include "INetProtocol.hh"
-#include "TCPProtocol.hh"
-#include "Socket/Protocols/BSDSocketProtocol.hh"
-#include "Socket/FramingPolicy.hh"
-#include "Socket/CommunicationPolicy.hh"
-#include "Socket/ReadWritePolicy.hh"
-#include "Socket/BufferingPolicy.hh"
-#include "Socket/ProtocolClientSocketHandle.hh"
-#include "Socket/ProtocolServerSocketHandle.hh"
+#include "INetSocketProtocol.hh"
+#include "TCPSocketProtocol.hh"
+#include "../../../Socket/Protocols/BSDSocketProtocol.hh"
+#include "../../../Socket/FramingPolicy.hh"
+#include "../../../Socket/CommunicationPolicy.hh"
+#include "../../../Socket/ReadWritePolicy.hh"
+#include "../../../Socket/ProtocolClientSocketHandle.hh"
+#include "../../../Socket/ProtocolServerSocketHandle.hh"
 
 //#include "TCPSocketHandle.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -55,23 +53,21 @@ namespace senf {
         StreamFramingPolicy,
         ConnectedCommunicationPolicy,
         ReadablePolicy,
-        WriteablePolicy,
-        SocketBufferingPolicy
+        WriteablePolicy
         >::policy TCPv4Socket_Policy;   ///< Socket Policy of the TCPv4 Protocol
 
     /** \brief IPv4 TCP Socket Protocol
 
         \par Socket Handle typedefs:
-        \ref TCPv4ClientSocketHandle (ProtocolClientSocketHandle), \ref TCPv4ServerSocketHandle
-        (ProtocolServerSocketHandle)
-
+            \ref TCPv4ClientSocketHandle (ProtocolClientSocketHandle), \ref TCPv4ServerSocketHandle
+            (ProtocolServerSocketHandle)
+        
         \par Policy Interface:
-        ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(),
-        ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer(),
-        ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
+            ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(),
+            ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer()
 
         \par Address Type:
-        INet4Address
+            INet4SocketAddress
 
         TCPv4SocketProtocol provides an internet protocol stream socket based on the TCP protocol
         and IPv4 addressing.
@@ -82,12 +78,10 @@ namespace senf {
         \see TCPv6SocketProtocol
      */
     class TCPv4SocketProtocol
-        : public ConcreteSocketProtocol<TCPv4Socket_Policy>,
-          public IPv4Protocol,
-          public TCPProtocol,
+        : public ConcreteSocketProtocol<TCPv4Socket_Policy,TCPv4SocketProtocol>,
+          public TCPSocketProtocol,
           public BSDSocketProtocol,
-          public AddressableBSDSocketProtocol,
-          public senf::pool_alloc_mixin<TCPv4SocketProtocol>
+          public AddressableBSDSocketProtocol
     {
     public:
         ///////////////////////////////////////////////////////////////////////////
@@ -100,7 +94,7 @@ namespace senf {
                                         /**< \note This member is implicitly called from the
                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
                                              constructor */
-        void init_client(INet4Address const & address) const;
+        void init_client(INet4SocketAddress const & address) const;
                                         ///< Create client socket and connect
                                         /**< Creates a new client socket and connects to the given
                                              address.
@@ -113,7 +107,7 @@ namespace senf {
                                         /**< \note This member is implicitly called from the
                                              ProtocolServerSocketHandle::ProtocolServerSocketHandle()
                                              constructor */
-        void init_server(INet4Address const & address, unsigned backlog=1) const;
+        void init_server(INet4SocketAddress const & address, unsigned backlog=1) const;
                                         ///< Create server socket and listen
                                         /**< Creates a new server socket, binds to \a address end
                                              starts listening for new connections with a backlog of
@@ -126,11 +120,6 @@ namespace senf {
                                              constructor */
 
         ///@}
-        ///\name Abstract Interface Implementation
-
-        std::auto_ptr<SocketProtocol> clone() const;
-
-        ///@}
     };
 
     typedef ProtocolClientSocketHandle<TCPv4SocketProtocol> TCPv4ClientSocketHandle;
@@ -149,11 +138,10 @@ namespace senf {
 
         \par Policy Interface:
         ClientSocketHandle::read(), ClientSocketHandle::write(), ClientSocketHandle::bind(),
-        ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer(),
-        ClientSocketHandle::rcvbuf(), ClientSocketHandle::sndbuf()
+        ClientSocketHandle::local(), ClientSocketHandle::connect(), ClientSocketHandle::peer()
 
         \par Address Type:
-        INet6Address
+            INet6Address
 
         TCPv6SocketProtocol provides an internet protocol stream socket based on the TCP protocol
         and IPv6 addressing.
@@ -164,12 +152,10 @@ namespace senf {
         \see TCPv4SocketProtocol
      */
     class TCPv6SocketProtocol
-        : public ConcreteSocketProtocol<TCPv6Socket_Policy>,
-          public IPv6Protocol,
-          public TCPProtocol,
+        : public ConcreteSocketProtocol<TCPv6Socket_Policy,TCPv6SocketProtocol>,
+          public TCPSocketProtocol,
           public BSDSocketProtocol,
-          public AddressableBSDSocketProtocol,
-          public senf::pool_alloc_mixin<TCPv6SocketProtocol>
+          public AddressableBSDSocketProtocol
     {
     public:
         ///////////////////////////////////////////////////////////////////////////
@@ -208,11 +194,6 @@ namespace senf {
                                              constructor */
 
         ///@}
-        ///\name Abstract Interface Implementation
-
-        std::auto_ptr<SocketProtocol> clone() const;
-
-        ///@}
     };
 
     typedef ProtocolClientSocketHandle<TCPv6SocketProtocol> TCPv6ClientSocketHandle;