X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FPacketSocketHandle.cc;h=f3234acd18df5c8c7735209b06511c0711395077;hb=bf0359f0d094233072c9640abeb72464a0719305;hp=88b8410132fa2956ce0d4f240d99b748748e1c2b;hpb=d0006132bfcb3ab442cf66b600ed3fad36f1ac2c;p=senf.git diff --git a/Socket/PacketSocketHandle.cc b/Socket/PacketSocketHandle.cc index 88b8410..f3234ac 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 @@ -77,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 @@ -127,5 +100,8 @@ 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" // End: