typedef struct AvahiCache AvahiCache;
+#include <avahi-common/llist.h>
#include "prioq.h"
#include "server.h"
-#include "llist.h"
#include "timeeventq.h"
typedef enum {
struct AvahiCacheEntry {
AvahiCache *cache;
AvahiRecord *record;
- GTimeVal timestamp;
- GTimeVal expiry;
+ struct timeval timestamp;
+ struct timeval expiry;
+ gboolean cache_flush;
AvahiAddress origin;
GHashTable *hash_table;
AVAHI_LLIST_HEAD(AvahiCacheEntry, entries);
+
+ guint n_entries;
};
AvahiCache *avahi_cache_new(AvahiServer *server, AvahiInterface *interface);
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);