1*13885a66Sdarrenr /* $NetBSD: ip_auth.h,v 1.3 2012/07/22 14:27:51 darrenr Exp $ */ 2c2aa585cSchristos 3c2aa585cSchristos /* 4*13885a66Sdarrenr * Copyright (C) 2012 by Darren Reed. 5c2aa585cSchristos * 6c2aa585cSchristos * See the IPFILTER.LICENCE file for details on licencing. 7c2aa585cSchristos * 8*13885a66Sdarrenr * Id: ip_auth.h,v 1.1.1.2 2012/07/22 13:45:08 darrenr Exp 9c2aa585cSchristos * 10c2aa585cSchristos */ 110c6adecaSchristos #ifndef _NETINET_IP_AUTH_H_ 120c6adecaSchristos #define _NETINET_IP_AUTH_H_ 13c2aa585cSchristos 14c2aa585cSchristos #define FR_NUMAUTH 32 15c2aa585cSchristos 16c2aa585cSchristos typedef struct frauth { 17c2aa585cSchristos int fra_age; 18c2aa585cSchristos int fra_len; 19c2aa585cSchristos int fra_index; 20c2aa585cSchristos u_32_t fra_pass; 21c2aa585cSchristos fr_info_t fra_info; 22c2aa585cSchristos char *fra_buf; 23c2aa585cSchristos u_32_t fra_flx; 24c2aa585cSchristos #ifdef MENTAT 25c2aa585cSchristos queue_t *fra_q; 26c2aa585cSchristos mb_t *fra_m; 27c2aa585cSchristos #endif 28c2aa585cSchristos } frauth_t; 29c2aa585cSchristos 30c2aa585cSchristos typedef struct frauthent { 31c2aa585cSchristos struct frentry fae_fr; 32c2aa585cSchristos struct frauthent *fae_next; 33c2aa585cSchristos struct frauthent **fae_pnext; 34c2aa585cSchristos u_long fae_age; 35c2aa585cSchristos int fae_ref; 36c2aa585cSchristos } frauthent_t; 37c2aa585cSchristos 38c2aa585cSchristos typedef struct ipf_authstat { 39c2aa585cSchristos U_QUAD_T fas_hits; 40c2aa585cSchristos U_QUAD_T fas_miss; 41c2aa585cSchristos u_long fas_nospace; 42c2aa585cSchristos u_long fas_added; 43c2aa585cSchristos u_long fas_sendfail; 44c2aa585cSchristos u_long fas_sendok; 45c2aa585cSchristos u_long fas_queok; 46c2aa585cSchristos u_long fas_quefail; 47c2aa585cSchristos u_long fas_expire; 48c2aa585cSchristos frauthent_t *fas_faelist; 49c2aa585cSchristos } ipf_authstat_t; 50c2aa585cSchristos 51c2aa585cSchristos 520c6adecaSchristos extern frentry_t *ipf_auth_check(fr_info_t *, u_32_t *); 530c6adecaSchristos extern void ipf_auth_expire(ipf_main_softc_t *); 540c6adecaSchristos extern int ipf_auth_ioctl(ipf_main_softc_t *, void *, ioctlcmd_t, 550c6adecaSchristos int, int, void *); 560c6adecaSchristos extern int ipf_auth_init(void); 570c6adecaSchristos extern int ipf_auth_main_load(void); 580c6adecaSchristos extern int ipf_auth_main_unload(void); 590c6adecaSchristos extern void ipf_auth_soft_destroy(ipf_main_softc_t *, void *); 600c6adecaSchristos extern void *ipf_auth_soft_create(ipf_main_softc_t *); 610c6adecaSchristos extern int ipf_auth_new(mb_t *, fr_info_t *); 620c6adecaSchristos extern int ipf_auth_precmd(ipf_main_softc_t *, ioctlcmd_t, 630c6adecaSchristos frentry_t *, frentry_t **); 640c6adecaSchristos extern void ipf_auth_unload(ipf_main_softc_t *); 650c6adecaSchristos extern int ipf_auth_waiting(ipf_main_softc_t *); 660c6adecaSchristos extern void ipf_auth_setlock(void *, int); 670c6adecaSchristos extern int ipf_auth_soft_init(ipf_main_softc_t *, void *); 680c6adecaSchristos extern int ipf_auth_soft_fini(ipf_main_softc_t *, void *); 690c6adecaSchristos extern u_32_t ipf_auth_pre_scanlist(ipf_main_softc_t *, fr_info_t *, 700c6adecaSchristos u_32_t); 710c6adecaSchristos extern frentry_t **ipf_auth_rulehead(ipf_main_softc_t *); 72c2aa585cSchristos 73c2aa585cSchristos #endif /* __IP_AUTH_H__ */ 74