X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fiface.h;h=486207e0c4e275e1973b51fba118e21dce39d84a;hb=9962a048634c590db23a00db1d01daada779844c;hp=74136aa45e3c9968285ac729d8c1b6d70d9e7ff5;hpb=c58379bde376cb2298fca14f83a86626f1b76f2f;p=catta diff --git a/avahi-core/iface.h b/avahi-core/iface.h index 74136aa..486207e 100644 --- a/avahi-core/iface.h +++ b/avahi-core/iface.h @@ -24,21 +24,25 @@ #include -typedef struct _AvahiInterfaceMonitor AvahiInterfaceMonitor; -typedef struct _AvahiInterfaceAddress AvahiInterfaceAddress; -typedef struct _AvahiInterface AvahiInterface; -typedef struct _AvahiHwInterface AvahiHwInterface; +typedef struct AvahiInterfaceMonitor AvahiInterfaceMonitor; +typedef struct AvahiInterfaceAddress AvahiInterfaceAddress; +typedef struct AvahiInterface AvahiInterface; +typedef struct AvahiHwInterface AvahiHwInterface; #include "address.h" #include "server.h" #include "netlink.h" #include "cache.h" #include "llist.h" -#include "psched.h" +#include "response-sched.h" +#include "query-sched.h" +#include "probe-sched.h" #include "dns.h" #include "announce.h" -struct _AvahiInterfaceMonitor { +#define AVAHI_MAX_MAC_ADDRESS 32 + +struct AvahiInterfaceMonitor { AvahiServer *server; AvahiNetlink *netlink; GHashTable *hash_table; @@ -55,40 +59,48 @@ struct _AvahiInterfaceMonitor { } list; }; -struct _AvahiHwInterface { +struct AvahiHwInterface { AVAHI_LLIST_FIELDS(AvahiHwInterface, hardware); AvahiInterfaceMonitor *monitor; gchar *name; - gint index; + AvahiIfIndex index; guint flags; guint mtu; + guint8 mac_address[AVAHI_MAX_MAC_ADDRESS]; + guint mac_address_size; + + AvahiEntryGroup *entry_group; + AVAHI_LLIST_HEAD(AvahiInterface, interfaces); }; -struct _AvahiInterface { +struct AvahiInterface { AVAHI_LLIST_FIELDS(AvahiInterface, interface); AVAHI_LLIST_FIELDS(AvahiInterface, by_hardware); AvahiInterfaceMonitor *monitor; AvahiHwInterface *hardware; - guchar protocol; + AvahiProtocol protocol; gboolean announcing; AvahiCache *cache; - AvahiPacketScheduler *scheduler; + AvahiQueryScheduler *query_scheduler; + AvahiResponseScheduler * response_scheduler; + AvahiProbeScheduler *probe_scheduler; AVAHI_LLIST_HEAD(AvahiInterfaceAddress, addresses); AVAHI_LLIST_HEAD(AvahiAnnouncement, announcements); }; -struct _AvahiInterfaceAddress { +struct AvahiInterfaceAddress { AVAHI_LLIST_FIELDS(AvahiInterfaceAddress, address); AvahiInterfaceMonitor *monitor; guchar flags; guchar scope; + guchar prefix_len; AvahiAddress address; AvahiEntryGroup *entry_group; @@ -100,24 +112,32 @@ void avahi_interface_monitor_free(AvahiInterfaceMonitor *m); void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m); -AvahiInterface* avahi_interface_monitor_get_interface(AvahiInterfaceMonitor *m, gint index, guchar protocol); +AvahiInterface* avahi_interface_monitor_get_interface(AvahiInterfaceMonitor *m, AvahiIfIndex index, AvahiProtocol protocol); AvahiHwInterface* avahi_interface_monitor_get_hw_interface(AvahiInterfaceMonitor *m, gint index); void avahi_interface_send_packet(AvahiInterface *i, AvahiDnsPacket *p); +void avahi_interface_send_packet_unicast(AvahiInterface *i, AvahiDnsPacket *p, const AvahiAddress *a, guint16 port); -void avahi_interface_post_query(AvahiInterface *i, AvahiKey *k, gboolean immediately); -void avahi_interface_post_probe(AvahiInterface *i, AvahiRecord *p, gboolean immediately); -void avahi_interface_post_response(AvahiInterface *i, const AvahiAddress *a, AvahiRecord *record, gboolean flush_cache, gboolean immediately); +gboolean avahi_interface_post_query(AvahiInterface *i, AvahiKey *k, gboolean immediately); +gboolean avahi_interface_post_response(AvahiInterface *i, AvahiRecord *record, gboolean flush_cache, const AvahiAddress *querier, gboolean immediately); +gboolean avahi_interface_post_probe(AvahiInterface *i, AvahiRecord *p, gboolean immediately); void avahi_dump_caches(AvahiInterfaceMonitor *m, FILE *f); gboolean avahi_interface_relevant(AvahiInterface *i); gboolean avahi_interface_address_relevant(AvahiInterfaceAddress *a); -gboolean avahi_interface_match(AvahiInterface *i, gint index, guchar protocol); +gboolean avahi_interface_match(AvahiInterface *i, AvahiIfIndex index, AvahiProtocol protocol); typedef void (*AvahiInterfaceMonitorWalkCallback)(AvahiInterfaceMonitor *m, AvahiInterface *i, gpointer userdata); -void avahi_interface_monitor_walk(AvahiInterfaceMonitor *m, gint index, guchar protocol, AvahiInterfaceMonitorWalkCallback callback, gpointer userdata); +void avahi_interface_monitor_walk(AvahiInterfaceMonitor *m, AvahiIfIndex index, AvahiProtocol protocol, AvahiInterfaceMonitorWalkCallback callback, gpointer userdata); + +void avahi_update_host_rrs(AvahiInterfaceMonitor *m, gboolean remove); + +gboolean avahi_address_is_local(AvahiInterfaceMonitor *m, const AvahiAddress *a); + +gboolean avahi_interface_address_on_link(AvahiInterface *i, const AvahiAddress *a); + #endif