syslog-ng source
dnscache.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2012 Balabit
3  * Copyright (c) 1998-2012 Balázs Scheidler
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * As an additional exemption you are allowed to compile & link against the
20  * OpenSSL libraries as published by the OpenSSL project. See the file
21  * COPYING for details.
22  *
23  */
24 
25 
26 #ifndef DNSCACHE_H_INCLUDED
27 #define DNSCACHE_H_INCLUDED
28 
29 #include "syslog-ng.h"
30 
31 typedef struct
32 {
33  gint cache_size;
34  gint expire;
36  gchar *hosts;
38 
39 typedef struct _DNSCache DNSCache;
40 
41 void dns_cache_store_persistent(DNSCache *self, gint family, void *addr, const gchar *hostname);
42 void dns_cache_store_dynamic(DNSCache *self, gint family, void *addr, const gchar *hostname, gboolean positive);
43 gboolean dns_cache_lookup(DNSCache *self, gint family, void *addr, const gchar **hostname, gsize *hostname_len,
44  gboolean *positive);
45 DNSCache *dns_cache_new(const DNSCacheOptions *options);
46 void dns_cache_free(DNSCache *self);
47 
50 
51 gboolean dns_caching_lookup(gint family, void *addr, const gchar **hostname, gsize *hostname_len, gboolean *positive);
52 void dns_caching_store(gint family, void *addr, const gchar *hostname, gboolean positive);
53 void dns_caching_update_options(const DNSCacheOptions *dns_cache_options);
54 
55 void dns_caching_thread_init(void);
56 void dns_caching_thread_deinit(void);
57 void dns_caching_global_init(void);
58 void dns_caching_global_deinit(void);
59 
60 
61 #endif
void dns_caching_store(gint family, void *addr, const gchar *hostname, gboolean positive)
Definition: dnscache.c:433
void dns_caching_global_deinit(void)
Definition: dnscache.c:487
void dns_caching_update_options(const DNSCacheOptions *dns_cache_options)
Definition: dnscache.c:439
void dns_cache_store_dynamic(DNSCache *self, gint family, void *addr, const gchar *hostname, gboolean positive)
Definition: dnscache.c:195
gboolean dns_cache_lookup(DNSCache *self, gint family, void *addr, const gchar **hostname, gsize *hostname_len, gboolean *positive)
Definition: dnscache.c:300
void dns_cache_options_destroy(DNSCacheOptions *options)
Definition: dnscache.c:366
DNSCache * dns_cache_new(const DNSCacheOptions *options)
Definition: dnscache.c:334
void dns_caching_global_init(void)
Definition: dnscache.c:481
void dns_cache_store_persistent(DNSCache *self, gint family, void *addr, const gchar *hostname)
Definition: dnscache.c:189
void dns_caching_thread_init(void)
Definition: dnscache.c:453
void dns_caching_thread_deinit(void)
Definition: dnscache.c:470
gboolean dns_caching_lookup(gint family, void *addr, const gchar **hostname, gsize *hostname_len, gboolean *positive)
Definition: dnscache.c:427
void dns_cache_options_defaults(DNSCacheOptions *options)
Definition: dnscache.c:357
void dns_cache_free(DNSCache *self)
Definition: dnscache.c:350
Definition: dnscache.h:32
gint expire_failed
Definition: dnscache.h:35
gchar * hosts
Definition: dnscache.h:36
gint expire
Definition: dnscache.h:34
gint cache_size
Definition: dnscache.h:33
Definition: dnscache.c:70
const DNSCacheOptions * options
Definition: dnscache.c:72