diff --git a/Examples/MCSniffer/MCSniffer.cc b/Examples/MCSniffer/MCSniffer.cc index 3c85556574bbdef00e1de4d3be67174787cd6dc7..7eecb553ef17b72686856befbdce041ba4b9685c 100644 --- a/Examples/MCSniffer/MCSniffer.cc +++ b/Examples/MCSniffer/MCSniffer.cc @@ -27,26 +27,21 @@ // Custom includes #include <string> #include <fstream> - #include <sys/socket.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <sys/ioctl.h> -#include <linux/sockios.h> // - +#include <linux/sockios.h> #include <string> #include <iostream> #include <iomanip> #include "Socket/UDPSocketHandle.hh" #include "Scheduler/Scheduler.hh" #include "Utils/membind.hh" - #include "Packets/EthernetPacket.hh" - - -//#include "Sniffer.mpp" +//#include "MCSniffer.mpp" #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// diff --git a/Examples/MCSniffer/mcsniffer b/Examples/MCSniffer/mcsniffer deleted file mode 100755 index 4a70ab8260cb00fd347f6ea4b5ac88849b97f394..0000000000000000000000000000000000000000 Binary files a/Examples/MCSniffer/mcsniffer and /dev/null differ diff --git a/Examples/Mainpage.dox b/Examples/Mainpage.dox index 2bd029c62405d0bf4ecce609cbeaa3398d8d2288..002b0e1e4386f66c559fe9160d7c110c6fa96bae 100644 --- a/Examples/Mainpage.dox +++ b/Examples/Mainpage.dox @@ -1,5 +1,4 @@ /** \mainpage Examples - \anchor Examples_Main \ref sniffer */ diff --git a/Examples/Sniffer/Sniffer.cc b/Examples/Sniffer/Sniffer.cc index 40aec9c78b43519b6dba4ac1143de67fb9509759..9cf18838dbb7a53b9c813ba0b509fb29c2c99f95 100644 --- a/Examples/Sniffer/Sniffer.cc +++ b/Examples/Sniffer/Sniffer.cc @@ -118,27 +118,30 @@ class Sniffer senf::PacketSocketHandle sock; public: - Sniffer(std::string const & interface) - { sock.bind(senf::LLSocketAddress(interface)); } + Sniffer(std::string const & interface) + { + sock.bind(senf::LLSocketAddress(interface)); + } - void run() - { - senf::Scheduler::instance().add(sock, senf::membind(&Sniffer::dumpPacket, this)); - senf::Scheduler::instance().process(); - } + void run() + { + senf::Scheduler::instance().add( + sock, senf::membind(&Sniffer::dumpPacket, this)); + senf::Scheduler::instance().process(); + } private: void dumpPacket(senf::FileHandle /* ignored */, senf::Scheduler::EventId event) - { - std::string data (sock.read()); - senf::EthernetPacket::ptr packet ( - senf::Packet::create<senf::EthernetPacket>( - data.begin(), data.end())); - packet->dump(std::cout); - hexdump(packet->last()->begin(), - packet->last()->end()); - std::cout << "\n\n"; - } + { + std::string data (sock.read()); + senf::EthernetPacket::ptr packet ( + senf::Packet::create<senf::EthernetPacket>( + data.begin(), data.end())); + packet->dump(std::cout); + hexdump(packet->last()->begin(), + packet->last()->end()); + std::cout << "\n\n"; + } }; int scheduler_main(int argc, char const * argv[]) diff --git a/Scheduler/Scheduler.hh b/Scheduler/Scheduler.hh index aac4671a62c5aa8b69045d638f6c28e9fc2b6d1f..1887f5deffa51c913fee8ebbe6d3d3266e76f1f0 100644 --- a/Scheduler/Scheduler.hh +++ b/Scheduler/Scheduler.hh @@ -128,7 +128,7 @@ namespace senf { callback will be called for the given type of event on the given arbitrary file-descriptor or handle-like object. If there already is a Callback - register ed for one of the events requested, the new + registered for one of the events requested, the new handler will replace the old one. \param[in] handle file descriptor or handle providing the Handle interface defined above. diff --git a/Socket/SocketHandle.hh b/Socket/SocketHandle.hh index 3f3f88ca58417accfb9e651cbffb523d0105afab..8cd567fd6c98c81bc387b33738bc7d063a4f970a 100644 --- a/Socket/SocketHandle.hh +++ b/Socket/SocketHandle.hh @@ -1,4 +1,4 @@ -// $Id$ +// $Id:SocketHandle.hh 218 2007-03-20 14:39:32Z tho $ // // Copyright (C) 2006 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) @@ -135,6 +135,9 @@ namespace senf { /**< Formats the complete state map value and returns it as a single multi-line string. + param lod level of detail requested. The interpretation + of this value is protocol specific + \implementation This member will be re-implemented in every derived class. See the state() documentation. */