Loading...
Searching...
No Matches
sres_cache.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
*
* This library 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.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SOFIA_RESOLV_SRES_CACHE_H
#define SOFIA_RESOLV_SRES_CACHE_H
#include "sofia-resolv/sres_config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SRES_CACHE_T
#define SRES_CACHE_T
typedef struct sres_cache sres_cache_t;
#endif
#ifndef SRES_RECORD_T
#define SRES_RECORD_T
typedef union sres_record sres_record_t;
#endif
enum {
SRES_CACHE_TIMER_INTERVAL = 5,
#define SRES_CACHE_TIMER_INTERVAL (SRES_CACHE_TIMER_INTERVAL)
};
SRESPUBFUN sres_cache_t *sres_cache_new(int n);
SRESPUBFUN sres_cache_t *sres_cache_ref(sres_cache_t *);
SRESPUBFUN void sres_cache_unref(sres_cache_t *);
SRESPUBFUN int sres_cache_get(sres_cache_t *cache,
uint16_t type,
char const *domain,
sres_record_t ***return_cached);
SRESPUBFUN int sres_cache_filter(sres_cache_t *cache,
sres_record_t **answers,
uint16_t type);
SRESPUBFUN void sres_cache_free_answers(sres_cache_t *, sres_record_t **);
SRESPUBFUN void sres_cache_free_one(sres_cache_t *, sres_record_t *answer);
SRESPUBFUN
sres_record_t **sres_cache_copy_answers(sres_cache_t *, sres_record_t **);
SRESPUBFUN void sres_cache_clean(sres_cache_t *cache, time_t now);
SRESPUBFUN
sres_record_t *sres_cache_alloc_record(sres_cache_t *cache,
sres_record_t const *template,
size_t extra);
SRESPUBFUN void sres_cache_free_record(sres_cache_t *cache, void *rr);
SRESPUBFUN void sres_cache_store(sres_cache_t *, sres_record_t *, time_t now);
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);
#ifdef __cplusplus
}
#endif
#endif /* SOFIA_RESOLV_SRES_CACHED_H */
sres_cache_t
struct sres_cache sres_cache_t
Opaque type of DNS cache object.
Definition sres.h:91
sres_record_t
union sres_record sres_record_t
Type representing any DNS record.
Definition sres.h:85
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_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_clean
SRESPUBFUN void sres_cache_clean(sres_cache_t *cache, time_t now)
Remove old records from cache.
Definition sres_cache.c:549
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_new
SRESPUBFUN sres_cache_t * sres_cache_new(int n)
Create a resolver cache object.
Definition sres_cache.c:148
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_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_free_answers
SRESPUBFUN void sres_cache_free_answers(sres_cache_t *, sres_record_t **)
Free the list records.
Definition sres_cache.c:442
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_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_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_unref
SRESPUBFUN void sres_cache_unref(sres_cache_t *)
Decrease the reference count on a resolver cache object.
Definition sres_cache.c:169
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_config.h
Configuration for Sofia DNS Resolver.
SRESPUBFUN
#define SRESPUBFUN
SRESPUBFUN declares an exported function.
Definition sres_config.h:41
uint32_t
SU_U32_T uint32_t
uint16_t
SU_U16_T uint16_t
sres_record
Union of different DNS records.
Definition sres_record.h:180

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