diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-08-13 08:17:03 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-08-13 08:17:03 +0000 |
commit | 1c910d808a2e2b56cd3bfd53b76dc69b3a69bcd3 (patch) | |
tree | 1c9cbd1cd618db29600f8857647a5db05e1d9bda /tethereal.c | |
parent | e01997e3d0cce9c97620656f52b31cefb26418a7 (diff) | |
download | wireshark-1c910d808a2e2b56cd3bfd53b76dc69b3a69bcd3.tar.gz wireshark-1c910d808a2e2b56cd3bfd53b76dc69b3a69bcd3.tar.bz2 wireshark-1c910d808a2e2b56cd3bfd53b76dc69b3a69bcd3.zip |
On Win32, if the attempt to open the capture device fails, don't talk
about checking permissions, as the capture devices are probably
available to all users, and talking about permissions will only confuse
the user. Do, however, warn that Ethereal can't capture on Token Ring
or PPP/WAN interfaces.
On UNIX, if the attempt to open the capture device fails, and the error
message starts with "can't find PPA for ", they are probably running on
HP-UX with a version of libpcap not patched to properly look up PPAs for
network interfaces given the interface name; give them a detailed
warning about this, telling them that they'll have to fix libpcap and
build Ethereal from source, and pointing them at the "README.hpux" file.
svn path=/trunk/; revision=2265
Diffstat (limited to 'tethereal.c')
-rw-r--r-- | tethereal.c | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/tethereal.c b/tethereal.c index cebf4b94ff..08f65344f5 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.39 2000/08/11 13:34:49 deniel Exp $ + * $Id: tethereal.c,v 1.40 2000/08/13 08:17:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -514,6 +514,10 @@ capture(int packet_count, int out_file_type) void (*oldhandler)(int); int err, inpkts; char errmsg[1024+1]; +#ifndef _WIN32 + static const char ppamsg[] = "can't find PPA for "; + char *libpcap_warn; +#endif /* Initialize the table of conversations. */ conversation_init(); @@ -528,15 +532,47 @@ capture(int packet_count, int out_file_type) ld.pch = pcap_open_live(cfile.iface, cfile.snap, 1, 1000, err_str); if (ld.pch == NULL) { - /* Well, we couldn't start the capture. - If this is a child process that does the capturing in sync - mode or fork mode, it shouldn't do any UI stuff until we pop up the - capture-progress window, and, since we couldn't start the - capture, we haven't popped it up. */ + /* Well, we couldn't start the capture. */ +#ifdef _WIN32 + /* On Win32 OSes, the capture devices are probably available to all + users; don't warn about permissions problems. + + Do, however, warn that Token Ring and PPP devices aren't supported. */ + 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 driver Ethereal uses for packet capture on Windows\n" + "doesn't support capturing on Token Ring or PPP/WAN interfaces.\n", + err_str); +#else + /* If we got a "can't find PPA for XXX" message, warn the user (who + is running Ethereal on HP-UX) that they don't have a version + of libpcap patched to properly handle HP-UX (the patched version + says "can't find /dev/dlpi PPA for XXX" rather than "can't find + PPA for XXX"). */ + if (strncmp(err_str, ppamsg, sizeof ppamsg - 1) == 0) + libpcap_warn = + "\n\n" + "You are running Ethereal with a version of the libpcap library\n" + "that doesn't handle HP-UX network devices well; this means that\n" + "Ethereal may not be able to capture packets.\n" + "\n" + "To fix this, you will need to download the source to Ethereal\n" + "from ethereal.zing.org if you have not already done so, read\n" + "the instructions in the \"README.hpux\" file in the source\n" + "distribution, download the source to libpcap if you have not\n" + "already done so, patch libpcap as per the instructions, rebuild\n" + "and install libpcap, and then build Ethereal (if you have already\n" + "built Ethereal from source, do a \"make distclean\" and re-run\n" + "configure before building)."; + else + libpcap_warn = ""; snprintf(errmsg, sizeof errmsg, "The capture session could not be initiated (%s).\n" "Please check to make sure you have sufficient permissions, and that\n" - "you have the proper interface specified.", err_str); + "you have the proper interface specified.%s", err_str, libpcap_warn); +#endif goto error; } |