MulticastSocketProtocol.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Socket_Protocols_INet_MulticastSocketProtocol_
18 #define HH_SENF_Socket_Protocols_INet_MulticastSocketProtocol_ 1
19 
20 // Custom includes
22 #include "INet4Address.hh"
23 #include "INet6Address.hh"
24 
25 //#include "MulticastSocketProtocol.mpp"
26 //-/////////////////////////////////////////////////////////////////////////////////////////////////
27 
28 namespace senf {
29 
31  //\{
32 
39  : public virtual SocketProtocol
40  {
41  public:
42  void broadcastEnabled(bool v) const;
43 
49  bool broadcastEnabled() const;
50 
54  unsigned mcTTL() const;
55  void mcTTL(unsigned value) const;
56 
57  bool mcLoop() const;
58  void mcLoop(bool value) const;
59 
63  void mcIface(std::string const & iface = std::string()) const;
65 
70  };
71 
76  {
77  public:
78  void mcAddMembership(INet4Address const & mcAddr) const;
80 
84  void mcAddMembership(INet4Address const & mcAddr, INet4Address const & localAddr) const;
86 
93  void mcAddMembership(INet4Address const & mcAddr, std::string const & iface) const;
95 
101  void mcDropMembership(INet4Address const & mcAddr) const;
103 
107  void mcDropMembership(INet4Address const & mcAddr, INet4Address const & localAddr)
108  const;
110 
118  void mcDropMembership(INet4Address const & mcAddr, std::string const & iface)
119  const;
121 
127  void mcJoinSSMSource(INet4Address const & group, INet4Address const & source,
128  std::string const & iface) const;
130 
137  void mcLeaveSSMSource(INet4Address const & group, INet4Address const & source,
138  std::string const & iface) const;
140 
146  };
147 
154  : public MulticastSocketProtocol
155  {
156  public:
157  void mcAddMembership(INet6Address const & mcAddr) const;
159 
163  void mcAddMembership(INet6Address const & mcAddr, std::string const & iface) const;
165 
171  void mcDropMembership(INet6Address const & mcAddr) const;
173 
177  void mcDropMembership(INet6Address const & mcAddr, std::string const & iface) const;
179 
185  void mcJoinSSMSource(INet6Address const & group, INet6Address const & source,
186  std::string const & iface) const;
188 
196  void mcJoinSSMSource(INet6Address const & group, INet6Address const & source,
197  int ifacei = 0) const;
199 
207  void mcLeaveSSMSource(INet6Address const & group, INet6Address const & source,
208  std::string const & iface) const;
210 
216  };
217 
218  //\}
219 }
220 
221 //-/////////////////////////////////////////////////////////////////////////////////////////////////
222 //#include "MulticastSocketProtocol.cci"
223 //#include "MulticastSocketProtocol.ct"
224 //#include "MulticastSocketProtocol.cti"
225 #endif
226 
227 
228 // Local Variables:
229 // mode: c++
230 // fill-column: 100
231 // comment-column: 40
232 // c-file-style: "senf"
233 // indent-tabs-mode: nil
234 // ispell-local-dictionary: "american"
235 // compile-command: "scons -u test"
236 // End:
Multicast protocol facet for INet4 addressable multicast enabled sockets.
Generic addressing type independent multicast protocol facet.
void mcIface(std::string const &iface=std::string()) const
Set multicast send interface of the socket.
Socket Protocol base class.
INet6Address public header.
bool mcLoop() const
Return current multicast loopback state.
Multicast protocol facet for INet6 addressable multicast enabled sockets.
INet4Address public header.
INet6 network address.
unsigned mcTTL() const
Return current multicast TTL.
IPv4 Internet address.
Definition: INet4Address.hh:78
SocketProtocol and ConcreteSocketProtocol public header.
bool broadcastEnabled() const
Get broadcast send/receive state.