Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / Socket / Protocols / INet / UDPSocketHandle.hh
1 // $Id$
2 //
3 // Copyright (C) 2006
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.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     \brief UDPv4SocketHandle and UDPv6SocketHandle public header
25
26     \todo Implement possibly non-blocking connect and SO_ERROR in the
27     protocol interface
28  */
29
30 #ifndef HH_SENF_Socket_Protocols_INet_UDPSocketHandle_
31 #define HH_SENF_Socket_Protocols_INet_UDPSocketHandle_ 1
32
33 // Custom includes
34 #include "INetAddressing.hh"
35 #include "UDPSocketProtocol.hh"
36 #include "MulticastSocketProtocol.hh"
37 #include <senf/Socket/Protocols/BSDSocketProtocol.hh>
38 #include <senf/Socket/Protocols/DatagramSocketProtocol.hh>
39 #include <senf/Socket/FramingPolicy.hh>
40 #include <senf/Socket/CommunicationPolicy.hh>
41 #include <senf/Socket/ReadWritePolicy.hh>
42 #include <senf/Socket/ProtocolClientSocketHandle.hh>
43
44 //#include "UDPSocketHandle.mpp"
45 //-/////////////////////////////////////////////////////////////////////////////////////////////////
46
47 namespace senf {
48
49     /// \addtogroup concrete_protocol_group
50     //\{
51
52     typedef MakeSocketPolicy<
53         INet4AddressingPolicy,
54         DatagramFramingPolicy,
55         UnconnectedCommunicationPolicy,
56         ReadablePolicy,
57         WriteablePolicy
58         >::policy UDPv4Socket_Policy;   ///< Socket Policy of the UDPv4 Protocol
59
60     /** \brief IPv4 UDP Socket Protocol
61
62         \par Socket Handle typedefs:
63             \ref UDPv4ClientSocketHandle (ProtocolClientSocketHandle)
64
65         \par Policy Interface:
66             ClientSocketHandle::read(), ClientSocketHandle::readfrom(),
67             ClientSocketHandle::writeto(), ClientSocketHandle::bind(), ClientSocketHandle::local()
68
69         \par Address Type:
70             INet4SocketAddress
71
72         UDPv4SocketProtocol provides an internet protocol stream socket based on the UDP protocol
73         and IPv4 addressing.
74
75         This class is utilized as the protocol class of the ProtocolClientSocketHandle
76         via the Socket Handle typedefs above.
77
78         \see UDPv6SocketProtocol
79      */
80     class UDPv4SocketProtocol
81         : public ConcreteSocketProtocol<UDPv4Socket_Policy, UDPv4SocketProtocol>,
82           public UDPSocketProtocol,
83           public INet4MulticastSocketProtocol,
84           public BSDSocketProtocol,
85           public DatagramSocketProtocol,
86           public AddressableBSDSocketProtocol
87     {
88     public:
89         //-////////////////////////////////////////////////////////////////////////
90         // internal interface
91
92         ///\name Constructors
93         //\{
94
95         void init_client() const;       ///< Create unconnected client socket
96                                         /**< \note This member is implicitly called from the
97                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
98                                              constructor */
99         void init_client(INet4SocketAddress const & address) const;
100                                         ///< Create client socket and bind
101                                         /**< Creates a new client socket and bind to the given
102                                              address.
103                                              \param[in] address local address to bind to */
104                                         /**< \note This member is implicitly called from the
105                                             ProtocolClientSocketHandle::ProtocolClientSocketHandle()
106                                              constructor */
107
108         //\}
109
110     };
111
112     typedef ProtocolClientSocketHandle<UDPv4SocketProtocol> UDPv4ClientSocketHandle;
113
114     typedef MakeSocketPolicy<
115         UDPv4Socket_Policy,
116         INet6AddressingPolicy
117         >::policy UDPv6Socket_Policy;
118
119     /** \brief IPv6 UDP Socket Protocol
120
121         \par Socket Handle typedefs:
122         \ref UDPv6ClientSocketHandle (ProtocolClientSocketHandle)
123
124         \par Policy Interface:
125             ClientSocketHandle::read(), ClientSocketHandle::readfrom(),
126             ClientSocketHandle::writeto(), ClientSocketHandle::bind(), ClientSocketHandle::local()
127
128         \par Address Type:
129             INet6Address
130
131         UDPv6SocketProtocol provides an internet protocol stream socket based on the UDP protocol
132         and IPv6 addressing.
133
134         This class is utilized as the protocol class of the ProtocolClientSocketHandle
135         via the Socket Handle typedefs above.
136
137         \see UDPv4SocketProtocol
138      */
139     class UDPv6SocketProtocol
140         : public ConcreteSocketProtocol<UDPv6Socket_Policy, UDPv6SocketProtocol>,
141           public UDPSocketProtocol,
142           public INet6MulticastSocketProtocol,
143           public BSDSocketProtocol,
144           public DatagramSocketProtocol,
145           public AddressableBSDSocketProtocol
146     {
147     public:
148         //-////////////////////////////////////////////////////////////////////////
149         // internal interface
150
151         ///\name Constructors
152         //\{
153
154         void init_client() const;       ///< Create unconnected client socket
155                                         /**< \note This member is implicitly called from the
156                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
157                                              constructor */
158         void init_client(INet6SocketAddress const & address) const;
159                                         ///< Create client socket and connect
160                                         /**< Creates a new client socket and bind to the given
161                                              address.
162                                              \param[in] address local address to bind to */
163                                         /**< \note This member is implicitly called from the
164                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
165                                              constructor */
166
167         //\}
168     };
169
170     typedef ProtocolClientSocketHandle<UDPv6SocketProtocol> UDPv6ClientSocketHandle;
171
172     //\}
173
174 }
175
176 //-/////////////////////////////////////////////////////////////////////////////////////////////////
177 //#include "UDPSocketHandle.cci"
178 //#include "UDPSocketHandle.ct"
179 //#include "UDPSocketHandle.cti"
180 #endif
181
182 \f
183 // Local Variables:
184 // mode: c++
185 // fill-column: 100
186 // c-file-style: "senf"
187 // indent-tabs-mode: nil
188 // ispell-local-dictionary: "american"
189 // compile-command: "scons -u test"
190 // comment-column: 40
191 // End: