Greetings,
can somebody help me?
I am writing some perl scripts (ActivePerl 5.6.1 on a Win2K system) that perform tests on network devices. The basic structure of these scripts is : start (asynchronously) a tethereal capture, perform some operation on devices, stop the trace, analyze the trace.
I'm using the Win32::Process package but the kill method look unreliable (for small traffic the capture file is empty, it looks like tethereal or the underlying libpcap perform a sort of buffering and I don't know how to force a disk write). For longer traces I miss the latest packets and the last packet is almost always corrupted.
Tethereal autostop conditions don't look suitable: in general I cannot predict the running time of the script or the number of packet to capture.
A stop condition triggered by a capture filter would be very helpful, but as far as I know is not implemented yet.
I noticed that typing CTRL-C on the console where tethereal is running make it exit gracefully (but, alas, it's a manual operation).
Thank You

In reply to Reliable tethereal capture by pgb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.