LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   pcap library (http://www.linuxquestions.org/questions/programming-9/pcap-library-316931/)

jagman 04-25-2005 09:04 AM

pcap library
 
Good day to all of you.
My question is about the pcap library.
I want to know how I call the pcap_breakloop to stop the function pcap_loop from grabbing packets.
I want to see an example of the pcap_breakloop function.
thanks

shivaligupta 04-27-2005 08:35 AM

I guess u want to know tht whn it can be used.
eg:

suppose u have added a line in ur code like

pcap_t *pd;
signal(SIGINT,cleanup);

after that u have used pcap_loop. This will run continously. Now if in between SIGINT arises, u may want to stop capturing packets. then in ur cleanup u can pass pd and in it u can add
pcap_breakloop(pd);

This way packet capturing will stop.


All times are GMT -5. The time now is 04:41 AM.