diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-12-23 16:08:40 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-12-23 16:08:40 +0000 |
commit | 33ccd714ea9469b5b7d3b36bbe468ba1b0f31dfc (patch) | |
tree | 833e8c3331b1f2d9a3e16c131852bf7fe1a00998 /iface.h | |
parent | 2095aa52444f9ab598475ddcf8ca1773a02f8e13 (diff) |
initial commit
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@3 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'iface.h')
-rw-r--r-- | iface.h | 63 |
1 files changed, 63 insertions, 0 deletions
@@ -0,0 +1,63 @@ +#ifndef fooifacehfoo +#define fooifacehfoo + +#include <glib.h> + +#include "address.h" + +struct _flxInterfaceMonitor; +typedef struct _flxInterfaceMonitor flxInterfaceMonitor; + +struct _flxInterfaceAddress; +typedef struct _flxInterfaceAddress flxInterfaceAddress; + +struct _flxInterface; +typedef struct _flxInterface flxInterface; + +struct _flxInterface { + gchar *name; + gint index; + guint flags; + + flxInterfaceAddress *addresses; + flxInterface *next, *prev; +}; + +struct _flxInterfaceAddress { + guchar flags; + guchar scope; + flxAddress address; + + flxInterface *interface; + flxInterfaceAddress *next, *prev; +}; + +typedef enum { FLX_INTERFACE_NEW, FLX_INTERFACE_REMOVE, FLX_INTERFACE_CHANGE } flxInterfaceChange; + +flxInterfaceMonitor *flx_interface_monitor_new(GMainContext *c); +void flx_interface_monitor_free(flxInterfaceMonitor *m); + +const flxInterface* flx_interface_monitor_get_interface(flxInterfaceMonitor *m, gint index); +const flxInterface* flx_interface_monitor_get_first(flxInterfaceMonitor *m); + +void flx_interface_monitor_add_interface_callback( + flxInterfaceMonitor *m, + void (*cb)(flxInterfaceMonitor *m, flxInterfaceChange change, const flxInterface *i, gpointer userdata), + gpointer userdata); + +void flx_interface_monitor_remove_interface_callback( + flxInterfaceMonitor *m, + void (*cb)(flxInterfaceMonitor *m, flxInterfaceChange change, const flxInterface *i, gpointer userdata), + gpointer userdata); + +void flx_interface_monitor_add_address_callback( + flxInterfaceMonitor *m, + void (*cb)(flxInterfaceMonitor *m, flxInterfaceChange change, const flxInterfaceAddress *a, gpointer userdata), + gpointer userdata); + +void flx_interface_monitor_remove_address_callback( + flxInterfaceMonitor *m, + void (*cb)(flxInterfaceMonitor *m, flxInterfaceChange change, const flxInterfaceAddress *a, gpointer userdata), + gpointer userdata); + +#endif |