Add INPUT_FILTER support do Doxygen builder
[senf.git] / Socket / TCPSocketHandle.hh
1 // $Id$
2 //
3 // Copyright (C) 2006 
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 //     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 /** \file
24
25     \todo Implement possibly non-blocking connect and SO_ERROR in the
26     protocol interface
27  */
28
29 #ifndef HH_TCPSocketHandle_
30 #define HH_TCPSocketHandle_ 1
31
32 // Custom includes
33 #include "INetProtocol.hh"
34 #include "TCPProtocol.hh"
35 #include "BSDSocketProtocol.hh"
36 #include "FramingPolicy.hh"
37 #include "CommunicationPolicy.hh"
38 #include "ReadWritePolicy.hh"
39 #include "BufferingPolicy.hh"
40 #include "ProtocolClientSocketHandle.hh"
41 #include "ProtocolServerSocketHandle.hh"
42
43 //#include "TCPSocketHandle.mpp"
44 ///////////////////////////////hh.p////////////////////////////////////////
45
46 namespace senf {
47
48     /// \addtogroup concrete_protocol_group
49     /// @{
50
51     typedef MakeSocketPolicy<
52         INet4AddressingPolicy,
53         StreamFramingPolicy,
54         ConnectedCommunicationPolicy,
55         ReadablePolicy,
56         WriteablePolicy,
57         SocketBufferingPolicy
58         >::policy TCPv4Socket_Policy;   ///< Socket Policy of the TCPv4 Protocol
59
60     /** \brief
61      */
62     class TCPv4SocketProtocol
63         : public ConcreteSocketProtocol<TCPv4Socket_Policy>,
64           public IPv4Protocol, 
65           public TCPProtocol,
66           public BSDSocketProtocol,
67           public AddressableBSDSocketProtocol
68     {
69     public:
70         ///////////////////////////////////////////////////////////////////////////
71         // internal interface
72
73         ///\name Constructors
74         ///@{
75
76         void init_client() const;
77         void init_client(INet4Address const & address) const;
78         void init_server() const;
79         void init_server(INet4Address const & address, unsigned backlog=1) const;
80
81         ///@}
82         ///\name Abstract Interface Implementation
83
84         std::auto_ptr<SocketProtocol> clone() const;
85         
86         ///@}
87     };
88
89     typedef ProtocolClientSocketHandle<TCPv4SocketProtocol> TCPv4ClientSocketHandle;
90     typedef ProtocolServerSocketHandle<TCPv4SocketProtocol> TCPv4ServerSocketHandle;
91
92     typedef MakeSocketPolicy<
93         TCPv4Socket_Policy,
94         INet6AddressingPolicy
95         >::policy TCPv6Socket_Policy;
96
97     class TCPv6SocketProtocol
98         : public ConcreteSocketProtocol<TCPv6Socket_Policy>, 
99           public IPv6Protocol,
100           public TCPProtocol,
101           public BSDSocketProtocol,
102           public AddressableBSDSocketProtocol
103     {
104         /** \todo Implement */
105     };
106
107     typedef ProtocolClientSocketHandle<TCPv6SocketProtocol> TCPv6ClientSocketHandle;
108     typedef ProtocolServerSocketHandle<TCPv6SocketProtocol> TCPv6ServerSocketHandle;
109
110     /// @}
111
112 }
113
114 ///////////////////////////////hh.e////////////////////////////////////////
115 //#include "TCPSocketHandle.cci"
116 //#include "TCPSocketHandle.ct"
117 //#include "TCPSocketHandle.cti"
118 #endif
119
120 \f
121 // Local Variables:
122 // mode: c++
123 // c-file-style: "senf"
124 // End: