• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/avahi-0.6.25/avahi-core/

Lines Matching defs:*

0 #ifndef foocachehfoo
2 #define foocachehfoo
4 /* $Id$ */
7 This file is part of avahi.
9 avahi is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
14 avahi is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
17 Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with avahi; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
25 typedef struct AvahiCache AvahiCache;
27 #include <avahi-common/llist.h>
28 #include "prioq.h"
29 #include "internal.h"
30 #include "timeeventq.h"
31 #include "hashmap.h"
33 typedef enum {
34 AVAHI_CACHE_VALID,
35 AVAHI_CACHE_EXPIRY1,
36 AVAHI_CACHE_EXPIRY2,
37 AVAHI_CACHE_EXPIRY3,
38 AVAHI_CACHE_EXPIRY_FINAL,
39 AVAHI_CACHE_POOF, /* Passive observation of failure */
40 AVAHI_CACHE_POOF_FINAL,
41 AVAHI_CACHE_GOODBYE_FINAL,
42 AVAHI_CACHE_REPLACE_FINAL
43 } AvahiCacheEntryState;
45 typedef struct AvahiCacheEntry AvahiCacheEntry;
47 struct AvahiCacheEntry {
48 AvahiCache *cache;
49 AvahiRecord *record;
50 struct timeval timestamp;
51 struct timeval poof_timestamp;
52 struct timeval expiry;
53 int cache_flush;
54 int poof_num;
56 AvahiAddress origin;
58 AvahiCacheEntryState state;
59 AvahiTimeEvent *time_event;
61 AvahiAddress poof_address;
63 AVAHI_LLIST_FIELDS(AvahiCacheEntry, by_key);
64 AVAHI_LLIST_FIELDS(AvahiCacheEntry, entry);
67 struct AvahiCache {
68 AvahiServer *server;
70 AvahiInterface *interface;
72 AvahiHashmap *hashmap;
74 AVAHI_LLIST_HEAD(AvahiCacheEntry, entries);
76 unsigned n_entries;
78 int last_rand;
79 time_t last_rand_timestamp;
82 AvahiCache *avahi_cache_new(AvahiServer *server, AvahiInterface *interface);
83 void avahi_cache_free(AvahiCache *c);
85 void avahi_cache_update(AvahiCache *c, AvahiRecord *r, int cache_flush, const AvahiAddress *a);
87 int avahi_cache_dump(AvahiCache *c, AvahiDumpCallback callback, void* userdata);
89 typedef void* AvahiCacheWalkCallback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, void* userdata);
90 void* avahi_cache_walk(AvahiCache *c, AvahiKey *pattern, AvahiCacheWalkCallback cb, void* userdata);
92 int avahi_cache_entry_half_ttl(AvahiCache *c, AvahiCacheEntry *e);
94 /** Start the "Passive observation of Failure" algorithm for all
95 * records of the specified key. The specified address is */
96 void avahi_cache_start_poof(AvahiCache *c, AvahiKey *key, const AvahiAddress *a);
98 /* Stop a previously started POOF algorithm for a record. (Used for response suppresions records */
99 void avahi_cache_stop_poof(AvahiCache *c, AvahiRecord *record, const AvahiAddress *a);
101 void avahi_cache_flush(AvahiCache *c);
103 #endif