HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / iface_monitor.h
bloba24c93ef4e94512eea38d1ebbdf3166f4d5af05a
1 /* iface_monitor.h
2 * interface monitor by Pontus Fuchs <pontus.fuchs@gmail.com>
4 * $Id$
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.
24 #ifndef IFACE_MONITOR_H
25 #define IFACE_MONITOR_H
27 #ifdef HAVE_LIBPCAP
30 * Callback for interface changes.
32 * iface is a pointer to the name of the interface.
34 * up is 1 if the interface is up, 0 if it's down.
36 * XXX - we really want "gone", not "down", where "gone" may include
37 * "down" if the OS requires an interface to be up in order to start
38 * a capture on it (as is the case in Linux and in OS X prior to
39 * Lion), but should also include *gone*, as in "there is no longer
40 * an interface with this name, so it's neither down nor up".
42 * We also may want other events, such as address changes, so what
43 * we might want is "add", "remove", and "modify" as the events.
45 typedef void (*iface_mon_cb)(const char *iface, int up);
48 * Start watching for interface changes.
50 int
51 iface_mon_start(iface_mon_cb cb);
54 * Stop watching for interface changes.
56 void
57 iface_mon_stop(void);
60 * Get the socket on which interface changes are delivered, so that
61 * we can add it to the event loop.
63 * XXX - what if it's not a socket or other file descriptor?
65 int
66 iface_mon_get_sock(void);
69 * Call this if something is readable from the interface change socket.
70 * It will call the callback as appropriate.
72 void
73 iface_mon_event(void);
75 #endif /* HAVE_LIBPCAP */
77 #endif /* IFACE_MONITOR_H */