1 #include <iostream> 2 #include <usi++/usi++.h> 3 4 using namespace std; 5 using namespace usipp; 6 main()7int main() 8 { 9 usipp::pcap *wmon = new usipp::pcap; 10 11 if (wmon->init_device("mon0", 1, 1500) < 0) { 12 cerr<<wmon->why()<<endl; 13 return 1; 14 } 15 16 string pkt = "", s = ""; 17 for (;;) { 18 cerr<<"pkt: "<<wmon->sniffpack(pkt).size()<<endl; 19 cerr<<"cooked hdr: "<<wmon->get_cooked(s).size()<<endl 20 <<"frame: "<<wmon->get_frame(s).size()<<endl; 21 } 22 23 return 0; 24 } 25 26 27 28