Re: [tcpdump-workers] pcap_loop - any other option that won't block

2011-05-05 Thread Gianluca Varenni
@lists.tcpdump.org Subject: [tcpdump-workers] pcap_loop - any other option that won't block while sniffing for infinite time Hi. I am looking to setup a kind of a sniffer manager in C that is cross platform (Windows, Linux). I have everything working in both platforms, with the exception of one thing - the

Re: [tcpdump-workers] pcap_loop - any other option that won't block while sniffing for infinite time

2011-05-05 Thread Guy Harris
On May 5, 2011, at 8:29 AM, Jeff Garrett wrote: > I want to be able to return from Step 2 and say "yes, sniffing was started > successfully" or "no there was an error". I also want the sniffing to occur > infinitely, or until I say stop (via pcap_breakloop() function). > In addition, I want to b

[tcpdump-workers] pcap_loop - any other option that won't block while sniffing for infinite time

2011-05-05 Thread Jeff Garrett
Hi. I am looking to setup a kind of a sniffer manager in C that is cross platform (Windows, Linux). I have everything working in both platforms, with the exception of one thing - the main sniffing loop. So far, the code I have used is nothing that I haven't already seen online in various places.

Re: [tcpdump-workers] pcap_loop

2008-06-03 Thread Guy Harris
khaled wrote: thank you but exist an other methode? You could use pcap_next_ex(), for example. who uses C The tcpdump and Wireshark developers do, to give two examples. The third argument to pcap_loop() isn't only useful for C++; it was, in fact, originally designed for use in C. - This

Re: [tcpdump-workers] pcap_loop

2008-06-03 Thread khaled
thank you but exist an other methode? who uses C 2008/6/3 Michael Krüger <[EMAIL PROTECTED]>: > Am Dienstag, 3. Juni 2008 10:13:49 schrieb m. kh: > > HI > > how to use a the last argument of pcap_loop ? > > in my program i use : > > u_char *user; > > us

Re: [tcpdump-workers] pcap_loop

2008-06-03 Thread Eloy Paris
On Tue, Jun 03, 2008 at 10:13:49AM +0200, m. kh wrote: > how to use a the last argument of pcap_loop ? > in my program i use : > u_char *user; > user="the message "; > pcap_loop(handle, -1, (pcap_handler) callback , user); > > but

Re: [tcpdump-workers] pcap_loop

2008-06-03 Thread Michael Krüger
Am Dienstag, 3. Juni 2008 10:13:49 schrieb m. kh: > HI > how to use a the last argument of pcap_loop ? > in my program i use : > u_char *user; > user="the message "; > pcap_loop(handle, -1, (pcap_handler) callback , user); > > but no

[tcpdump-workers] pcap_loop

2008-06-03 Thread m. kh
HI how to use a the last argument of pcap_loop ? in my program i use : u_char *user; user="the message "; pcap_loop(handle, -1, (pcap_handler) callback , user); but not succe ,help me give me example ? - This is the tcpdump-workers l

Re: [tcpdump-workers] pcap_loop() not returning after

2006-06-27 Thread David Rosal
Richard Hansen wrote: If pcap_breakloop() is called in a signal handler, and the signal in question isn't set up to restart system calls, that should let the loop terminate cleanly. If it's not called in a signal handler, i.e. if there's no signal that was delivered to the process, that won't

Re: [tcpdump-workers] pcap_loop() not returning after pcap_breakloop()

2006-06-27 Thread Richard Hansen
> If pcap_breakloop() is called in a signal handler, and the signal in > question isn't set up to restart system calls, that should > let the loop terminate cleanly. If it's not called in a signal > handler, i.e. if there's no signal that was delivered to the process, > that won't help. Can I

Re: [tcpdump-workers] pcap_loop() not returning after pcap_breakloop()

2006-06-27 Thread Guy Harris
Fabian Schneider wrote: I thought (and i have a programm running with this) that you can use the to_ms value in pcap_open_live() to set such a timeout. The value won't be interpreted by some OS'ses like FreeBSD or if you are using the libpcap-mmap patch, resulting in a normal behaviour. But wi

Re: [tcpdump-workers] pcap_loop() not returning after pcap_breakloop()

2006-06-27 Thread Fabian Schneider
Hi, > Expected, yes. Linux's packet capture mechanism doesn't have the timeouts > that the WinPcap driver, BPF, etc. do. I thought (and i have a programm running with this) that you can use the to_ms value in pcap_open_live() to set such a timeout. The value won't be interpreted by some OS'se

Re: [tcpdump-workers] pcap_loop() not returning after pcap_breakloop() until another packet arrives

2006-06-26 Thread Guy Harris
On Jun 24, 2006, at 10:50 PM, Richard Hansen wrote: I have one thread that sits in pcap_loop() and another thread that calls pcap_breakloop() when it is time to shut down. My code works well on Windows (WinPcap 3.1). Well, sort of. I suspect that pcap_breakloop() doesn't *immediately*

