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