Home | History | Annotate | Line # | Download | only in netinet
      1 /*	$NetBSD: ip_pool.h,v 1.3 2012/07/22 14:27:51 darrenr Exp $	*/
      2 
      3 /*
      4  * Copyright (C) 2012 by Darren Reed.
      5  *
      6  * See the IPFILTER.LICENCE file for details on licencing.
      7  *
      8  * Id: ip_pool.h,v 1.1.1.2 2012/07/22 13:45:31 darrenr Exp
      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_tail;
     43 	ip_pool_node_t		*ipo_nextaddr;
     44 	void			*ipo_radix;
     45 	u_long			ipo_hits;
     46 	int			ipo_unit;
     47 	int			ipo_flags;
     48 	int			ipo_ref;
     49 	char			ipo_name[FR_GROUPLEN];
     50 } ip_pool_t;
     51 
     52 #define	IPOOL_DELETE	0x01
     53 #define	IPOOL_ANON	0x02
     54 
     55 
     56 typedef	struct	ipf_pool_stat	{
     57 	u_long			ipls_pools;
     58 	u_long			ipls_tables;
     59 	u_long			ipls_nodes;
     60 	ip_pool_t		*ipls_list[LOOKUP_POOL_SZ];
     61 } ipf_pool_stat_t;
     62 
     63 extern	ipf_lookup_t	ipf_pool_backend;
     64 
     65 #ifndef _KERNEL
     66 extern	void	ipf_pool_dump(ipf_main_softc_t *, void *);
     67 #endif
     68 
     69 #endif /* __IP_POOL_H__ */
     70