Home | History | Annotate | Line # | Download | only in netinet
ip_dstlist.h revision 1.2
      1 /*	$NetBSD: ip_dstlist.h,v 1.2 2012/03/23 20:39:49 christos Exp $	*/
      2 
      3 /*
      4  * Copyright (C) 2010 by Darren Reed.
      5  *
      6  * See the IPFILTER.LICENCE file for details on licencing.
      7  *
      8  * Id: ip_dstlist.h,v 2.5.2.2 2012/01/26 05:29:10 darrenr Exp
      9  */
     10 
     11 #ifndef	__IP_DSTLIST_H__
     12 #define	__IP_DSTLIST_H__
     13 
     14 typedef struct ipf_dstnode {
     15 	struct ipf_dstnode	*ipfd_next;
     16 	struct ipf_dstnode	**ipfd_pnext;
     17 	ipfmutex_t		*ipfd_plock;
     18 	ipfmutex_t		ipfd_lock;
     19 	frdest_t		ipfd_dest;
     20 	u_long			ipfd_syncat;
     21 	int			ipfd_flags;
     22 	int			ipfd_size;
     23 	int			ipfd_states;
     24 	int			ipfd_ref;
     25 	int			ipfd_uid;
     26 	char			ipfd_names[1];
     27 } ipf_dstnode_t;
     28 
     29 typedef enum ippool_policy_e {
     30 	IPLDP_NONE = 0,
     31 	IPLDP_ROUNDROBIN,
     32 	IPLDP_CONNECTION,
     33 	IPLDP_RANDOM,
     34 	IPLDP_HASHED,
     35 	IPLDP_SRCHASH,
     36 	IPLDP_DSTHASH
     37 } ippool_policy_t;
     38 
     39 typedef struct ippool_dst {
     40 	struct ippool_dst	*ipld_next;
     41 	struct ippool_dst	**ipld_pnext;
     42 	ipfmutex_t		ipld_lock;
     43 	int			ipld_seed;
     44 	int			ipld_unit;
     45 	int			ipld_ref;
     46 	int			ipld_flags;
     47 	int			ipld_nodes;
     48 	int			ipld_maxnodes;
     49 	ippool_policy_t		ipld_policy;
     50 	ipf_dstnode_t		**ipld_dests;
     51 	ipf_dstnode_t		*ipld_selected;
     52 	char			ipld_name[FR_GROUPLEN];
     53 } ippool_dst_t;
     54 
     55 #define	IPDST_DELETE		0x01
     56 
     57 typedef	struct dstlist_stat_s {
     58 	void			*ipls_list[LOOKUP_POOL_SZ];
     59 	int			ipls_numlists;
     60 	u_long			ipls_nomem;
     61 	int			ipls_numnodes;
     62 	int			ipls_numdereflists;
     63 	int			ipls_numderefnodes;
     64 } ipf_dstl_stat_t;
     65 
     66 extern ipf_lookup_t ipf_dstlist_backend;
     67 
     68 extern int ipf_dstlist_select_node(fr_info_t *, void *, u_32_t *, frdest_t *);
     69 
     70 #endif /* __IP_DSTLIST_H__ */
     71