[tcpdump-workers] pcap_loop() not returning after pcap_breakloop() until another packet arrives

2006-06-24 Thread Richard Hansen
Hi all, I have one thread that sits in pcap_loop() and another thread that calls pcap_breakloop() when it is time to shut down. My code works well on Windows (WinPcap 3.1). On Linux (libpcap 0.9.4, kernel 2.6.16) the pcap_loop() doesn't return after calling pcap_breakloop() until another pack

Re: [tcpdump-workers] pcap_loop segfaults

2005-06-19 Thread K sPecial
hua Blanton" <[EMAIL PROTECTED]> To: tcpdump-workers@lists.tcpdump.org Subject: Re: [tcpdump-workers] pcap_loop segfaults Date: Sun, 19 Jun 2005 09:20:01 -0400 > > ury segal wrote: > > Just to same you some pain, here is another > > error in your program: Look at your die

Re: [tcpdump-workers] pcap_loop segfaults

2005-06-19 Thread Guy Harris
Joshua Blanton wrote: It does appear that printf doesn't set errno, at least on linux and OSX, It probably will set errno if 1) it gets an error writing to the standard output (e.g., if it's redirected to a file, and the file system is full or you're over quota) or 2) it calls "isatty()

Re: [tcpdump-workers] pcap_loop segfaults

2005-06-19 Thread Joshua Blanton
ury segal wrote: > Just to same you some pain, here is another > error in your program: Look at your die() > function: < code snip > > Once you call fflush() or vfprintf() the value > that was in errno when you called the function > is GONE. errno is a global variable that may be > changed insid

Re: [tcpdump-workers] pcap_loop segfaults

2005-06-18 Thread K sPecial
- Original Message - From: "ury segal" <[EMAIL PROTECTED]> To: tcpdump-workers@lists.tcpdump.org Subject: Re: [tcpdump-workers] pcap_loop segfaults Date: Sun, 19 Jun 2005 02:22:48 -0400 (EDT) > > Just to same you some pain, here is another > error in your

Re: [tcpdump-workers] pcap_loop segfaults

2005-06-18 Thread ury segal
exander medvedev" <[EMAIL PROTECTED]> > To: tcpdump-workers@lists.tcpdump.org > Subject: Re: [tcpdump-workers] pcap_loop segfaults > Date: Sat, 18 Jun 2005 23:26:20 -0500 (CDT) > > > > > hallo, > > > > i didn't go into much detail but for a sta

Re: [tcpdump-workers] pcap_loop segfaults

2005-06-18 Thread K sPecial
odd, yet this yas seemed to fix it, much thanks. - Original Message - From: "alexander medvedev" <[EMAIL PROTECTED]> To: tcpdump-workers@lists.tcpdump.org Subject: Re: [tcpdump-workers] pcap_loop segfaults Date: Sat, 18 Jun 2005 23:26:20 -0500 (CDT) > > hallo, >

Re: [tcpdump-workers] pcap_loop segfaults

2005-06-18 Thread alexander medvedev
hallo, i didn't go into much detail but for a start: i'd make "pcap_t *pfd" global and change: if (!(pcap_open_live(iface, snaplen, 0, -1, errbuf))) to if ((pfd = pcap_open_live(iface, snaplen, 0, -1, errbuf)) != NULL) this should get you started :-) good luck, -alexm 23:16 18/06/2005 On Sun,

[tcpdump-workers] pcap_loop segfaults

2005-06-18 Thread K sPecial
Hello, i'm attempting my first pcap capture, but pcap_loop segfaults, and i'm not quite sure why: -- begin ./sniff output -- xzziroz:/home/kspecial# ./sniff -> successfuly listening on iterface 'eth0' Segmentation fault xzziroz:/home/kspecial# gdb sniff GNU gdb 6.3-debian Copyright 2004 Free Sof

Re: [tcpdump-workers] pcap_loop error

2004-04-21 Thread Christian Kreibich
On Wed, 2004-04-21 at 17:09, Christian Kreibich wrote: > pretty much harmless -- you'll just lose that incomplete last byte in That should have been "packet", sorry. Christian. -- _

Re: [tcpdump-workers] pcap_loop error

2004-04-21 Thread Christian Kreibich
Hi, in the pcap file format, each packet is prefixed by a little header structure that tells pcap details about the following packet. "truncated dump file" means that at the end of the trace, there's a pcap packet header that states that a packet of a size follows that actually is not fully conta

[tcpdump-workers] pcap_loop error

2004-04-21 Thread hela boucetta
hello, I am using tcpdump to capture packets from the netwok. I need to divide traces to incoming and outgoing packets. So I wrote a filter file which contains IP adresses. when I use the command : tcpdump -r tracefile.dump -F filterfile -w traceIn.dump, I got the error message : pcap_loop:trun