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