Converted from SourceForge issue 1066046, submitted by madwilli
This patch adds the -G |rotate_seconds| flag. The man page and usage() have been update appropriately.
Basically, this adds a flag which specifies how often to stop writing to the current dump file, and create a new one.
For example:
tcpdump -w /tmp/timed_dumps. -G 10
yields
/tmp/timed_dumps.1100413473 /tmp/timed_dumps.1100413483 /tmp/timed_dumps.1100413493 ...
It can be used in conjunction with the -C and -W flags as well. When used with the -C flag and no -W, the patch forces the addition of a 0 for sanity's sake. This can be removed if desired for consistency. The patch also forces a '.' after the time so that sorting isn't broken.
MakeFilename now takes a pointer to a pointer which it allocates for storing the name.
When -W is specified, the number of files created is limited to CFLAG_MAX, otherwise, it will continue to make new files indefinitely.
Other notes:
I could not login to anoncvs, so this is patched against yesterday's release.
Please let me know what should change, etc.
Thanks!
该提问来源于开源项目:the-tcpdump-group/tcpdump