79a514c55669e00bbabc02c74df86abdbfc2bc54
[senf.git] / Socket / INetProtocol.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 what about OOB data? 
26
27     \todo Implement IP_RECVERR / MSG_ERRQUEUE. This should be placed
28     into an additional protocol class since IP_RECVERR is only valid
29     for SOCK_DGRAM (UDP) and not SOCK_STREAM (TCP) sockets
30  */
31
32 #ifndef HH_INetProtocol_
33 #define HH_INetProtocol_ 1
34
35 // Custom includes
36 #include "SocketProtocol.hh"
37 #include "INetAddressing.hh"
38 #include "ClientSocketHandle.hh"
39 #include "CommunicationPolicy.hh"
40
41 //#include "INetProtocol.mpp"
42 ///////////////////////////////hh.p////////////////////////////////////////
43
44 namespace senf {
45
46
47     /** \brief
48
49         \todo Is it safe, not to allow setting the interface index on
50         add/drop? what does it do (especially if the local addres is
51         given ?). What have I been thinking here ???
52        
53         \todo move all multicast-methods into an extra
54         IPv4MulticastProtocol class
55      */
56     class IPv4Protocol 
57         : public virtual SocketProtocol
58     {
59     public:
60         void connect(INet4Address const & address) const;
61         void bind(INet4Address const & address) const;
62
63         unsigned mcTTL() const;
64         void mcTTL(unsigned value) const;
65
66         bool mcLoop() const;
67         void mcLoop(bool value) const;
68
69         void mcAddMembership(INet4Address const & mcAddr) const;
70         void mcAddMembership(INet4Address const & mcAddr, INet4Address const & localAddr) const;
71
72         void mcDropMembership(INet4Address const & mcAddr) const;
73         void mcDropMembership(INet4Address const & mcAddr, INet4Address const & localAddr) const;
74
75         void mcIface(std::string iface = std::string()) const;
76     };
77     
78     class IPv6Protocol
79         : public virtual SocketProtocol
80     {};
81
82 }
83
84 ///////////////////////////////hh.e////////////////////////////////////////
85 //#include "INetProtocol.cci"
86 //#include "INetProtocol.ct"
87 //#include "INetProtocol.cti"
88 #endif
89
90 \f
91 // Local Variables:
92 // mode: c++
93 // c-file-style: "senf"
94 // End: