17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * Copyright (C) 1993-2001 by Darren Reed.
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * See the IPFILTER.LICENCE file for details on licencing.
57c478bd9Sstevel@tonic-gate  *
67c478bd9Sstevel@tonic-gate  * @(#)ip_frag.h	1.5 3/24/96
7*ab25eeb5Syz  * $Id: ip_frag.h,v 2.23.2.2 2005/06/10 18:02:37 darrenr Exp $
87663b816Sml  *
9*ab25eeb5Syz  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
107663b816Sml  * Use is subject to license terms.
117c478bd9Sstevel@tonic-gate  */
127c478bd9Sstevel@tonic-gate 
137663b816Sml #pragma ident	"%Z%%M%	%I%	%E% SMI"
147663b816Sml 
157c478bd9Sstevel@tonic-gate #ifndef	__IP_FRAG_H__
167c478bd9Sstevel@tonic-gate #define	__IP_FRAG_H__
177c478bd9Sstevel@tonic-gate 
187c478bd9Sstevel@tonic-gate #define	IPFT_SIZE	257
197c478bd9Sstevel@tonic-gate 
207c478bd9Sstevel@tonic-gate typedef	struct	ipfr	{
217c478bd9Sstevel@tonic-gate 	struct	ipfr	*ipfr_hnext, **ipfr_hprev;
227c478bd9Sstevel@tonic-gate 	struct	ipfr	*ipfr_next, **ipfr_prev;
237c478bd9Sstevel@tonic-gate 	void	*ipfr_data;
247c478bd9Sstevel@tonic-gate 	void	*ipfr_ifp;
257663b816Sml 	i6addr_t	ipfr_source;
267663b816Sml 	i6addr_t	ipfr_dest;
277c478bd9Sstevel@tonic-gate 	u_32_t	ipfr_optmsk;
287c478bd9Sstevel@tonic-gate 	u_short	ipfr_secmsk;
297c478bd9Sstevel@tonic-gate 	u_short	ipfr_auth;
307663b816Sml 	u_32_t	ipfr_id;
317c478bd9Sstevel@tonic-gate 	u_char	ipfr_p;
327c478bd9Sstevel@tonic-gate 	u_char	ipfr_tos;
337c478bd9Sstevel@tonic-gate 	u_32_t	ipfr_pass;
347c478bd9Sstevel@tonic-gate 	u_short	ipfr_off;
357c478bd9Sstevel@tonic-gate 	u_char	ipfr_ttl;
367c478bd9Sstevel@tonic-gate 	u_char	ipfr_seen0;
377663b816Sml 	u_short ipfr_firstend;
387c478bd9Sstevel@tonic-gate 	frentry_t *ipfr_rule;
397c478bd9Sstevel@tonic-gate } ipfr_t;
407c478bd9Sstevel@tonic-gate 
41*ab25eeb5Syz #define ipfr_src	ipfr_source.in4
42*ab25eeb5Syz #define ipfr_dst	ipfr_dest.in4
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate typedef	struct	ipfrstat {
457c478bd9Sstevel@tonic-gate 	u_long	ifs_exists;	/* add & already exists */
467c478bd9Sstevel@tonic-gate 	u_long	ifs_nomem;
477c478bd9Sstevel@tonic-gate 	u_long	ifs_new;
487c478bd9Sstevel@tonic-gate 	u_long	ifs_hits;
497c478bd9Sstevel@tonic-gate 	u_long	ifs_expire;
507c478bd9Sstevel@tonic-gate 	u_long	ifs_inuse;
517c478bd9Sstevel@tonic-gate 	u_long	ifs_retrans0;
527c478bd9Sstevel@tonic-gate 	u_long	ifs_short;
537c478bd9Sstevel@tonic-gate 	struct	ipfr	**ifs_table;
547c478bd9Sstevel@tonic-gate 	struct	ipfr	**ifs_nattab;
557c478bd9Sstevel@tonic-gate } ipfrstat_t;
567c478bd9Sstevel@tonic-gate 
577663b816Sml #define	IPFR_CMPSZ	(offsetof(ipfr_t, ipfr_tos) - \
587c478bd9Sstevel@tonic-gate 			 offsetof(ipfr_t, ipfr_ifp))
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate extern	int	ipfr_size;
617c478bd9Sstevel@tonic-gate extern	int	fr_ipfrttl;
627c478bd9Sstevel@tonic-gate extern	int	fr_frag_lock;
637c478bd9Sstevel@tonic-gate extern	int	fr_fraginit __P((void));
647c478bd9Sstevel@tonic-gate extern	void	fr_fragunload __P((void));
657c478bd9Sstevel@tonic-gate extern	ipfrstat_t	*fr_fragstats __P((void));
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate extern	int	fr_newfrag __P((fr_info_t *, u_32_t));
687c478bd9Sstevel@tonic-gate extern	frentry_t *fr_knownfrag __P((fr_info_t *, u_32_t *));
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate extern	int	fr_nat_newfrag __P((fr_info_t *, u_32_t, struct nat *));
717c478bd9Sstevel@tonic-gate extern	nat_t	*fr_nat_knownfrag __P((fr_info_t *));
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate extern	int	fr_ipid_newfrag __P((fr_info_t *, u_32_t));
747c478bd9Sstevel@tonic-gate extern	u_32_t	fr_ipid_knownfrag __P((fr_info_t *));
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate extern	void	fr_forget __P((void *));
777c478bd9Sstevel@tonic-gate extern	void	fr_forgetnat __P((void *));
787c478bd9Sstevel@tonic-gate extern	void	fr_fragclear __P((void));
797c478bd9Sstevel@tonic-gate extern	void	fr_fragexpire __P((void));
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate #if     defined(_KERNEL) && ((BSD >= 199306) || SOLARIS || defined(__sgi) \
82*ab25eeb5Syz 	        || defined(__osf__) || (defined(__sgi) && (IRIX >= 60500)))
837c478bd9Sstevel@tonic-gate # if defined(SOLARIS2) && (SOLARIS2 < 7)
847c478bd9Sstevel@tonic-gate extern	void	fr_slowtimer __P((void));
857c478bd9Sstevel@tonic-gate # else
867c478bd9Sstevel@tonic-gate extern	void	fr_slowtimer __P((void *));
877c478bd9Sstevel@tonic-gate # endif
887c478bd9Sstevel@tonic-gate #else
89*ab25eeb5Syz # if defined(linux) && defined(_KERNEL)
90*ab25eeb5Syz extern	void	fr_slowtimer __P((long));
91*ab25eeb5Syz # else
927c478bd9Sstevel@tonic-gate extern	int	fr_slowtimer __P((void));
93*ab25eeb5Syz # endif
947c478bd9Sstevel@tonic-gate #endif
957c478bd9Sstevel@tonic-gate 
967663b816Sml #endif	/* __IP_FRAG_H__ */
97