sresolv  1.12.11devel
sres_cache.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Sofia-SIP package
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24 
25 #ifndef SOFIA_RESOLV_SRES_CACHE_H
26 
27 #define SOFIA_RESOLV_SRES_CACHE_H
28 
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #ifndef SRES_CACHE_T
50 #define SRES_CACHE_T
51 
52 typedef struct sres_cache sres_cache_t;
53 #endif
54 
55 #ifndef SRES_RECORD_T
56 #define SRES_RECORD_T
57 
58 typedef union sres_record sres_record_t;
59 #endif
60 
61 enum {
64 #define SRES_CACHE_TIMER_INTERVAL (SRES_CACHE_TIMER_INTERVAL)
65 };
66 
69 
72 
75 
78  uint16_t type,
79  char const *domain,
80  sres_record_t ***return_cached);
81 
84  sres_record_t **answers,
85  uint16_t type);
86 
89 
92 
96 
98 SRESPUBFUN void sres_cache_clean(sres_cache_t *cache, time_t now);
99 
103  sres_record_t const *template,
104  size_t extra);
105 
107 SRESPUBFUN void sres_cache_free_record(sres_cache_t *cache, void *rr);
108 
111 
114  char const *domain,
115  char const *target,
116  uint16_t port,
117  uint32_t newttl,
118  uint16_t newprio);
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif /* SOFIA_RESOLV_SRES_CACHED_H */
sres_cache_unref
SRESPUBFUN void sres_cache_unref(sres_cache_t *)
Decrease the reference count on a resolver cache object.
Definition: sres_cache.c:169
uint32_t
SU_U32_T uint32_t
sres_config.h
sres_cache_free_record
SRESPUBFUN void sres_cache_free_record(sres_cache_t *cache, void *rr)
Free a record that has not been stored.
Definition: sres_cache.c:355
sres_cache_new
SRESPUBFUN sres_cache_t * sres_cache_new(int n)
Create a resolver cache object.
Definition: sres_cache.c:148
sres_cache_set_srv_priority
SRESPUBFUN int sres_cache_set_srv_priority(sres_cache_t *, char const *domain, char const *target, uint16_t port, uint32_t newttl, uint16_t newprio)
Modify the priority in the specified SRV record.
Definition: sres_cache.c:601
sres_cache_free_answers
SRESPUBFUN void sres_cache_free_answers(sres_cache_t *, sres_record_t **)
Free the list records.
Definition: sres_cache.c:442
SRESPUBFUN
#define SRESPUBFUN
SRESPUBFUN declares an exported function.
Definition: sres_config.h:41
sres_cache_alloc_record
SRESPUBFUN sres_record_t * sres_cache_alloc_record(sres_cache_t *cache, sres_record_t const *template, size_t extra)
Allocate a cache record.
Definition: sres_cache.c:326
sres_cache_get
SRESPUBFUN int sres_cache_get(sres_cache_t *cache, uint16_t type, char const *domain, sres_record_t ***return_cached)
Get a list of matching records from cache.
Definition: sres_cache.c:254
sres_cache_ref
SRESPUBFUN sres_cache_t * sres_cache_ref(sres_cache_t *)
Increase reference count on a resolver cache object.
Definition: sres_cache.c:163
sres_cache_free_one
SRESPUBFUN void sres_cache_free_one(sres_cache_t *, sres_record_t *answer)
Free and zero one record.
Definition: sres_cache.c:451
sres_cache_filter
SRESPUBFUN int sres_cache_filter(sres_cache_t *cache, sres_record_t **answers, uint16_t type)
Free answers not matching with type.
sres_cache_store
SRESPUBFUN void sres_cache_store(sres_cache_t *, sres_record_t *, time_t now)
Store a record to cache.
Definition: sres_cache.c:367
sres_record
Union of different DNS records.
Definition: sres_record.h:179
uint16_t
SU_U16_T uint16_t
sres_cache_copy_answers
SRESPUBFUN sres_record_t ** sres_cache_copy_answers(sres_cache_t *, sres_record_t **)
Copy list of records.
Definition: sres_cache.c:461
SRES_CACHE_TIMER_INTERVAL
@ SRES_CACHE_TIMER_INTERVAL
Cache cleanup interval in seconds.
Definition: sres_cache.h:63
sres_cache_t
struct sres_cache sres_cache_t
Opaque type of DNS cache object.
Definition: sres.h:91
sres_cache_clean
SRESPUBFUN void sres_cache_clean(sres_cache_t *cache, time_t now)
Remove old records from cache.
Definition: sres_cache.c:549

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.