X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FPacketSocketHandle.cc;h=0965aec7ccf9b1743d7ef0312008f9511a5b947a;hb=52a1b4f399650138cdd7f5e111200ac5f6702be3;hp=59bbab0da36a3897120cf08b27d099fcafe21790;hpb=ac6a813d9d99f7add4e13aff7a4bcd314d5604a6;p=senf.git diff --git a/Socket/PacketSocketHandle.cc b/Socket/PacketSocketHandle.cc index 59bbab0..0965aec 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,31 +77,6 @@ prefix_ bool senf::PacketProtocol::eof() return false; } -prefix_ void senf::PacketProtocol::promisc(std::string interface, PromiscMode mode) - const -{ - // 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 @@ -123,5 +100,9 @@ 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" // End: