tcpdump mailing list archives

Re: Feature request: time limits


From: Guy Harris <guy () alum mit edu>
Date: Wed, 5 Nov 2003 11:48:55 -0800


On Nov 5, 2003, at 3:47 AM, Rob Quinn wrote:

See patches below for a sample implementation with ualarm
...which isn't necessarily present on all the platforms on which tcpdump runs
(note that it runs on Windows

 Whole seconds are fine if Windows supports alarm().

I'm not sure it does. It might handle that kind of timer stuff differently.

There might also be UNIXes that don't support it, although I think most modern UNIXes have "setitimer()", which you could use directly instead of using "ualarm()", and you could fall back on "alarm()" on UNIXes that lack "setitimer()" (although the UI should reject attempts to set fractional-second time limits on those systems - either anything non-integral, or just limits < 1 second).

I've added that API - "pcap_breakloop()"; it takes as an argument a "pcap_t *", and sets a flag in that "pcap_t" to cause packet capturing loops to be
terminated.

If cleanup() and SIGTERM/INT are going to use this too, the code changes to
support timeouts would still be minimal.

I wasn't saying they wouldn't be.

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: