xref: /netbsd/sys/external/bsd/ipf/netinet/ip_auth.h (revision f52ace7a)
1 /*	$NetBSD: ip_auth.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_auth.h,v 1.1.1.2 2012/07/22 13:45:08 darrenr Exp
9  *
10  */
11 #ifndef _NETINET_IP_AUTH_H_
12 #define _NETINET_IP_AUTH_H_
13 
14 #define FR_NUMAUTH      32
15 
16 typedef struct  frauth {
17 	int	fra_age;
18 	int	fra_len;
19 	int	fra_index;
20 	u_32_t	fra_pass;
21 	fr_info_t	fra_info;
22 	char	*fra_buf;
23 	u_32_t	fra_flx;
24 #ifdef	MENTAT
25 	queue_t	*fra_q;
26 	mb_t	*fra_m;
27 #endif
28 } frauth_t;
29 
30 typedef	struct	frauthent  {
31 	struct	frentry	fae_fr;
32 	struct	frauthent	*fae_next;
33 	struct	frauthent	**fae_pnext;
34 	u_long	fae_age;
35 	int	fae_ref;
36 } frauthent_t;
37 
38 typedef struct  ipf_authstat {
39 	U_QUAD_T	fas_hits;
40 	U_QUAD_T	fas_miss;
41 	u_long		fas_nospace;
42 	u_long		fas_added;
43 	u_long		fas_sendfail;
44 	u_long		fas_sendok;
45 	u_long		fas_queok;
46 	u_long		fas_quefail;
47 	u_long		fas_expire;
48 	frauthent_t	*fas_faelist;
49 } ipf_authstat_t;
50 
51 
52 extern	frentry_t *ipf_auth_check(fr_info_t *, u_32_t *);
53 extern	void	ipf_auth_expire(ipf_main_softc_t *);
54 extern	int	ipf_auth_ioctl(ipf_main_softc_t *, void *, ioctlcmd_t,
55 				    int, int, void *);
56 extern	int	ipf_auth_init(void);
57 extern	int	ipf_auth_main_load(void);
58 extern	int	ipf_auth_main_unload(void);
59 extern	void	ipf_auth_soft_destroy(ipf_main_softc_t *, void *);
60 extern	void	*ipf_auth_soft_create(ipf_main_softc_t *);
61 extern	int	ipf_auth_new(mb_t *, fr_info_t *);
62 extern	int	ipf_auth_precmd(ipf_main_softc_t *, ioctlcmd_t,
63 				     frentry_t *, frentry_t **);
64 extern	void	ipf_auth_unload(ipf_main_softc_t *);
65 extern	int	ipf_auth_waiting(ipf_main_softc_t *);
66 extern	void	ipf_auth_setlock(void *, int);
67 extern	int	ipf_auth_soft_init(ipf_main_softc_t *, void *);
68 extern	int	ipf_auth_soft_fini(ipf_main_softc_t *, void *);
69 extern	u_32_t	ipf_auth_pre_scanlist(ipf_main_softc_t *, fr_info_t *,
70 					   u_32_t);
71 extern	frentry_t **ipf_auth_rulehead(ipf_main_softc_t *);
72 
73 #endif	/* __IP_AUTH_H__ */
74