2 * Copyright (C) 1993-2001, 2003 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * $Id: ip_pool.h,v 2.26.2.3 2005/06/12 07:18:27 darrenr Exp $
8 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
14 #if defined(_KERNEL) && !defined(__osf__) && !defined(__hpux) && \
15 !defined(linux) && !defined(sun) && !defined(AIX)
16 # include <net/radix.h>
17 extern void rn_freehead
__P((struct radix_node_head
*));
18 # define FreeS(p, z) KFREES(p, z)
19 extern int max_keylen
;
21 # if defined(__osf__) || defined(__hpux)
22 # include "radix_ipf_local.h"
23 # define radix_mask ipf_radix_mask
24 # define radix_node ipf_radix_node
25 # define radix_node_head ipf_radix_node_head
27 # include "radix_ipf.h"
30 #include "netinet/ip_lookup.h"
32 #define IP_POOL_NOMATCH 0
33 #define IP_POOL_POSITIVE 1
35 typedef struct ip_pool_node
{
36 struct radix_node ipn_nodes
[2];
37 addrfamily_t ipn_addr
;
38 addrfamily_t ipn_mask
;
41 char ipn_name
[FR_GROUPLEN
];
44 struct ip_pool_node
*ipn_next
, **ipn_pnext
;
48 typedef struct ip_pool_s
{
49 struct ip_pool_s
*ipo_next
;
50 struct ip_pool_s
**ipo_pnext
;
51 struct radix_node_head
*ipo_head
;
52 ip_pool_node_t
*ipo_list
;
57 char ipo_name
[FR_GROUPLEN
];
60 #define IPOOL_ANON 0x80000000
63 typedef struct ip_pool_stat
{
67 ip_pool_t
*ipls_list
[IPL_LOGSIZE
];
70 extern int ip_pool_search
__P((void *, int, void *, fr_info_t
*, ipf_stack_t
*));
71 extern int ip_pool_init
__P((ipf_stack_t
*));
72 extern void ip_pool_fini
__P((ipf_stack_t
*));
73 extern int ip_pool_create
__P((iplookupop_t
*, ipf_stack_t
*));
74 extern int ip_pool_insert
__P((ip_pool_t
*, addrfamily_t
*,
75 addrfamily_t
*, int, ipf_stack_t
*));
76 extern int ip_pool_remove
__P((ip_pool_t
*, ip_pool_node_t
*,
78 extern int ip_pool_destroy
__P((iplookupop_t
*, ipf_stack_t
*));
79 extern void ip_pool_free
__P((ip_pool_t
*, ipf_stack_t
*));
80 extern void ip_pool_deref
__P((ip_pool_t
*, ipf_stack_t
*));
81 extern void *ip_pool_find
__P((int, char *, ipf_stack_t
*));
82 extern ip_pool_node_t
*ip_pool_findeq
__P((ip_pool_t
*,
83 addrfamily_t
*, addrfamily_t
*));
84 extern int ip_pool_flush
__P((iplookupflush_t
*, ipf_stack_t
*));
85 extern int ip_pool_statistics
__P((iplookupop_t
*, ipf_stack_t
*));
86 extern int ip_pool_getnext
__P((ipftoken_t
*, ipflookupiter_t
*, ipf_stack_t
*));
87 extern void ip_pool_iterderef
__P((u_int
, int, void *, ipf_stack_t
*));
88 #endif /* __IP_POOL_H__ */