diff options
author | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-09-15 00:18:17 +0000 |
---|---|---|
committer | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-09-15 00:18:17 +0000 |
commit | e0b8cab0cdd6e78db871b149a8bdbf546a4af647 (patch) | |
tree | 88cf3b0551436062acb26b33f60dd27417944d81 /tshark.c | |
parent | 23daeb41aa620ad86538f69a0ca42474f0c0ce61 (diff) |
Add routines under Windows to check if npf.sys is running, and to
fetch the major OS version. If we're running Windows >= 6 (Vista)
_and_ npf.sys isn't running, warn the user in Wireshark and TShark.
Add a recent prefs item to disable the warning in Wireshark.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22877 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -686,6 +686,17 @@ print_current_user() { } } +static void +check_npf_sys() { +#ifdef _WIN32 + /* Warn the user if npf.sys isn't loaded. */ + if (!npf_sys_is_running() && get_os_major_version() >= 6) { + fprintf(stderr, "The NPF driver isn't running. You may have trouble " + "capturing or\nlisting interfaces.\n"); + } +#endif +} + int @@ -966,6 +977,7 @@ main(int argc, char *argv[]) break; case 'D': /* Print a list of capture devices and exit */ #ifdef HAVE_LIBPCAP + check_npf_sys(); status = capture_opts_list_interfaces(FALSE); exit(status); #else @@ -1542,6 +1554,7 @@ main(int argc, char *argv[]) /* if requested, list the link layer types and exit */ if (list_link_layer_types) { + check_npf_sys(); status = capture_opts_list_link_layer_types(&capture_opts, FALSE); exit(status); } @@ -1632,6 +1645,8 @@ capture(void) ld.packet_cb = capture_pcap_cb; + check_npf_sys(); + /* open the "input file" from network interface or capture pipe */ if (!capture_loop_open_input(&capture_opts, &ld, errmsg, sizeof(errmsg), secondary_errmsg, sizeof(secondary_errmsg))) { |