Home | History | Annotate | Line # | Download | only in netinet
ip_pool.h revision 1.1
      1 /*	$NetBSD: ip_pool.h,v 1.1 2012/03/23 20:37:01 christos Exp $	*/
      2 
      3 /*
      4  * Copyright (C) 2011 by Darren Reed.
      5  *
      6  * See the IPFILTER.LICENCE file for details on licencing.
      7  *
      8  * Id
      9  */
     10 
     11 #ifndef	__IP_POOL_H__
     12 #define	__IP_POOL_H__
     13 
     14 #include "netinet/ip_lookup.h"
     15 #include "radix_ipf.h"
     16 
     17 #define	IP_POOL_NOMATCH		0
     18 #define	IP_POOL_POSITIVE	1
     19 
     20 typedef	struct ip_pool_node {
     21 	ipf_rdx_node_t		ipn_nodes[2];
     22 	addrfamily_t		ipn_addr;
     23 	addrfamily_t		ipn_mask;
     24 	int			ipn_uid;
     25 	int			ipn_info;
     26 	int			ipn_ref;
     27 	char			ipn_name[FR_GROUPLEN];
     28 	U_QUAD_T		ipn_hits;
     29 	U_QUAD_T		ipn_bytes;
     30 	u_long			ipn_die;
     31 	struct ip_pool_node	*ipn_next, **ipn_pnext;
     32 	struct ip_pool_node	*ipn_dnext, **ipn_pdnext;
     33 	struct ip_pool_s	*ipn_owner;
     34 } ip_pool_node_t;
     35 
     36 
     37 typedef	struct ip_pool_s {
     38 	struct ip_pool_s	*ipo_next;
     39 	struct ip_pool_s	**ipo_pnext;
     40 	ipf_rdx_head_t		*ipo_head;
     41 	ip_pool_node_t		*ipo_list;
     42 	ip_pool_node_t		*ipo_nextaddr;
     43 	void			*ipo_radix;
     44 	u_long			ipo_hits;
     45 	int			ipo_unit;
     46 	int			ipo_flags;
     47 	int			ipo_ref;
     48 	char			ipo_name[FR_GROUPLEN];
     49 } ip_pool_t;
     50 
     51 #define	IPOOL_DELETE	0x01
     52 #define	IPOOL_ANON	0x02
     53 
     54 
     55 typedef	struct	ipf_pool_stat	{
     56 	u_long			ipls_pools;
     57 	u_long			ipls_tables;
     58 	u_long			ipls_nodes;
     59 	ip_pool_t		*ipls_list[LOOKUP_POOL_SZ];
     60 } ipf_pool_stat_t;
     61 
     62 extern	ipf_lookup_t	ipf_pool_backend;
     63 
     64 #ifndef _KERNEL
     65 extern	void	ipf_pool_dump __P((ipf_main_softc_t *, void *));
     66 #endif
     67 
     68 #endif /* __IP_POOL_H__ */
     69