]> git.meshlink.io Git - catta/blobdiff - avahi-core/cache.h
* drop glib from avahi-common
[catta] / avahi-core / cache.h
index 4415c3c72627e4a530896803c90a84c5eea689ab..2f4caa6c6c6f0d9e685234b75ba1e171eebeb715 100644 (file)
@@ -26,9 +26,9 @@
 
 typedef struct AvahiCache AvahiCache;
 
+#include <avahi-common/llist.h>
 #include "prioq.h"
 #include "server.h"
-#include "llist.h"
 #include "timeeventq.h"
 
 typedef enum {
@@ -44,8 +44,9 @@ typedef struct AvahiCacheEntry AvahiCacheEntry;
 struct AvahiCacheEntry {
     AvahiCache *cache;
     AvahiRecord *record;
-    GTimeVal timestamp;
-    GTimeVal expiry;
+    struct timeval timestamp;
+    struct timeval expiry;
+    gboolean cache_flush;
     
     AvahiAddress origin;
 
@@ -64,6 +65,8 @@ struct AvahiCache {
     GHashTable *hash_table;
 
     AVAHI_LLIST_HEAD(AvahiCacheEntry, entries);
+
+    guint n_entries;
 };
 
 AvahiCache *avahi_cache_new(AvahiServer *server, AvahiInterface *interface);
@@ -72,9 +75,9 @@ void avahi_cache_free(AvahiCache *c);
 AvahiCacheEntry *avahi_cache_lookup_key(AvahiCache *c, AvahiKey *k);
 AvahiCacheEntry *avahi_cache_lookup_record(AvahiCache *c, AvahiRecord *r);
 
-void avahi_cache_update(AvahiCache *c, AvahiRecord *r, gboolean unique, const AvahiAddress *a);
+void avahi_cache_update(AvahiCache *c, AvahiRecord *r, gboolean cache_flush, const AvahiAddress *a);
 
-void avahi_cache_dump(AvahiCache *c, FILE *f);
+void avahi_cache_dump(AvahiCache *c, AvahiDumpCallback callback, gpointer userdata);
 
 typedef gpointer AvahiCacheWalkCallback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, gpointer userdata);
 gpointer avahi_cache_walk(AvahiCache *c, AvahiKey *pattern, AvahiCacheWalkCallback cb, gpointer userdata);