X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Examples%2FSniffer%2FSniffer.cc;h=fbeeab4c3e3398e0f3e88986859208037f44d2ab;hb=1b1d76302a5d61e918ef71f1c8e11f80ac1262e2;hp=f228fe774370ab99d0d20c21577741bd61556560;hpb=66293acca094b2f29e26e70208691db4af274efb;p=senf.git diff --git a/Examples/Sniffer/Sniffer.cc b/Examples/Sniffer/Sniffer.cc index f228fe7..fbeeab4 100644 --- a/Examples/Sniffer/Sniffer.cc +++ b/Examples/Sniffer/Sniffer.cc @@ -1,8 +1,8 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -30,10 +30,10 @@ #include #include #include -#include #include #include #include +#include //#include "Sniffer.mpp" #define prefix_ @@ -69,18 +69,18 @@ class Sniffer senf::PacketSocketHandle sock; public: - Sniffer(std::string const & interface) + Sniffer(std::string const & interface) { - sock.bind(senf::LLSocketAddress(interface)); + sock.bind(senf::LLSocketAddress(interface)); } - void run() + void run() { senf::Scheduler::instance().add( sock, senf::membind(&Sniffer::dumpPacket, this)); senf::Scheduler::instance().process(); } - + private: void dumpPacket(senf::Scheduler::EventId event) { @@ -110,6 +110,9 @@ int scheduler_main(int argc, char const * argv[]) int main(int argc, char const * argv[]) { + std::cout << "Registered packets:\n\n"; + senf::dumpPacketRegistries(std::cout); + if (argc >= 3) if (std::string(argv[1]) == "loop") return loop_main(argc,argv);