aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-12-23 19:50:36 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-12-23 19:50:36 +0000
commitb341f5d61e16bf96687adb03a4df2c93f9806f9b (patch)
tree9768ebc192f8577a9d4650be76e415f705e8dda5 /util.c
parentf16ebe4eb80f8faeb59ca412d8b61f862dd123d4 (diff)
On Linux, try to open the "any" device and, if we can open it, add it to
the end of the list of interfaces on which you can capture. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2774 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'util.c')
-rw-r--r--util.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/util.c b/util.c
index eb85be846e..0bd6787d19 100644
--- a/util.c
+++ b/util.c
@@ -1,7 +1,7 @@
/* util.c
* Utility routines
*
- * $Id: util.c,v 1.47 2000/10/11 07:35:00 guy Exp $
+ * $Id: util.c,v 1.48 2000/12/23 19:50:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -632,6 +632,23 @@ get_interface_list(int *err, char *err_str)
#endif
}
+#ifdef linux
+ /*
+ * OK, maybe we have support for the "any" device, to do a cooked
+ * capture on all interfaces at once.
+ * Try opening it and, if that succeeds, add it to the end of
+ * the list of interfaces.
+ */
+ pch = pcap_open_live("any", MIN_PACKET_SIZE, 0, 0, err_str);
+ if (pch != NULL) {
+ /*
+ * It worked; we can use the "any" device.
+ */
+ il = g_list_insert(il, g_strdup("any"), -1);
+ pcap_close(pch);
+ }
+#endif
+
g_free(ifc.ifc_buf);
close(sock);