diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-03-25 21:52:55 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-03-25 21:52:55 +0000 |
commit | ad1f9d3725a300f10eca071c6fe2f2c583f51436 (patch) | |
tree | 2ee998675cf21060c657f6611aace02eb9c3e339 /iface.h | |
parent | c8dd2dc8f91a322178c43281cbc5c8fc16da5219 (diff) |
* add announcing/goodbye
* add cache maintaince
* fix a bug in prioq.c
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@16 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'iface.h')
-rw-r--r-- | iface.h | 65 |
1 files changed, 40 insertions, 25 deletions
@@ -3,14 +3,10 @@ #include <glib.h> -struct _flxInterfaceMonitor; typedef struct _flxInterfaceMonitor flxInterfaceMonitor; - -struct _flxInterfaceAddress; typedef struct _flxInterfaceAddress flxInterfaceAddress; - -struct _flxInterface; typedef struct _flxInterface flxInterface; +typedef struct _flxHwInterface flxHwInterface; #include "address.h" #include "server.h" @@ -19,6 +15,7 @@ typedef struct _flxInterface flxInterface; #include "llist.h" #include "psched.h" #include "dns.h" +#include "announce.h" struct _flxInterfaceMonitor { flxServer *server; @@ -26,55 +23,73 @@ struct _flxInterfaceMonitor { GHashTable *hash_table; FLX_LLIST_HEAD(flxInterface, interfaces); + FLX_LLIST_HEAD(flxHwInterface, hw_interfaces); guint query_addr_seq, query_link_seq; - enum { LIST_IFACE, LIST_ADDR, LIST_DONE } list; + enum { + LIST_IFACE, + LIST_ADDR, + LIST_DONE + } list; }; -struct _flxInterface { +struct _flxHwInterface { + FLX_LLIST_FIELDS(flxHwInterface, hardware); flxInterfaceMonitor *monitor; + gchar *name; gint index; guint flags; + guint mtu; - FLX_LLIST_HEAD(flxInterfaceAddress, addresses); - FLX_LLIST_FIELDS(flxInterface, interface); + FLX_LLIST_HEAD(flxInterface, interfaces); +}; - guint n_ipv6_addrs, n_ipv4_addrs; - flxCache *ipv4_cache, *ipv6_cache; +struct _flxInterface { + FLX_LLIST_FIELDS(flxInterface, interface); + FLX_LLIST_FIELDS(flxInterface, by_hardware); + flxInterfaceMonitor *monitor; + + flxHwInterface *hardware; + guchar protocol; + gboolean relevant; - guint mtu; + flxCache *cache; + flxPacketScheduler *scheduler; - flxPacketScheduler *ipv4_scheduler, *ipv6_scheduler; + FLX_LLIST_HEAD(flxInterfaceAddress, addresses); + FLX_LLIST_HEAD(flxAnnouncement, announcements); }; struct _flxInterfaceAddress { + FLX_LLIST_FIELDS(flxInterfaceAddress, address); + flxInterfaceMonitor *monitor; + guchar flags; guchar scope; flxAddress address; - flxInterface *interface; - - FLX_LLIST_FIELDS(flxInterfaceAddress, address); - gint rr_id; + flxInterface *interface; }; flxInterfaceMonitor *flx_interface_monitor_new(flxServer *server); void flx_interface_monitor_free(flxInterfaceMonitor *m); -flxInterface* flx_interface_monitor_get_interface(flxInterfaceMonitor *m, gint index); -flxInterface* flx_interface_monitor_get_first(flxInterfaceMonitor *m); +flxInterface* flx_interface_monitor_get_interface(flxInterfaceMonitor *m, gint index, guchar protocol); +flxHwInterface* flx_interface_monitor_get_hw_interface(flxInterfaceMonitor *m, gint index); + +void flx_interface_send_packet(flxInterface *i, flxDnsPacket *p); -int flx_interface_is_relevant(flxInterface *i); -int flx_address_is_relevant(flxInterfaceAddress *a); +void flx_interface_post_query(flxInterface *i, flxKey *k); +void flx_interface_post_response(flxInterface *i, flxRecord *rr); -void flx_interface_send_packet(flxInterface *i, guchar protocol, flxDnsPacket *p); +void flx_dump_caches(flxInterfaceMonitor *m, FILE *f); -void flx_interface_post_query(flxInterface *i, guchar protocol, flxKey *k); -void flx_interface_post_response(flxInterface *i, guchar protocol, flxRecord *rr); +gboolean flx_interface_relevant(flxInterface *i); +gboolean flx_interface_address_relevant(flxInterfaceAddress *a); -void flx_dump_caches(flxServer *s, FILE *f); +gboolean flx_interface_match(flxInterface *i, gint index, guchar protocol); #endif |