aboutsummaryrefslogtreecommitdiffstats
path: root/caputils/capture-pcap-util.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-06-09 23:39:12 -0700
committerAnders Broman <a.broman58@gmail.com>2018-06-10 14:26:37 +0000
commit5ecbcaf483a552a8b78d525b9f32c5cfa575d59c (patch)
tree18d7afa2184d7c2954685d6743e8119676f890f3 /caputils/capture-pcap-util.h
parente0b8837d9a62c7fd5964a7f35ee0dee01002e0ee (diff)
Improve the secondary error messages for pcap errors.
On Windows, if WinPcap isn't installed, warn about that for errors other than failed attempts to start capturing. On HP-UX, if we appear to have an old version of libpcap, warn about that for errors other than failed attempts to start capturing. If we know the error is a permissions problem, don't make suggestions appropriate to other problems. If we know the error is *not* a permissions problem, don't make suggestions appropriate to permissions problems. For permissions problems, or possible permissions problems, on Linux, suggest doing dpkg-reconfigure wireshark-common if you've installed from a package on Debian or a Debian derivative such as Ubuntu. Change-Id: If4aac0343095ac0b984eebc21853920c3b6d3c63 Ping-Bug: 14847 Reviewed-on: https://code.wireshark.org/review/28189 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'caputils/capture-pcap-util.h')
-rw-r--r--caputils/capture-pcap-util.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/caputils/capture-pcap-util.h b/caputils/capture-pcap-util.h
index cfadf3f0bc..b8eb855b0e 100644
--- a/caputils/capture-pcap-util.h
+++ b/caputils/capture-pcap-util.h
@@ -54,10 +54,19 @@ gboolean set_pcap_datalink(pcap_t *pcap_h, int datalink, char *name,
gboolean have_high_resolution_timestamp(pcap_t *pcap_h);
#endif /* HAVE_PCAP_SET_TSTAMP_PRECISION */
+/*
+ * Error values.
+ */
+typedef enum {
+ CAP_DEVICE_OPEN_NO_ERR, /* No error */
+ CAP_DEVICE_OPEN_ERR_PERMISSIONS, /* Error is known to be a permissions error */
+ CAP_DEVICE_OPEN_ERR_NOT_PERMISSIONS, /* Error is known not to be a permissions error */
+ CAP_DEVICE_OPEN_ERR_GENERIC /* Error is not known to be one or the other */
+} cap_device_open_err;
extern if_capabilities_t *get_if_capabilities(interface_options *interface_opts,
- char **err_str);
+ cap_device_open_err *err, char **err_str);
extern pcap_t *open_capture_device(capture_options *capture_opts,
- interface_options *interface_opts, int timeout,
+ interface_options *interface_opts, int timeout, cap_device_open_err *err,
char (*open_err_str)[PCAP_ERRBUF_SIZE]);
#endif /* HAVE_LIBPCAP */