MulticastSocketProtocol.hh

Go to the documentation of this file.
00001 // $Id: MulticastSocketProtocol.hh 1742 2010-11-04 14:51:56Z g0dil $
00002 //
00003 // Copyright (C) 2007
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Stefan Bund <g0dil@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 #ifndef HH_SENF_Socket_Protocols_INet_MulticastSocketProtocol_
00027 #define HH_SENF_Socket_Protocols_INet_MulticastSocketProtocol_ 1
00028 
00029 // Custom includes
00030 #include <senf/Socket/SocketProtocol.hh>
00031 #include "INet4Address.hh"
00032 #include "INet6Address.hh"
00033 
00034 //#include "MulticastSocketProtocol.mpp"
00035 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00036 
00037 namespace senf {
00038 
00040     //\{
00041 
00047     class MulticastSocketProtocol
00048         : public virtual SocketProtocol
00049     {
00050     public:
00051         void broadcastEnabled(bool v) const; 
00052 
00058         bool broadcastEnabled() const;  
00059 
00063         unsigned mcTTL() const;         
00064         void mcTTL(unsigned value) const; 
00065 
00066         bool mcLoop() const;            
00067         void mcLoop(bool value) const;  
00068 
00072         void mcIface(std::string const & iface = std::string()) const;
00074 
00079     };
00080 
00083     class INet4MulticastSocketProtocol
00084         : public MulticastSocketProtocol
00085     {
00086     public:
00087         void mcAddMembership(INet4Address const & mcAddr) const;
00089 
00093         void mcAddMembership(INet4Address const & mcAddr, INet4Address const & localAddr) const;
00095 
00102         void mcAddMembership(INet4Address const & mcAddr, std::string const & iface) const;
00104 
00110         void mcDropMembership(INet4Address const & mcAddr) const;
00112 
00116         void mcDropMembership(INet4Address const & mcAddr, INet4Address const & localAddr)
00117             const;
00119 
00127         void mcDropMembership(INet4Address const & mcAddr, std::string const & iface)
00128             const;
00130 
00136         void mcJoinSSMSource(INet4Address const & group, INet4Address const & source,
00137                              std::string const & iface) const;
00139 
00146         void mcLeaveSSMSource(INet4Address const & group, INet4Address const & source,
00147                               std::string const & iface) const;
00149 
00155     };
00156 
00162     class INet6MulticastSocketProtocol
00163         : public MulticastSocketProtocol
00164     {
00165     public:
00166         void mcAddMembership(INet6Address const & mcAddr) const;
00168 
00172         void mcAddMembership(INet6Address const & mcAddr, std::string const & iface) const;
00174 
00180         void mcDropMembership(INet6Address const & mcAddr) const;
00182 
00186         void mcDropMembership(INet6Address const & mcAddr, std::string const & iface) const;
00188 
00194         void mcJoinSSMSource(INet6Address const & group, INet6Address const & source,
00195                              std::string const & iface) const;
00197 
00205         void mcJoinSSMSource(INet6Address const & group, INet6Address const & source,
00206                              int ifacei = 0) const;
00208 
00216         void mcLeaveSSMSource(INet6Address const & group, INet6Address const & source,
00217                               std::string const & iface) const;
00219 
00225     };
00226 
00227     //\}
00228 }
00229 
00230 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00231 //#include "MulticastSocketProtocol.cci"
00232 //#include "MulticastSocketProtocol.ct"
00233 //#include "MulticastSocketProtocol.cti"
00234 #endif
00235 
00236 
00237 // Local Variables:
00238 // mode: c++
00239 // fill-column: 100
00240 // comment-column: 40
00241 // c-file-style: "senf"
00242 // indent-tabs-mode: nil
00243 // ispell-local-dictionary: "american"
00244 // compile-command: "scons -u test"
00245 // End: