7 */ 8 9#ifndef __IP_POOL_H__ 10#define __IP_POOL_H__ 11 12#if defined(_KERNEL) && !defined(__osf__) && !defined(__hpux) && \ 13 !defined(linux) && !defined(sun) && !defined(AIX) 14# include <net/radix.h> 15extern void rn_freehead __P((struct radix_node_head *)); 16# define FreeS(p, z) KFREES(p, z) 17extern int max_keylen; 18#else
| 7 */ 8 9#ifndef __IP_POOL_H__ 10#define __IP_POOL_H__ 11 12#if defined(_KERNEL) && !defined(__osf__) && !defined(__hpux) && \ 13 !defined(linux) && !defined(sun) && !defined(AIX) 14# include <net/radix.h> 15extern void rn_freehead __P((struct radix_node_head *)); 16# define FreeS(p, z) KFREES(p, z) 17extern int max_keylen; 18#else
|
20# include "radix_ipf_local.h" 21# define radix_mask ipf_radix_mask 22# define radix_node ipf_radix_node 23# define radix_node_head ipf_radix_node_head 24# else 25# include "radix_ipf.h" 26# endif 27#endif 28#include "netinet/ip_lookup.h" 29 30#define IP_POOL_NOMATCH 0 31#define IP_POOL_POSITIVE 1 32 33typedef struct ip_pool_node { 34 struct radix_node ipn_nodes[2]; 35 addrfamily_t ipn_addr; 36 addrfamily_t ipn_mask; 37 int ipn_info; 38 int ipn_ref; 39char ipn_name[FR_GROUPLEN]; 40u_long ipn_hits; 41 struct ip_pool_node *ipn_next, **ipn_pnext; 42} ip_pool_node_t; 43 44 45typedef struct ip_pool_s { 46 struct ip_pool_s *ipo_next; 47 struct ip_pool_s **ipo_pnext; 48 struct radix_node_head *ipo_head; 49 ip_pool_node_t *ipo_list; 50 u_long ipo_hits; 51 int ipo_unit; 52 int ipo_flags; 53 int ipo_ref; 54 char ipo_name[FR_GROUPLEN]; 55} ip_pool_t; 56 57#define IPOOL_DELETE 0x01 58#define IPOOL_ANON 0x02 59 60 61typedef struct ip_pool_stat { 62 u_long ipls_pools; 63 u_long ipls_tables; 64 u_long ipls_nodes; 65 ip_pool_t *ipls_list[IPL_LOGSIZE]; 66} ip_pool_stat_t; 67 68 69extern ip_pool_stat_t ipoolstat; 70extern ip_pool_t *ip_pool_list[IPL_LOGSIZE]; 71 72extern int ip_pool_search __P((void *, int, void *)); 73extern int ip_pool_init __P((void)); 74extern void ip_pool_fini __P((void)); 75extern int ip_pool_create __P((iplookupop_t *)); 76extern int ip_pool_insert __P((ip_pool_t *, i6addr_t *, i6addr_t *, int)); 77extern int ip_pool_remove __P((ip_pool_t *, ip_pool_node_t *)); 78extern int ip_pool_destroy __P((int, char *)); 79extern void ip_pool_free __P((ip_pool_t *)); 80extern void ip_pool_deref __P((ip_pool_t *)); 81extern void ip_pool_node_deref __P((ip_pool_node_t *)); 82extern void *ip_pool_find __P((int, char *)); 83extern ip_pool_node_t *ip_pool_findeq __P((ip_pool_t *, 84 addrfamily_t *, addrfamily_t *)); 85extern int ip_pool_flush __P((iplookupflush_t *)); 86extern int ip_pool_statistics __P((iplookupop_t *)); 87extern int ip_pool_getnext __P((ipftoken_t *, ipflookupiter_t *)); 88extern void ip_pool_iterderef __P((u_int, int, void *)); 89 90#endif /* __IP_POOL_H__ */
| 20# include "radix_ipf_local.h" 21# define radix_mask ipf_radix_mask 22# define radix_node ipf_radix_node 23# define radix_node_head ipf_radix_node_head 24# else 25# include "radix_ipf.h" 26# endif 27#endif 28#include "netinet/ip_lookup.h" 29 30#define IP_POOL_NOMATCH 0 31#define IP_POOL_POSITIVE 1 32 33typedef struct ip_pool_node { 34 struct radix_node ipn_nodes[2]; 35 addrfamily_t ipn_addr; 36 addrfamily_t ipn_mask; 37 int ipn_info; 38 int ipn_ref; 39char ipn_name[FR_GROUPLEN]; 40u_long ipn_hits; 41 struct ip_pool_node *ipn_next, **ipn_pnext; 42} ip_pool_node_t; 43 44 45typedef struct ip_pool_s { 46 struct ip_pool_s *ipo_next; 47 struct ip_pool_s **ipo_pnext; 48 struct radix_node_head *ipo_head; 49 ip_pool_node_t *ipo_list; 50 u_long ipo_hits; 51 int ipo_unit; 52 int ipo_flags; 53 int ipo_ref; 54 char ipo_name[FR_GROUPLEN]; 55} ip_pool_t; 56 57#define IPOOL_DELETE 0x01 58#define IPOOL_ANON 0x02 59 60 61typedef struct ip_pool_stat { 62 u_long ipls_pools; 63 u_long ipls_tables; 64 u_long ipls_nodes; 65 ip_pool_t *ipls_list[IPL_LOGSIZE]; 66} ip_pool_stat_t; 67 68 69extern ip_pool_stat_t ipoolstat; 70extern ip_pool_t *ip_pool_list[IPL_LOGSIZE]; 71 72extern int ip_pool_search __P((void *, int, void *)); 73extern int ip_pool_init __P((void)); 74extern void ip_pool_fini __P((void)); 75extern int ip_pool_create __P((iplookupop_t *)); 76extern int ip_pool_insert __P((ip_pool_t *, i6addr_t *, i6addr_t *, int)); 77extern int ip_pool_remove __P((ip_pool_t *, ip_pool_node_t *)); 78extern int ip_pool_destroy __P((int, char *)); 79extern void ip_pool_free __P((ip_pool_t *)); 80extern void ip_pool_deref __P((ip_pool_t *)); 81extern void ip_pool_node_deref __P((ip_pool_node_t *)); 82extern void *ip_pool_find __P((int, char *)); 83extern ip_pool_node_t *ip_pool_findeq __P((ip_pool_t *, 84 addrfamily_t *, addrfamily_t *)); 85extern int ip_pool_flush __P((iplookupflush_t *)); 86extern int ip_pool_statistics __P((iplookupop_t *)); 87extern int ip_pool_getnext __P((ipftoken_t *, ipflookupiter_t *)); 88extern void ip_pool_iterderef __P((u_int, int, void *)); 89 90#endif /* __IP_POOL_H__ */
|