2 * interface monitor by Pontus Fuchs <pontus.fuchs@gmail.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 #include "../../iface_monitor.h"
35 #include "capture_opts.h"
37 #include "ui/capture_globals.h"
38 #include "ui/iface_lists.h"
40 #include "ui/gtk/capture_dlg.h"
42 GIOChannel *iface_mon_channel;
45 gtk_iface_mon_event_cb(const char *iface, int up)
51 for (ifs = 0; ifs < global_capture_opts.all_ifaces->len; ifs++) {
52 device = g_array_index(global_capture_opts.all_ifaces, interface_t, ifs);
53 if (!strcmp(device.name, iface))
60 refresh_local_interface_lists();
64 gtk_iface_mon_event(GIOChannel *source _U_, GIOCondition condition _U_, gpointer data _U_)
71 gtk_iface_mon_start(void)
74 err = iface_mon_start(>k_iface_mon_event_cb);
77 sock = iface_mon_get_sock();
79 iface_mon_channel = g_io_channel_unix_new(sock);
80 g_io_channel_set_encoding(iface_mon_channel, NULL, NULL);
81 g_io_add_watch(iface_mon_channel,
82 (GIOCondition)(G_IO_IN|G_IO_ERR|G_IO_HUP),
89 gtk_iface_mon_stop(void)
95 #endif /* HAVE_LIBPCAP */