static int capture(char *, int);
-static void capture_pcap_cb(guchar *, const struct pcap_pkthdr *,
- const guchar *);
+static void capture_pcap_cb(u_char *, const struct pcap_pkthdr *,
+ const u_char *);
static void report_counts(void);
#ifdef _WIN32
static BOOL WINAPI capture_cleanup(DWORD);
if (print_ver) {
output = stdout;
- fprintf(output, "This is GNU t" PACKAGE " " VERSION "%s"
+ fprintf(output, "This is t" PACKAGE " " VERSION "%s"
"\n (C) 1998-2005 Gerald Combs <gerald@ethereal.com>"
"\n%s\n%s\n",
PACKAGE);
fprintf(output, "\t[ -b <capture ring buffer option> ] ... [ -c <capture packet count> ]\n");
fprintf(output, "\t[ -d %s ] ...\n", decode_as_arg_template);
- fprintf(output, "\t[ -f <capture filter> ] [ -F <output file type> ] [ -i <capture interface> ]\n");
- fprintf(output, "\t[ -N <name resolving flags> ] [ -o <preference setting> ] ... [ -r <infile> ]\n");
- fprintf(output, "\t[ -R <read (display) filter> ] [ -s <capture snaplen> ] [ -t <time stamp format> ]\n");
- fprintf(output, "\t[ -T pdml|ps|psml|text ] [ -w <savefile> ] [ -y <capture link type> ]\n");
- fprintf(output, "\t[ -z <statistics ]\n");
+ fprintf(output, "\t[ -f <capture filter> ] [ -F <output file type> ]\n");
+ fprintf(output, "\t[ -i <capture interface> ] [ -N <name resolving flags> ]\n");
+ fprintf(output, "\t[ -o <preference setting> ] ... [ -r <infile> ]\n");
+ fprintf(output, "\t[ -R <read (display) filter> ] [ -s <capture snaplen> ]\n");
+ fprintf(output, "\t[ -t <time stamp format> ] [ -T pdml|ps|psml|text ]\n");
+ fprintf(output, "\t[ -w <savefile> ] [ -y <capture link type> ] [ -z <statistics> ]\n");
#else
fprintf(output, "\nt%s [ -vh ] [ -lnVx ]\n", PACKAGE);
fprintf(output, "\t[ -d %s ] ...\n", decode_as_arg_template);
fprintf(output, "\t[ -F <output file type> ] [ -N <name resolving flags> ]\n");
- fprintf(output, "\t[ -o <preference setting> ] ... [ -r <infile> ] [ -R <read (display) filter> ]\n");
- fprintf(output, "\t[ -t <time stamp format> ] [ -T pdml|ps|psml|text ] [ -w <savefile> ]\n");
- fprintf(output, "\t[ -z <statistics ]\n");
+ fprintf(output, "\t[ -o <preference setting> ] ... [ -r <infile> ]\n");
+ fprintf(output, "\t[ -R <read (display) filter> ] \t[ -t <time stamp format> ]\n");
+ fprintf(output, "\t[ -T pdml|ps|psml|text ] [ -w <savefile> ] [ -z <statistics ]\n");
#endif
fprintf(output, "Valid file type arguments to the \"-F\" flag:\n");
for (i = 0; i < WTAP_NUM_FILE_TYPES; i++) {
Do, however, warn that WAN devices aren't supported. */
g_snprintf(errmsg, sizeof errmsg,
- "The capture session could not be initiated (%s).\n"
- "Please check that you have the proper interface specified.\n"
- "\n"
- "Note that the WinPcap 2.x version of the driver Ethereal uses for packet\n"
- "capture on Windows doesn't support capturing on PPP/WAN interfaces in\n"
- "Windows NT/2000/XP/2003 Server, and that the WinPcap 3.0 and later versions\n"
- "don't support capturing on PPP/WAN interfaces at all.\n",
+"The capture session could not be initiated (%s).\n"
+"Please check that you have the proper interface specified.\n"
+"\n"
+"Note that version 3.0 of WinPcap, and earlier versions of WinPcap, don't\n"
+"support capturing on PPP/WAN interfaces on Windows NT 4.0 / 2000 / XP /\n"
+"Server 2003.\n"
+"WinPcap 3.1 has support for it on Windows 2000 / XP / Server 2003, but has no\n"
+"support for it on Windows NT 4.0 or Windows Vista (Beta 1).\n",
open_err_str);
goto error;
#else
}
} else {
ld.pdh = wtap_dump_open(save_file, out_file_type,
- ld.linktype, file_snaplen, &err);
+ ld.linktype, file_snaplen, FALSE /* compress */, &err);
}
if (ld.pdh == NULL) {
errmsg, sizeof errmsg);
} else
#endif
- inpkts = pcap_dispatch(ld.pch, pcap_cnt, capture_pcap_cb, (guchar *) &ld);
+ inpkts = pcap_dispatch(ld.pch, pcap_cnt, capture_pcap_cb, (u_char *) &ld);
if (inpkts < 0) {
/* Error from "pcap_dispatch()", or error or "no more packets" from
"pipe_dispatch(). */
}
if (ld.output_to_pipe) {
if (ld.packet_count > packet_count_prev) {
- if (fflush(wtap_dump_file(ld.pdh))) {
- volatile_err = errno;
- ld.go = FALSE;
- }
+ wtap_dump_flush(ld.pdh);
packet_count_prev = ld.packet_count;
}
}
}
static void
-capture_pcap_cb(guchar *user, const struct pcap_pkthdr *phdr,
- const guchar *pd)
+capture_pcap_cb(u_char *user, const struct pcap_pkthdr *phdr,
+ const u_char *pd)
{
struct wtap_pkthdr whdr;
union wtap_pseudo_header pseudo_header;
snapshot_length = WTAP_MAX_PACKET_SIZE;
}
pdh = wtap_dump_open(save_file, out_file_type,
- linktype, snapshot_length, &err);
+ linktype, snapshot_length, FALSE /* compressed */, &err);
if (pdh == NULL) {
/* We couldn't set up to write to the capture file. */
phdr.caplen = rechdr->hdr.incl_len;
phdr.len = rechdr->hdr.orig_len;
- capture_pcap_cb((guchar *)ldat, &phdr, data);
+ capture_pcap_cb((u_char *)ldat, &phdr, data);
ldat->pipe_state = STATE_EXPECT_REC_HDR;
return 1;