X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FPacketSocketHandle.cc;h=7250c8c46249213460a1df739d8df281da57d37c;hb=5fa6100931098291a976040efbedd094ce6bd89b;hp=b995959a12026e6942ab130e9f4c74ff8b82e44f;hpb=032707d24b1059febe83ce56b11fd79df106c6e2;p=senf.git diff --git a/Socket/PacketSocketHandle.cc b/Socket/PacketSocketHandle.cc index b995959..7250c8c 100644 --- a/Socket/PacketSocketHandle.cc +++ b/Socket/PacketSocketHandle.cc @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2006 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) // Stefan Bund @@ -20,7 +20,9 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// Definition of non-inline non-template functions +/** \file + \brief PacketProtocol and PacketSocketHandle non-inline non-template implementation + */ #include "PacketSocketHandle.hh" #include "PacketSocketHandle.ih" @@ -75,33 +77,6 @@ prefix_ bool senf::PacketProtocol::eof() return false; } -prefix_ void senf::PacketProtocol::promisc(std::string interface, PromiscMode mode) - const -{ - /** \bug There are some failures here ... need to investigate */ - - // The interface is really stupid: as far as i understand, it is possible to - // enable PROMISC and ALLMULTI seperately, however PROMISC is really a superset - // of ALLMULTI ... grmpf ... therefore we allways set/reset both to implement sane - // semantics - - struct packet_mreq mreq; - mreq.mr_ifindex = ::if_nametoindex(interface.c_str()); - if (mreq.mr_ifindex == 0) - throw SystemException(EINVAL); - mreq.mr_alen = 0; - - mreq.mr_type = PACKET_MR_PROMISC; - int command = mode == Promiscuous ? PACKET_ADD_MEMBERSHIP : PACKET_DROP_MEMBERSHIP; - if (::setsockopt(body().fd(),SOL_PACKET,command,&mreq,sizeof(mreq)) < 0) - throw SystemException(errno); - - mreq.mr_type = PACKET_MR_ALLMULTI; - command = mode == AllMulticast ? PACKET_ADD_MEMBERSHIP : PACKET_DROP_MEMBERSHIP; - if (::setsockopt(body().fd(),SOL_PACKET,command,&mreq,sizeof(mreq)) < 0) - throw SystemException(errno); -} - prefix_ void senf::PacketProtocol::do_mc_i(std::string interface, detail::LLAddressCopier const & copier, bool add) const @@ -125,5 +100,10 @@ prefix_ void senf::PacketProtocol::do_mc_i(std::string interface, // Local Variables: // mode: c++ +// fill-column: 100 // c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: