1 --- savefile.c 2008-10-10 19:42:44.000000000 -0700
2 +++ savefile.c 2008-12-15 08:45:30.000000000 -0800
5 if ((fcode = p->fcode.bf_insns) == NULL ||
6 bpf_filter(fcode, p->buffer, h.len, h.caplen)) {
9 + if (p->rmt_samp.method == PCAP_SAMP_1_EVERY_N)
11 + samp_npkt= (samp_npkt + 1) % p->rmt_samp.value;
13 + // Discard all packets that are not '1 out of N'
18 + if (p->rmt_samp.method == PCAP_SAMP_FIRST_AFTER_N_MS)
20 + // Check if the timestamp of the arrived packet is smaller than our target time
21 + if ( (h.ts.tv_sec < samp_time.tv_sec) ||
22 + ( (h.ts.tv_sec == samp_time.tv_sec) && (h.ts.tv_usec < samp_time.tv_usec) ) )
25 + // The arrived packet is suitable for being sent to the remote host
26 + // So, let's update the target time
27 + samp_time.tv_usec= h.ts.tv_usec + p->rmt_samp.value * 1000;
28 + if (samp_time.tv_usec > 1000000)
30 + samp_time.tv_sec= h.ts.tv_sec + samp_time.tv_usec / 1000000;
31 + samp_time.tv_usec= samp_time.tv_usec % 1000000;
35 +#endif /* HAVE_REMOTE */
37 (*callback)(user, &h, p->buffer);
38 if (++n >= cnt && cnt > 0)