<div dir="ltr">Hi,<div><br></div><div>"take a look at how tcpdump/WinDump implement -C and -G.  -C is implemented by checking the file size with pcap_dump_ftell(); "<br><div><br></div><div>and then.. i should stop all the recording and start it mannualy again (and loose packets) or their is a way to 'split' the recordings file in a smarter way.</div>
<div><br></div><div>Thanks a lot for the help.</div><div><br></div><div><br><div class="gmail_quote">2011/11/2 Guy Harris <span dir="ltr"><<a href="mailto:guy@alum.mit.edu">guy@alum.mit.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Nov 2, 2011, at 12:25 PM, j.snelders wrote:<br>
<br>
> On Wed, 2 Nov 2011 19:58:23 +0200 Tal Attaly wrote:<br>
>> Hi,<br>
>><br>
>> How can i make an automatic 'split' of the recorded file, so the recording<br>
>> will be saved in multiple files? (For example- start record to a new file<br>
>> as soon as the current file exceeds 25 MB / 60 minutes past)<br>
><br>
</div><div class="im">> Wireshark<br>
> <a href="http://www.wireshark.org/docs/wsug_html_chunked/ChCapCaptureOptions.html" target="_blank">http://www.wireshark.org/docs/wsug_html_chunked/ChCapCaptureOptions.html</a><br>
> Go to:<br>
> Capture | Options<br>
><br>
> Section Capture File(s)<br>
> File: define an outputfile<br>
> Select:<br>
> - Use multiple files<br>
> - Next file every 25 megabyte(s)<br>
> - Next file every 1 hour(s)<br>
> Hit Start<br>
><br>
> TShark<br>
> <a href="http://www.wireshark.org/docs/man-pages/tshark.html" target="_blank">http://www.wireshark.org/docs/man-pages/tshark.html</a><br>
> tshark -i 3 -a duration:3600 -a filesize:25000 -a files:3 -w test-a.pcap<br>
<br>
</div>WinDump<br>
<br>
        see the -C and -G flags:<br>
<br>
                windump -i 3 -C 25 -G 3600 -w test-a.pcap<br>
<br>
        note that "25" means "25,000,000 bytes", not "26,214,400 bytes"<br>
<br>
Your own program<br>
<br>
        take a look at how tcpdump/WinDump implement -C and -G.  -C is implemented by checking the file size with pcap_dump_ftell(); -G is implemented by checking the time before writing each packet (yes, that means that if no packets arrive during an entire -G time period, you will *NOT* get an empty file for that period).<br>

<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Winpcap-users mailing list<br>
<a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><br>
<a href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
</div></div></blockquote></div></div></div></div>