summaryrefslogtreecommitdiffstats
path: root/avahi-core/iface.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-05-07 13:37:03 +0000
committerLennart Poettering <lennart@poettering.net>2005-05-07 13:37:03 +0000
commitc58379bde376cb2298fca14f83a86626f1b76f2f (patch)
tree976f81b6e3530f29187ce0c017da9c91e584af06 /avahi-core/iface.h
parente2c8b4dac0fefea406db0ec1a3b1c0861557601e (diff)
rename libavahi-core to avahi-core
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@57 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/iface.h')
-rw-r--r--avahi-core/iface.h123
1 files changed, 123 insertions, 0 deletions
diff --git a/avahi-core/iface.h b/avahi-core/iface.h
new file mode 100644
index 0000000..74136aa
--- /dev/null
+++ b/avahi-core/iface.h
@@ -0,0 +1,123 @@
+#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
+ USA.
+***/
+
+#include <glib.h>
+
+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 "dns.h"
+#include "announce.h"
+
+struct _AvahiInterfaceMonitor {
+ AvahiServer *server;
+ AvahiNetlink *netlink;
+ GHashTable *hash_table;
+
+ AVAHI_LLIST_HEAD(AvahiInterface, interfaces);
+ AVAHI_LLIST_HEAD(AvahiHwInterface, hw_interfaces);
+
+ guint query_addr_seq, query_link_seq;
+
+ enum {
+ LIST_IFACE,
+ LIST_ADDR,
+ LIST_DONE
+ } list;
+};
+
+struct _AvahiHwInterface {
+ AVAHI_LLIST_FIELDS(AvahiHwInterface, hardware);
+ AvahiInterfaceMonitor *monitor;
+
+ gchar *name;
+ gint index;
+ guint flags;
+ guint mtu;
+
+ AVAHI_LLIST_HEAD(AvahiInterface, interfaces);
+};
+
+struct _AvahiInterface {
+ AVAHI_LLIST_FIELDS(AvahiInterface, interface);
+ AVAHI_LLIST_FIELDS(AvahiInterface, by_hardware);
+ AvahiInterfaceMonitor *monitor;
+
+ AvahiHwInterface *hardware;
+ guchar protocol;
+ gboolean announcing;
+
+ AvahiCache *cache;
+ AvahiPacketScheduler *scheduler;
+
+ AVAHI_LLIST_HEAD(AvahiInterfaceAddress, addresses);
+ AVAHI_LLIST_HEAD(AvahiAnnouncement, announcements);
+};
+
+struct _AvahiInterfaceAddress {
+ AVAHI_LLIST_FIELDS(AvahiInterfaceAddress, address);
+ AvahiInterfaceMonitor *monitor;
+
+ guchar flags;
+ guchar scope;
+ AvahiAddress address;
+
+ AvahiEntryGroup *entry_group;
+ AvahiInterface *interface;
+};
+
+AvahiInterfaceMonitor *avahi_interface_monitor_new(AvahiServer *server);
+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);
+AvahiHwInterface* avahi_interface_monitor_get_hw_interface(AvahiInterfaceMonitor *m, gint index);
+
+void avahi_interface_send_packet(AvahiInterface *i, AvahiDnsPacket *p);
+
+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);
+
+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);
+
+typedef void (*AvahiInterfaceMonitorWalkCallback)(AvahiInterfaceMonitor *m, AvahiInterface *i, gpointer userdata);
+
+void avahi_interface_monitor_walk(AvahiInterfaceMonitor *m, gint index, guchar protocol, AvahiInterfaceMonitorWalkCallback callback, gpointer userdata);
+
+#endif