37 sock.read(packet.data(),0);
38 packet.dump(std::cout);
40 packet.last().data().begin(),
41 packet.last().data().end(),
46 catch (std::exception
const & ex) {
47 std::cerr << senf::prettyName(
typeid(ex)) <<
": " << ex.what() <<
"\n";
60 sock,
senf::scheduler::FdEvent::EV_READ)
67 senf::scheduler::process();
71 void dumpPacket(
int event)
75 sock.read(packet.data(),0);
76 packet.dump(std::cout);
78 packet.last().data().begin(),
79 packet.last().data().end(),
91 catch (std::exception
const & ex) {
92 std::cerr << senf::prettyName(
typeid(ex)) <<
": " << ex.what() <<
"\n";
97 int main(
int argc,
char const * argv[])
99 std::cout <<
"Registered packets:\n\n";
100 senf::dumpPacketRegistries(std::cout);
103 if (std::string(argv[1]) ==
"loop")
105 else if (std::string(argv[1]) ==
"scheduler")
109 std::cerr <<
"Usage: sniffer { loop | scheduler } [interface]" << std::endl;
int loop_main(int argc, char const *argv[])
boost::function< R(Args)> membind(R(T::*fn)(Args), T *ob)
int main(int argc, char const *argv[])
Sniffer(std::string const &interface)
ProtocolClientSocketHandle< PacketSocketProtocol > PacketSocketHandle
int scheduler_main(int argc, char const *argv[])
ConcretePacket< EthernetPacketType > EthernetPacket