]> git.meshlink.io Git - catta/blobdiff - avahi-core/iface.h
forgot to pull the publish_no_reverse change to the example.
[catta] / avahi-core / iface.h
index d9f9cba77d1ba7696bfecd80ac4a4d88f7d9f7a1..c3f24af05a7505e4374a98111ae2642d5ab26193 100644 (file)
@@ -1,21 +1,19 @@
 #ifndef fooifacehfoo
 #define fooifacehfoo
 
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -30,7 +28,7 @@ typedef struct AvahiHwInterface AvahiHwInterface;
 #include <avahi-common/llist.h>
 #include <avahi-common/address.h>
 
-#include "server.h"
+#include "internal.h"
 #include "cache.h"
 #include "response-sched.h"
 #include "query-sched.h"
@@ -39,9 +37,26 @@ typedef struct AvahiHwInterface AvahiHwInterface;
 #include "announce.h"
 #include "browse.h"
 #include "querier.h"
+
+#ifdef HAVE_NETLINK
 #include "iface-linux.h"
+#elif defined(HAVE_PF_ROUTE)
+#include "iface-pfroute.h"
+#else
+typedef struct AvahiInterfaceMonitorOSDep AvahiInterfaceMonitorOSDep;
+struct AvahiInterfaceMonitorOSDep {
+
+    unsigned query_addr_seq, query_link_seq;
+
+    enum {
+        LIST_IFACE,
+        LIST_ADDR,
+        LIST_DONE
+    } list;
+};
+#endif
 
-#define AVAHI_MAX_MAC_ADDRESS 32
+#define AVAHI_MAC_ADDRESS_MAX 32
 
 struct AvahiInterfaceMonitor {
     AvahiServer *server;
@@ -62,14 +77,18 @@ struct AvahiHwInterface {
     char *name;
     AvahiIfIndex index;
     int flags_ok;
-    
+
     unsigned mtu;
 
-    uint8_t mac_address[AVAHI_MAX_MAC_ADDRESS];
+    uint8_t mac_address[AVAHI_MAC_ADDRESS_MAX];
     size_t mac_address_size;
 
     AvahiSEntryGroup *entry_group;
 
+    /* Packet rate limiting */
+    struct timeval ratelimit_begin;
+    unsigned ratelimit_counter;
+
     AVAHI_LLIST_HEAD(AvahiInterface, interfaces);
 };
 
@@ -79,9 +98,11 @@ struct AvahiInterface {
 
     AVAHI_LLIST_FIELDS(AvahiInterface, interface);
     AVAHI_LLIST_FIELDS(AvahiInterface, by_hardware);
-    
+
     AvahiProtocol protocol;
     int announcing;
+    AvahiAddress local_mcast_address;
+    int mcast_joined;
 
     AvahiCache *cache;
 
@@ -90,7 +111,7 @@ struct AvahiInterface {
     AvahiProbeScheduler *probe_scheduler;
 
     AVAHI_LLIST_HEAD(AvahiInterfaceAddress, addresses);
-    AVAHI_LLIST_HEAD(AvahiAnnouncement, announcements);
+    AVAHI_LLIST_HEAD(AvahiAnnouncer, announcers);
 
     AvahiHashmap *queriers_by_key;
     AVAHI_LLIST_HEAD(AvahiQuerier, queriers);
@@ -106,7 +127,8 @@ struct AvahiInterfaceAddress {
     unsigned prefix_len;
 
     int global_scope;
-    
+    int deprecated;
+
     AvahiSEntryGroup *entry_group;
 };
 
@@ -147,7 +169,8 @@ int avahi_interface_is_relevant(AvahiInterface *i);
 void avahi_interface_send_packet(AvahiInterface *i, AvahiDnsPacket *p);
 void avahi_interface_send_packet_unicast(AvahiInterface *i, AvahiDnsPacket *p, const AvahiAddress *a, uint16_t port);
 
-int avahi_interface_post_query(AvahiInterface *i, AvahiKey *k, int immediately);
+int avahi_interface_post_query(AvahiInterface *i, AvahiKey *k, int immediately, unsigned *ret_id);
+int avahi_interface_withraw_query(AvahiInterface *i, unsigned id);
 int avahi_interface_post_response(AvahiInterface *i, AvahiRecord *record, int flush_cache, const AvahiAddress *querier, int immediately);
 int avahi_interface_post_probe(AvahiInterface *i, AvahiRecord *p, int immediately);
 
@@ -167,4 +190,6 @@ int avahi_interface_address_is_relevant(AvahiInterfaceAddress *a);
 
 AvahiInterfaceAddress* avahi_interface_monitor_get_address(AvahiInterfaceMonitor *m, AvahiInterface *i, const AvahiAddress *raddr);
 
+AvahiIfIndex avahi_find_interface_for_address(AvahiInterfaceMonitor *m, const AvahiAddress *a);
+
 #endif