comparison src/gt_node_cache.h @ 0:d39e1d0d75b6

initial add
author paulo@hit-nxdomain.opendns.com
date Sat, 20 Feb 2010 21:18:28 -0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:83e097f13270
1 /*
2 * $Id: gt_node_cache.h,v 1.4 2004/01/04 06:01:20 hipnod Exp $
3 *
4 * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net)
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 */
16
17 #ifndef GIFT__GT_NODE_CACHE_H__
18 #define GIFT__GT_NODE_CACHE_H__
19
20 /*****************************************************************************/
21
22 struct ipv4_addr
23 {
24 in_addr_t ip;
25 in_port_t port;
26 };
27
28 struct cached_node
29 {
30 struct ipv4_addr addr;
31 gt_node_class_t klass;
32 time_t timestamp;
33 time_t uptime;
34 in_addr_t src_ip;
35 };
36
37 /*****************************************************************************/
38
39 void gt_node_cache_add_ipv4 (in_addr_t ipv4, in_port_t port,
40 gt_node_class_t klass,
41 time_t timestamp, time_t uptime,
42 in_addr_t src_ip);
43 void gt_node_cache_del_ipv4 (in_addr_t ipv4, in_port_t port);
44
45 List *gt_node_cache_get_remove (size_t max_len);
46 List *gt_node_cache_get (size_t max_len);
47
48 void gt_node_cache_trace (void);
49
50 /*****************************************************************************/
51
52 void gt_node_cache_load (void);
53 void gt_node_cache_save (void);
54
55 /*****************************************************************************/
56
57 void gt_node_cache_init (void);
58 void gt_node_cache_cleanup (void);
59
60 /*****************************************************************************/
61
62 #endif /* GIFT__GT_NODE_CACHE_H__ */