#include "version_info.h"
#include "capture-pcap-util.h"
+#ifdef _WIN32
+#include "capture-wpcap.h"
+#endif /* _WIN32 */
#include "pcapio.h"
output = stdout;
fprintf(output,
"Dumpcap " VERSION "%s\n"
- "Capture network packets and dump them into a libpcap file.\n"
+ "Capture network packets and dump them into a pcapng file.\n"
"See http://www.wireshark.org for more information.\n",
wireshark_svnversion);
} else {
fprintf(output, " -b <ringbuffer opt.> ... duration:NUM - switch to next file after NUM secs\n");
fprintf(output, " filesize:NUM - switch to next file after NUM KB\n");
fprintf(output, " files:NUM - ringbuffer: replace after NUM files\n");
- fprintf(output, " -n use pcapng format instead of pcap\n");
+ fprintf(output, " -n use pcapng format instead of pcap (default)\n");
+ fprintf(output, " -P use libpcap format instead of pcapng\n");
fprintf(output, "\n");
fprintf(output, "Miscellaneous:\n");
fprintf(output, " -t use a separate thread per interface\n");
fprintf(output, " -v print version information and exit\n");
fprintf(output, " -h display this help and exit\n");
fprintf(output, "\n");
- fprintf(output, "Example: dumpcap -i eth0 -a duration:60 -w output.pcap\n");
- fprintf(output, "\"Capture network packets from interface eth0 until 60s passed into output.pcap\"\n");
+ fprintf(output, "Example: dumpcap -i eth0 -a duration:60 -w output.pcapng\n");
+ fprintf(output, "\"Capture network packets from interface eth0 until 60s passed into output.pcapng\"\n");
fprintf(output, "\n");
fprintf(output, "Use Ctrl-C to stop capturing at any time.\n");
}
libpcap_warn = "";
g_snprintf(errmsg, (gulong) errmsg_len,
"The capture session could not be initiated (%s).", open_err_str);
-#ifndef _WIN32
+#ifdef _WIN32
+ if (!has_wpcap) {
+ g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len,
+ "\n"
+ "In order to capture packets, WinPcap must be installed; see\n"
+ "\n"
+ " http://www.winpcap.org/\n"
+ "\n"
+ "or the mirror at\n"
+ "\n"
+ " http://www.mirrors.wiretapped.net/security/packet-capture/winpcap/\n"
+ "\n"
+ "or the mirror at\n"
+ "\n"
+ " http://winpcap.cs.pu.edu.tw/\n"
+ "\n"
+ "for a downloadable version of WinPcap and for instructions on how to install\n"
+ "WinPcap.");
+ } else {
+ g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len,
+ "\n"
+ "Please check that \"%s\" is the proper interface.\n"
+ "\n"
+ "\n"
+ "Help can be found at:\n"
+ "\n"
+ " http://wiki.wireshark.org/WinPcap\n"
+ " http://wiki.wireshark.org/CaptureSetup\n",
+ iface);
+ }
+#else
g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len,
"Please check to make sure you have sufficient permissions, and that you have "
"the proper interface or pipe specified.%s", libpcap_warn);
-#else
- g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len,
- "\n"
- "Please check that \"%s\" is the proper interface.\n"
- "\n"
- "\n"
- "Help can be found at:\n"
- "\n"
- " http://wiki.wireshark.org/WinPcap\n"
- " http://wiki.wireshark.org/CaptureSetup\n",
- iface);
#endif /* _WIN32 */
}
if (if_list == NULL) {
switch (err) {
case CANT_GET_INTERFACE_LIST:
+ case DONT_HAVE_PCAP:
cmdarg_err("%s", err_str);
g_free(err_str);
break;
if (if_list == NULL) {
switch (err) {
case CANT_GET_INTERFACE_LIST:
+ case DONT_HAVE_PCAP:
cmdarg_err("%s", err_str);
g_free(err_str);
exit_main(2);