From 33ccd714ea9469b5b7d3b36bbe468ba1b0f31dfc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 23 Dec 2004 16:08:40 +0000 Subject: initial commit git-svn-id: file:///home/lennart/svn/public/avahi/trunk@3 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- iface.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 iface.h (limited to 'iface.h') diff --git a/iface.h b/iface.h new file mode 100644 index 0000000..3476645 --- /dev/null +++ b/iface.h @@ -0,0 +1,63 @@ +#ifndef fooifacehfoo +#define fooifacehfoo + +#include + +#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 -- cgit