/*
* Copyright (C) 1993-2001, 2003 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* @(#)ip_compat.h 1.8 1/14/96
* $Id: ip_compat.h,v 2.142.2.30 2005/08/11 15:13:49 darrenr Exp $
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef __IP_COMPAT_H__
#define __IP_COMPAT_H__
#ifndef __P
# ifdef __STDC__
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
#ifndef __STDC__
# undef const
# define const
#endif
# define KERNEL
# define _KERNEL
# define __KERNEL__
#endif
#ifndef SOLARIS
#endif
#if SOLARIS2 >= 8
# ifndef USE_INET6
# define USE_INET6
# endif
#endif
# define USE_INET6
#endif
# define USE_INET6
# define IPFILTER_M_IPFILTER
#endif
# define USE_INET6
#endif
#if defined(__osf__)
# define USE_INET6
#endif
# define USE_INET6
#endif
# define USE_INET6
#endif
#endif
# if !defined(_KERNEL)
# endif
#endif
#ifndef LIFNAMSIZ
# ifdef IF_NAMESIZE
# else
# ifdef IFNAMSIZ
# else
# endif
# endif
#endif
struct ether_addr {
};
#endif
#if defined(__sgi) && !defined(IPFILTER_LKM)
# ifdef __STDC__
# else
# endif
#else
# ifdef __STDC__
# else
# endif
#endif
/*
*/
#ifndef linux
# ifndef _KERNEL
# define ADD_KERNEL
# define _KERNEL
# define KERNEL
# endif
# ifdef __OpenBSD__
struct file;
# endif
# ifdef ADD_KERNEL
# endif
#endif
/* ----------------------------------------------------------------------- */
/* S O L A R I S */
/* ----------------------------------------------------------------------- */
#if SOLARIS
# include <sys/isa_defs.h>
# include <sys/sysmacros.h>
# if SOLARIS2 >= 10
# include <sys/ddi_impldefs.h>
# endif
/*
* what the tools intend, so include radix.h first.
*/
#if SOLARIS2 > 10
#endif
/*
* because Solaris 2 defines these in two places :-/
*/
# ifndef KERNEL
# define ADD_KERNEL
# define _KERNEL
# endif /* _KERNEL */
# if SOLARIS2 >= 8
# endif
# ifdef i386
# define _SYS_PROMIF_H
# endif
# ifdef ADD_KERNEL
# endif
# ifndef KERNEL
# endif
# if SOLARIS2 >= 8
/* Only defined in private include file */
# ifndef V4_PART_OF_V6
# endif
struct ip6_ext {
};
# endif /* SOLARIS2 >= 8 */
# ifdef FW_HOOKS
typedef struct qpktinfo {
/* data that changes per-packet */
} qpktinfo_t;
# endif
# if SOLARIS2 >= 6
# else
typedef unsigned int u_32_t;
# endif
# ifdef _KERNEL
# if SOLARIS2 >= 10
# endif /* SOLARIS2 >= 10 */
# if SOLARIS2 >= 6
# if SOLARIS2 == 6
# else
# endif /* SOLARIS2 == 6 */
# else
mutex_exit(&ipf_rw); }
mutex_exit(&ipf_rw); }
# endif /* SOLARIS2 >= 6 */
# define USE_MUTEXES
# define SPL_NET(x) ;
# define SPL_IMP(x) ;
# define SPL_X(x) ;
# ifdef sparc
# define ntohs(x) (x)
# define ntohl(x) (x)
# define htons(x) (x)
# define htonl(x) (x)
# endif /* sparc */
/*extern phy_if_t get_unit __P((char *, int, ipf_stack_t *));*/
(phy_if_t)(x), (b), sizeof(b))
# endif /* _KERNEL */
# if (SOLARIS2 >= 7)
# ifdef lint
# else
# endif
# endif
# if SOLARIS2 < 6
# endif
typedef int ioctlcmd_t;
#endif /* SOLARIS */
/* ----------------------------------------------------------------------- */
/* H P U X */
/* ----------------------------------------------------------------------- */
#ifdef __hpux
# include <sys/sysmacros.h>
# include <sys/spinlock.h>
# ifdef USE_INET6
# include <netinet/if_ether.h>
# endif
# ifdef _KERNEL
# if (HPUXREV >= 1111)
# define IPL_SELECT
# ifdef IPL_SELECT
# include <sys/kthread_iface.h>
typedef struct iplog_select_s {
int state;
# endif
# endif
# if HPUXREV == 1111
# include "kern_svcs.h"
# else
# include <sys/kern_svcs.h>
# endif
/*
* According to /usr/include/sys/spinlock.h on HP-UX 11.00, these functions
* are available. Attempting to use them actually results in unresolved
* symbols when it comes time to load the module.
* This has been fixed! Yipee!
*/
# if 1
# ifdef __LP64__
# else
# endif
# else /* 0 */
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
# endif
# define USE_MUTEXES
# define MUTEX_DESTROY(x)
/*
* The read-write lock implementation in HP-UX 11.0 is crippled - it can
* only be used by threads working in a user context!
* This has been fixed! Yipee! (Or at least it does in 11.00, not 11.11..)
*/
# if HPUXREV < 1111
# if HPUXREV >= 1111
# else
# endif
# else
# define MUTEX_DOWNGRADE(x)
# endif
# define RW_DESTROY(x)
# if HPUXREV >= 1111
# else
# endif
# define SPL_NET(x) ;
# define SPL_IMP(x) ;
# define SPL_X(x) ;
/*extern void *get_unit __P((char *, int, ipf_stack_t *));*/
# define COPYIFNAME(x, b, v) \
spinunlock(_l); \
}
spinunlock(_l); \
}
# include "qif.h"
# include "pfil.h"
# else /* _KERNEL */
typedef unsigned char uchar_t;
# ifndef _SYS_STREAM_INCLUDED
typedef char * mblk_t;
typedef void * queue_t;
# endif
# endif /* _KERNEL */
# ifdef lint
# else
# endif
typedef int ioctlcmd_t;
typedef int minor_t;
typedef unsigned int u_32_t;
#endif /* __hpux */
/* ----------------------------------------------------------------------- */
/* I R I X */
/* ----------------------------------------------------------------------- */
#ifdef __sgi
# if IRIX < 60500
# endif
typedef int ioctlcmd_t;
# ifdef INET6
# define USE_INET6
# endif
typedef struct {
lock_t *l;
int pl;
} kmutex_t;
# ifdef MUTEX_INIT
# else
# endif
# ifdef _KERNEL
(x)++; MUTEX_EXIT(&ipf_rw); }
(x)--; MUTEX_EXIT(&ipf_rw); }
# define USE_MUTEXES
# ifdef MUTEX_INIT
# include <sys/atomic_ops.h>
MUTEX_DEFAULT, y)
# else
# define MUTEX_DOWNGRADE(x) ;
# define MUTEX_INIT(x,y) (x)->ipf_lk.l = LOCK_ALLOC((uchar_t)-1, IPF_LOCK_PL, (lkinfo_t *)-1, KM_NOSLEEP)
# endif
# else
# endif /* _KERNEL */
#endif /* __sgi */
/* ----------------------------------------------------------------------- */
/* T R U 6 4 */
/* ----------------------------------------------------------------------- */
#ifdef __osf__
# include <sys/sysmacros.h>
# ifdef _KERNEL
# include <net/net_globals.h>
# define USE_MUTEXES
simple_unlock(&ipf_rw); }
simple_unlock(&ipf_rw); }
simple_unlock(&ipf_rw); }
simple_unlock(&ipf_rw); }
# define SPL_NET(x) ;
# define SPL_IMP(x) ;
# define SPL_X(x) ;
# endif /* _KERNEL */
# endif
/*
* These are from's Solaris' #defines for little endian.
*/
struct ip6_ext {
};
typedef int ioctlcmd_t;
/*
* Really, any arch where sizeof(long) != sizeof(int).
*/
typedef unsigned int u_32_t;
#endif /* __osf__ */
/* ----------------------------------------------------------------------- */
/* N E T B S D */
/* ----------------------------------------------------------------------- */
#ifdef __NetBSD__
# if defined(_KERNEL) && !defined(IPFILTER_LKM)
# include "bpfilter.h"
# include "opt_inet.h"
# endif
# ifdef INET6
# define USE_INET6
# endif
# if (__NetBSD_Version__ >= 105000000)
# endif
# endif
# ifdef _KERNEL
# endif /* _KERNEL */
# define COPYIFNAME(x, b, v) \
(void) strncpy(b, \
# else
# endif
typedef int minor_t;
#endif /* __NetBSD__ */
/* ----------------------------------------------------------------------- */
/* F R E E B S D */
/* ----------------------------------------------------------------------- */
#ifdef __FreeBSD__
# if defined(_KERNEL)
# if (__FreeBSD_version >= 500000)
# include "opt_bpf.h"
# else
# include "bpf.h"
# endif
# include "opt_inet6.h"
# endif
# define USE_INET6
# endif
# endif
# if defined(_KERNEL)
# if (__FreeBSD_version >= 400000)
/*
* When #define'd, the 5.2.1 kernel panics when used with the ftp proxy.
* There may be other, safe, kernels but this is not extensively tested yet.
*/
# define HAVE_M_PULLDOWN
# endif
# include "opt_ipfilter.h"
# endif
# if (__FreeBSD_version >= 500043)
# define NETBSD_PF
# endif
# endif /* _KERNEL */
# if (__FreeBSD_version >= 500043)
/*
* Whilst the sx(9) locks on FreeBSD have the right semantics and interface
* for what we want to use them for, despite testing showing they work -
* with a WITNESS kernel, it generates LOR messages.
*/
# if 1
# else
# endif
# endif
# if (__FreeBSD_version >= 501113)
# define COPYIFNAME(x, b) \
(void) strncpy(b, \
# endif
# if (__FreeBSD_version >= 500043)
# else
# endif
# ifdef _KERNEL
# if (__FreeBSD_version >= 500002)
# include <netinet/in_systm.h>
# include <machine/in_cksum.h>
# endif
# if (__FreeBSD_version >= 500043)
# define USE_MUTEXES
/*
* Whilst the sx(9) locks on FreeBSD have the right semantics and interface
* for what we want to use them for, despite testing showing they work -
* with a WITNESS kernel, it generates LOR messages.
*/
# if 1
# define MUTEX_DOWNGRADE(x) ;
# else
# ifdef sx_unlock
# else
# define RWLOCK_EXIT(x) do { \
sx_xunlock(&(x)->ipf_lk); \
else \
sx_sunlock(&(x)->ipf_lk); \
} while (0)
# endif
# endif
# define SPL_X(x) ;
# define SPL_NET(x) ;
# define SPL_IMP(x) ;
# endif /* __FreeBSD_version >= 500043 */
# endif /* _KERNEL */
# if __FreeBSD__ < 3
# else
# if __FreeBSD__ == 3
# if defined(IPFILTER_LKM) && !defined(ACTUALLY_LKM_NOT_KERNEL)
# define ACTUALLY_LKM_NOT_KERNEL
# endif
# endif
# endif
# if (__FreeBSD_version >= 300000)
# else
typedef int ioctlcmd_t;
# endif
typedef int minor_t;
#endif /* __FreeBSD__ */
/* ----------------------------------------------------------------------- */
/* O P E N B S D */
/* ----------------------------------------------------------------------- */
#ifdef __OpenBSD__
# ifdef INET6
# define USE_INET6
# endif
# ifdef _KERNEL
# if !defined(IPFILTER_LKM)
# include "bpfilter.h"
# endif
# if (OpenBSD >= 200311)
# if defined(USE_INET6)
# endif
# endif
# if (OpenBSD >= 200012)
# endif
# endif /* _KERNEL */
# if (OpenBSD >= 199603)
# define COPYIFNAME(x, b, v) \
(void) strncpy(b, \
# else
# endif
typedef int minor_t;
#endif /* __OpenBSD__ */
/* ----------------------------------------------------------------------- */
/* B S D O S */
/* ----------------------------------------------------------------------- */
#ifdef _BSDI_VERSION
# ifdef INET6
# define USE_INET6
# endif
# ifdef _KERNEL
# endif /* _KERNEL */
# if (_BSDI_VERSION >= 199701)
# else
typedef int ioctlcmd_t;
# endif
#endif /* _BSDI_VERSION */
/* ----------------------------------------------------------------------- */
/* S U N O S 4 */
/* ----------------------------------------------------------------------- */
# ifdef _KERNEL
# include <sys/kmem_alloc.h>
# endif
typedef int ioctlcmd_t;
typedef int minor_t;
typedef unsigned int u_32_t;
#endif /* SunOS 4 */
/* ----------------------------------------------------------------------- */
/* L I N U X */
/* ----------------------------------------------------------------------- */
#if defined(linux) && !defined(OS_RECOGNISED)
# if LINUX >= 20600
# endif
# ifdef USE_INET6
struct ip6_ext {
};
# endif
# ifdef _KERNEL
# define USE_MUTEXES
# define MUTEX_DESTROY(x) do { } while (0)
# define RW_DESTROY(x) do { } while (0)
# define SPL_IMP(x) do { } while (0)
# define SPL_NET(x) do { } while (0)
# define SPL_X(x) do { } while (0)
# define splnet(x) ;
# else
# include <net/ethernet.h>
struct mbuf {
};
# ifndef _NET_ROUTE_H
struct rtentry {
};
# endif
struct ifnet {
int if_unit;
};
# endif /* _KERNEL */
# define COPYIFNAME(x, b) \
(void) strncpy(b, \
typedef struct uio {
void *uio_file;
char *uio_buf;
int uio_iovcnt;
int uio_offset;
int uio_rw;
} uio_t;
typedef int minor_t;
#endif
/* ----------------------------------------------------------------------- */
/* A I X */
/* ----------------------------------------------------------------------- */
#if defined(_AIX51)
# include <sys/sysmacros.h>
# ifdef _KERNEL
# define rw_read_locked(x) 0
# include <net/net_globals.h>
# include <net/net_malloc.h>
(u_short)y, 0); \
(u_short)y, 0); \
simple_lock_init((x)->ipf_lk)
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
MUTEX_EXIT(&ipf_rw); }
# define GETKTIME(x)
# define IPF_PANIC(x,y)
# endif /* _KERNEL */
/*
* These are from's Solaris' #defines for little endian.
*/
#if !defined(IP6F_MORE_FRAG)
#endif
#if !defined(IP6F_RESERVED_MASK)
#endif
#if !defined(IP6F_OFF_MASK)
#endif
struct ip6_ext {
};
typedef int ioctlcmd_t;
typedef int minor_t;
/*
* Really, any arch where sizeof(long) != sizeof(int).
*/
typedef unsigned int u_32_t;
#endif /* _AIX51 */
#ifndef OS_RECOGNISED
#endif
/* ----------------------------------------------------------------------- */
/* G E N E R I C */
/* ----------------------------------------------------------------------- */
#ifndef OS_RECOGNISED
#endif
/*
* For BSD kernels, if bpf is in the kernel, enable ipfilter to use bpf in
* filter rules.
*/
# define IPFILTER_BPF
#endif
/*
* Userland locking primitives
*/
typedef struct {
char *eMm_owner;
char *eMm_heldin;
int eMm_held;
int eMm_heldat;
#ifdef __hpux
#endif
} eMmutex_t;
typedef struct {
char *eMrw_owner;
char *eMrw_heldin;
short eMrw_read;
short eMrw_write;
int eMrw_heldat;
#ifdef __hpux
#endif
} eMrwlock_t;
typedef union {
#ifdef KMUTEX_T
struct {
char *ipf_lname;
} ipf_lkun_s;
#endif
} ipfmutex_t;
typedef union {
#ifdef KRWLOCK_T
struct {
char *ipf_lname;
int ipf_sr;
int ipf_sw;
} ipf_lkun_s;
#endif
} ipfrwlock_t;
#if !defined(__GNUC__) || \
# ifndef INLINE
# define INLINE
# endif
#else
#endif
#endif
/*
* In a non-kernel environment, there are a lot of macros that need to be
* filled in to be null-ops or to point to some compatibility function,
* somewhere in userland.
*/
#ifndef _KERNEL
typedef struct mb_s {
int mb_len;
} mb_t;
# define M_DUPLICATE(x) (x)
# define FREE_MB_T(x)
# define WAKEUP(x,y) ;
# define IPF_PANIC(x,y) ;
# define PANIC(x,y) ;
# define SPL_NET(x) ;
# define SPL_IMP(x) ;
# define SPL_X(x) ;
(b), (l))
(l))
# ifndef CACHE_HASH
# endif
__FILE__, \
#define NET_IS_HCK_L3_FULL(n, x) (0)
#define NET_IS_HCK_L3_PART(n, x) (0)
#define NET_IS_HCK_L4_FULL(n, x) (0)
#define NET_IS_HCK_L4_PART(n, x) (0)
#endif
#ifndef IP_OFFMASK
#endif
/*
* On BSD's use quad_t as a guarantee for getting at least a 64bit sized
* object.
*/
#if BSD > 199306
# define USE_QUAD_T
#else /* BSD > 199306 */
# define QUAD_T long
#endif /* BSD > 199306 */
#ifdef USE_INET6
# if !defined(linux)
# endif
# endif
# endif
#endif
#ifndef MAX
# define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
#if defined(_KERNEL)
# ifdef MENTAT
# else
# endif
defined(_BSDI_VERSION)
# endif
# if !defined(__FreeBSD__) || (defined (__FreeBSD_version) && \
(__FreeBSD_version >= 300000))
# include <uvm/uvm_extern.h>
# else
# include <vm/vm_extern.h>
# endif
# else /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD_version >= 300000) */
# endif /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD_version >= 300000) */
# ifdef IPFILTER_M_IPFILTER
# else /* IPFILTER_M_IPFILTER */
# ifdef M_PFIL
# else
# ifdef M_IPFILTER
# else
# endif /* M_IPFILTER */
# endif /* M_PFIL */
# endif /* IPFILTER_M_IPFILTER */
# endif /* (Free)BSD */
# if !defined(USE_MUTEXES) && !defined(SPL_NET)
# else
# endif /* NetBSD && (NetBSD <= 1991011) && (NetBSD >= 199407) */
# endif /* !USE_MUTEXES */
# ifndef FREE_MB_T
# endif
# ifndef MTOD
# endif
# ifndef COPYIN
# endif
# ifndef KMALLOC
# endif
# ifndef GET_MINOR
# endif
#endif /* _KERNEL */
#ifndef IFNAME
#endif
#ifndef COPYIFNAME
# define NEED_FRGETIFNAME
# define COPYIFNAME(x, b, v) \
fr_getifname((struct ifnet *)x, b)
#endif
#ifndef ASSERT
# define ASSERT(x)
#endif
/*
* Because the ctype(3) posix definition, if used "safely" in code everywhere,
* would mean all normal code that walks through strings needed casts. Yuck.
*/
/*
* If mutexes aren't being used, turn all the mutex functions into null-ops.
*/
#if !defined(USE_MUTEXES)
# define MUTEX_ENTER(x) ;
# define READ_ENTER(x) ;
# define WRITE_ENTER(x) ;
# define MUTEX_DOWNGRADE(x) ;
# define RWLOCK_INIT(x, y) ;
# define RWLOCK_EXIT(x) ;
# define RW_DESTROY(x) ;
# define MUTEX_EXIT(x) ;
# define MUTEX_INIT(x,y) ;
# define MUTEX_DESTROY(x) ;
# define MUTEX_NUKE(x) ;
#endif /* !USE_MUTEXES */
#ifndef ATOMIC_INC
# define ATOMIC_INC(x) (x)++
# define ATOMIC_DEC(x) (x)--
#endif
# define SPL_INT(x) int x
#else
# define SPL_INT(x)
#endif
/*
* If there are no atomic operations for bit sizes defined, define them to all
* use a generic one that works for all sizes.
*/
#ifndef ATOMIC_INCL
#endif
#ifndef HDR_T_PRIVATE
#endif
#ifndef FR_GROUPLEN
#endif
#ifdef offsetof
#endif
#ifndef offsetof
#endif
/*
* This set of macros has been brought about because on Tru64 it is not
* possible to easily assign or examine values in a structure that are
* bit fields.
*/
#ifndef IP_V
#endif
#ifndef IP_V_A
#endif
#ifndef IP_HL
#endif
#ifndef IP_HL_A
#endif
#ifndef TCP_X2
#endif
#ifndef TCP_X2_A
#endif
#ifndef TCP_OFF
#endif
#ifndef TCP_OFF_A
#endif
/*
* XXX - This is one of those *awful* hacks which nobody likes
*/
#ifdef ultrix
#define A_A
#else
#define A_A &
#endif
#endif
/*
* Security Options for Intenet Protocol (IPSO) as defined in RFC 1108.
*
* Basic Option
*
* 00000001 - (Reserved 4)
* 00111101 - Top Secret
* 01011010 - Secret
* 10010110 - Confidential
* 01100110 - (Reserved 3)
* 11001100 - (Reserved 2)
* 10101011 - Unclassified
* 11110001 - (Reserved 1)
*/
/*
* IP option #defines
*/
#ifndef IPOPT_SID
#endif
#ifndef TCPOPT_EOL
# define TCPOPT_EOL 0
#endif
#ifndef TCPOPT_NOP
#endif
#ifndef TCPOPT_MAXSEG
#endif
#ifndef TCPOLEN_MAXSEG
#endif
#ifndef TCPOPT_WINDOW
#endif
#ifndef TCPOLEN_WINDOW
#endif
#ifndef TCPOPT_SACK_PERMITTED
#endif
#ifndef TCPOLEN_SACK_PERMITTED
#endif
#ifndef TCPOPT_SACK
#endif
#ifndef TCPOPT_TIMESTAMP
#endif
#ifndef ICMP_MINLEN
#endif
#ifndef ICMP_ECHOREPLY
# define ICMP_ECHOREPLY 0
#endif
#ifndef ICMP_UNREACH
#endif
#ifndef ICMP_UNREACH_NET
# define ICMP_UNREACH_NET 0
#endif
#ifndef ICMP_UNREACH_HOST
#endif
#ifndef ICMP_UNREACH_PROTOCOL
#endif
#ifndef ICMP_UNREACH_PORT
#endif
#ifndef ICMP_UNREACH_NEEDFRAG
#endif
#ifndef ICMP_UNREACH_SRCFAIL
#endif
#ifndef ICMP_UNREACH_NET_UNKNOWN
#endif
#ifndef ICMP_UNREACH_HOST_UNKNOWN
#endif
#ifndef ICMP_UNREACH_ISOLATED
#endif
#ifndef ICMP_UNREACH_NET_PROHIB
#endif
#ifndef ICMP_UNREACH_HOST_PROHIB
#endif
#ifndef ICMP_UNREACH_TOSNET
#endif
#ifndef ICMP_UNREACH_TOSHOST
#endif
#ifndef ICMP_UNREACH_ADMIN_PROHIBIT
#endif
#ifndef ICMP_UNREACH_FILTER
#endif
#ifndef ICMP_UNREACH_HOST_PRECEDENCE
#endif
#ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF
#endif
#ifndef ICMP_SOURCEQUENCH
#endif
#ifndef ICMP_REDIRECT_NET
# define ICMP_REDIRECT_NET 0
#endif
#ifndef ICMP_REDIRECT_HOST
#endif
#ifndef ICMP_REDIRECT_TOSNET
#endif
#ifndef ICMP_REDIRECT_TOSHOST
#endif
#ifndef ICMP_ALTHOSTADDR
#endif
#ifndef ICMP_TIMXCEED
#endif
#ifndef ICMP_TIMXCEED_INTRANS
# define ICMP_TIMXCEED_INTRANS 0
#endif
#ifndef ICMP_TIMXCEED_REASS
#endif
#ifndef ICMP_PARAMPROB
#endif
#ifndef ICMP_PARAMPROB_ERRATPTR
# define ICMP_PARAMPROB_ERRATPTR 0
#endif
#ifndef ICMP_PARAMPROB_OPTABSENT
#endif
#ifndef ICMP_PARAMPROB_LENGTH
#endif
#ifndef ICMP_TSTAMP
#endif
#ifndef ICMP_TSTAMPREPLY
#endif
#ifndef ICMP_IREQ
#endif
#ifndef ICMP_IREQREPLY
#endif
#ifndef ICMP_MASKREQ
#endif
#ifndef ICMP_MASKREPLY
#endif
#ifndef ICMP_TRACEROUTE
#endif
#ifndef ICMP_DATACONVERR
#endif
#ifndef ICMP_MOBILE_REDIRECT
#endif
#ifndef ICMP_IPV6_WHEREAREYOU
#endif
#ifndef ICMP_IPV6_IAMHERE
#endif
#ifndef ICMP_MOBILE_REGREQUEST
#endif
#ifndef ICMP_MOBILE_REGREPLY
#endif
#ifndef ICMP_SKIP
#endif
#ifndef ICMP_PHOTURIS
#endif
#ifndef ICMP_PHOTURIS_UNKNOWN_INDEX
#endif
#ifndef ICMP_PHOTURIS_AUTH_FAILED
#endif
#ifndef ICMP_PHOTURIS_DECRYPT_FAILED
#endif
#ifndef IPVERSION
#endif
#ifndef IPOPT_MINOFF
#endif
#ifndef IPOPT_COPIED
#endif
#ifndef IPOPT_EOL
# define IPOPT_EOL 0
#endif
#ifndef IPOPT_NOP
#endif
#ifndef IP_MF
#endif
#ifndef ETHERTYPE_IP
#endif
#ifndef TH_FIN
#endif
#ifndef TH_SYN
#endif
#ifndef TH_RST
#endif
#ifndef TH_PUSH
#endif
#ifndef TH_ACK
#endif
#ifndef TH_URG
#endif
#ifndef IPOPT_EOL
# define IPOPT_EOL 0
#endif
#ifndef IPOPT_NOP
#endif
#ifndef IPOPT_RR
#endif
#ifndef IPOPT_TS
#endif
#ifndef IPOPT_SECURITY
#endif
#ifndef IPOPT_LSRR
#endif
#ifndef IPOPT_SATID
#endif
#ifndef IPOPT_SSRR
#endif
#ifndef IPOPT_SECUR_UNCLASS
#endif
#ifndef IPOPT_SECUR_CONFID
#endif
#ifndef IPOPT_SECUR_EFTO
#endif
#ifndef IPOPT_SECUR_MMMM
#endif
#ifndef IPOPT_SECUR_RESTR
#endif
#ifndef IPOPT_SECUR_SECRET
#endif
#ifndef IPOPT_SECUR_TOPSECRET
#endif
#ifndef IPOPT_OLEN
#endif
#ifndef IPPROTO_HOPOPTS
# define IPPROTO_HOPOPTS 0
#endif
#ifndef IPPROTO_ENCAP
#endif
#ifndef IPPROTO_IPV6
#endif
#ifndef IPPROTO_ROUTING
#endif
#ifndef IPPROTO_FRAGMENT
#endif
#ifndef IPPROTO_GRE
#endif
#ifndef IPPROTO_ESP
#endif
#ifndef IPPROTO_AH
#endif
#ifndef IPPROTO_ICMPV6
#endif
#ifndef IPPROTO_NONE
#endif
#ifndef IPPROTO_DSTOPTS
#endif
#ifndef IPPROTO_FRAGMENT
#endif
#ifndef ICMP_ROUTERADVERT
#endif
#ifndef ICMP_ROUTERSOLICIT
#endif
#ifndef ICMP6_DST_UNREACH
#endif
#ifndef ICMP6_PACKET_TOO_BIG
#endif
#ifndef ICMP6_TIME_EXCEEDED
#endif
#ifndef ICMP6_PARAM_PROB
#endif
#ifndef ICMP6_ECHO_REQUEST
#endif
#ifndef ICMP6_ECHO_REPLY
#endif
#ifndef ICMP6_MEMBERSHIP_QUERY
#endif
#ifndef MLD6_LISTENER_QUERY
#endif
#ifndef ICMP6_MEMBERSHIP_REPORT
#endif
#ifndef MLD6_LISTENER_REPORT
#endif
#ifndef ICMP6_MEMBERSHIP_REDUCTION
#endif
#ifndef MLD6_LISTENER_DONE
#endif
#ifndef ND_ROUTER_SOLICIT
#endif
#ifndef ND_ROUTER_ADVERT
#endif
#ifndef ND_NEIGHBOR_SOLICIT
#endif
#ifndef ND_NEIGHBOR_ADVERT
#endif
#ifndef ND_REDIRECT
#endif
#ifndef ICMP6_ROUTER_RENUMBERING
#endif
#ifndef ICMP6_WRUREQUEST
#endif
#ifndef ICMP6_WRUREPLY
#endif
#ifndef ICMP6_FQDN_QUERY
#endif
#ifndef ICMP6_FQDN_REPLY
#endif
#ifndef ICMP6_NI_QUERY
#endif
#ifndef ICMP6_NI_REPLY
#endif
#ifndef MLD6_MTRACE_RESP
#endif
#ifndef MLD6_MTRACE
#endif
#ifndef ICMP6_HADISCOV_REQUEST
#endif
#ifndef ICMP6_HADISCOV_REPLY
#endif
#ifndef ICMP6_MOBILEPREFIX_SOLICIT
#endif
#ifndef ICMP6_MOBILEPREFIX_ADVERT
#endif
#ifndef ICMP6_MAXTYPE
#endif
#ifndef ICMP6_DST_UNREACH_NOROUTE
# define ICMP6_DST_UNREACH_NOROUTE 0
#endif
#ifndef ICMP6_DST_UNREACH_ADMIN
#endif
#ifndef ICMP6_DST_UNREACH_NOTNEIGHBOR
#endif
#ifndef ICMP6_DST_UNREACH_BEYONDSCOPE
#endif
#ifndef ICMP6_DST_UNREACH_ADDR
#endif
#ifndef ICMP6_DST_UNREACH_NOPORT
#endif
#ifndef ICMP6_TIME_EXCEED_TRANSIT
# define ICMP6_TIME_EXCEED_TRANSIT 0
#endif
#ifndef ICMP6_TIME_EXCEED_REASSEMBLY
#endif
#ifndef ICMP6_NI_SUCCESS
# define ICMP6_NI_SUCCESS 0
#endif
#ifndef ICMP6_NI_REFUSED
#endif
#ifndef ICMP6_NI_UNKNOWN
#endif
#ifndef ICMP6_ROUTER_RENUMBERING_COMMAND
# define ICMP6_ROUTER_RENUMBERING_COMMAND 0
#endif
#ifndef ICMP6_ROUTER_RENUMBERING_RESULT
#endif
#endif
#ifndef ICMP6_PARAMPROB_HEADER
# define ICMP6_PARAMPROB_HEADER 0
#endif
#ifndef ICMP6_PARAMPROB_NEXTHEADER
#endif
#ifndef ICMP6_PARAMPROB_OPTION
#endif
#ifndef ICMP6_NI_SUBJ_IPV6
# define ICMP6_NI_SUBJ_IPV6 0
#endif
#ifndef ICMP6_NI_SUBJ_FQDN
#endif
#ifndef ICMP6_NI_SUBJ_IPV4
#endif
#if !defined(IPV6_FLOWINFO_MASK)
# else
# endif /* LITTLE_ENDIAN */
# endif
#endif
#if !defined(IPV6_FLOWLABEL_MASK)
# else
# endif /* LITTLE_ENDIAN */
# endif
#endif
/*
* ECN is a new addition to TCP - RFC 2481
*/
#ifndef TH_ECN
#endif
#ifndef TH_CWR
#endif
/*
* TCP States
*/
/* states < IPF_TCPS_ESTABLISHED are those where connections not established */
/* states > IPF_TCPS_CLOSE_WAIT are those where user has closed */
/* states > IPF_TCPS_CLOSE_WAIT && < IPF_TCPS_FIN_WAIT_2 await ACK of FIN */
#ifndef IFNAMSIZ
#endif
#ifndef LOG_FTP
#endif
#ifndef LOG_AUTHPRIV
#endif
#ifndef LOG_AUDIT
#endif
#ifndef LOG_NTP
#endif
#ifndef LOG_SECURITY
#endif
#ifndef LOG_LFMT
#endif
#ifndef LOG_CONSOLE
#endif
/*
* ICMP error replies have an IP header (20 bytes), 8 bytes of ICMP data,
* another IP header and then 64 bits of data, totalling 56. Of course,
* the last 64 bits is dependent on that being available.
*/
#ifndef MIN
# define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifdef IPF_DEBUG
#else
# define DPRINT(x)
#endif
#ifdef RESCUE
#endif
#ifndef DTRACE_PROBE
#endif
#ifndef IPF_IS_LOOPBACK
# define IPF_IS_LOOPBACK(x) 0
#endif
#endif /* __IP_COMPAT_H__ */