5d1f44b794a7e3804e3a2371989c46694046d5cc
[senf.git] / Socket / Protocols / INet / INetProtocol.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 IPv[46]Protocol public header
25
26     \todo what about OOB data?
27
28     \todo Implement IP_RECVERR / MSG_ERRQUEUE. This should be placed
29     into an additional protocol facet since IP_RECVERR is only valid
30     for SOCK_DGRAM (UDP) and not SOCK_STREAM (TCP) sockets
31  */
32
33 #ifndef HH_INetProtocol_
34 #define HH_INetProtocol_ 1
35
36 // Custom includes
37 #include "../../../Socket/SocketProtocol.hh"
38 #include "INetAddressing.hh"
39 #include "../../../Socket/ClientSocketHandle.hh"
40 #include "../../../Socket/CommunicationPolicy.hh"
41
42 //#include "INetProtocol.mpp"
43 ///////////////////////////////hh.p////////////////////////////////////////
44
45 namespace senf {
46
47     /// \addtogroup protocol_facets_group
48     /// @{
49
50     /** \brief Protocol facet providing IPv4 Addressing related API
51
52         This protocol facet introduces all the socket api protocol members which are related to IPv4
53         addressing.
54
55         \todo Is it safe, not to allow setting the interface index on add/drop? what does it do
56         (especially if the local address is given ?). What have I been thinking here ???
57
58         \todo connect() is only available on stream sockets. We want to access bind() and connect()
59         via the ClientSocketHandle -> see SocketProtocol todo point
60      */
61     class IPv4Protocol
62         : public virtual SocketProtocol
63     {
64     public:
65         void connect(INet4SocketAddress const & address) const; ///< Connect to remote address
66                                         /**< \todo make this obsolete by allowing access to the
67                                              ClientSocketHandle from ConcreateSocketProtocol
68                                              \param[in] address Address to connect to */
69         void bind(INet4SocketAddress const & address) const; ///< Set local socket address
70                                         /**< \todo make this obsolete by allowing access to the
71                                              ClientSocketHandle from ConcreateSocketProtocol
72                                              \param[in] address Address to set */
73     };
74
75     /** \brief Protocol facet providing IPv6 Addressing related API
76
77         This protocol facet introduces all the socket api protocol members which are related to IPv6
78         addressing.
79      */
80     class IPv6Protocol
81         : public virtual SocketProtocol
82     {
83     public:
84         void connect(INet6SocketAddress const & address) const; ///< Connect to remote address
85                                         /**< \todo make this obsolete by allowing access to the
86                                              ClientSocketHandle from ConcreateSocketProtocol
87                                              \param[in] address Address to connect to */
88         void bind(INet6SocketAddress const & address) const; ///< Set local socket address
89                                         /**< \todo make this obsolete by allowing access to the
90                                              ClientSocketHandle from ConcreateSocketProtocol
91                                              \param[in] address Address to set */
92     };
93
94     /// @}
95
96 }
97
98 ///////////////////////////////hh.e////////////////////////////////////////
99 //#include "INetProtocol.cci"
100 //#include "INetProtocol.ct"
101 //#include "INetProtocol.cti"
102 #endif
103
104 \f
105 // Local Variables:
106 // mode: c++
107 // fill-column: 100
108 // c-file-style: "senf"
109 // indent-tabs-mode: nil
110 // ispell-local-dictionary: "american"
111 // compile-command: "scons -u test"
112 // comment-column: 40
113 // End: