From d6e2dbabccb08970da991e6d2b0fda7a56d83e6f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 18 Jan 2005 00:17:40 +0000 Subject: fold local.c into iface.c git-svn-id: file:///home/lennart/svn/public/avahi/trunk@7 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- iface.h | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) (limited to 'iface.h') diff --git a/iface.h b/iface.h index 49bcf20..90bfc05 100644 --- a/iface.h +++ b/iface.h @@ -3,8 +3,6 @@ #include -#include "address.h" - struct _flxInterfaceMonitor; typedef struct _flxInterfaceMonitor flxInterfaceMonitor; @@ -14,6 +12,22 @@ typedef struct _flxInterfaceAddress flxInterfaceAddress; struct _flxInterface; typedef struct _flxInterface flxInterface; +#include "address.h" +#include "server.h" +#include "netlink.h" + +struct _flxInterfaceMonitor { + flxServer *server; + flxNetlink *netlink; + GHashTable *hash_table; + + flxInterface *interfaces; + + guint query_addr_seq, query_link_seq; + + enum { LIST_IFACE, LIST_ADDR, LIST_DONE } list; +}; + struct _flxInterface { gchar *name; gint index; @@ -32,34 +46,17 @@ struct _flxInterfaceAddress { flxInterface *interface; flxInterfaceAddress *next, *prev; -}; -typedef enum { FLX_INTERFACE_NEW, FLX_INTERFACE_REMOVE, FLX_INTERFACE_CHANGE } flxInterfaceChange; + gint rr_id; +}; -flxInterfaceMonitor *flx_interface_monitor_new(GMainContext *c); +flxInterfaceMonitor *flx_interface_monitor_new(flxServer *server); 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); - +int flx_interface_is_relevant(flxInterface *i); +int flx_address_is_relevant(flxInterfaceAddress *a); + #endif -- cgit