Deleted Added
full compact
ip_compat.h (146277) ip_compat.h (153084)
1/* $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_compat.h 146277 2005-05-16 16:22:55Z darrenr $ */
2
3/*
4 * Copyright (C) 1993-2001, 2003 by Darren Reed.
5 *
6 * See the IPFILTER.LICENCE file for details on licencing.
7 *
8 * @(#)ip_compat.h 1.8 1/14/96
1/*
2 * Copyright (C) 1993-2001, 2003 by Darren Reed.
3 *
4 * See the IPFILTER.LICENCE file for details on licencing.
5 *
6 * @(#)ip_compat.h 1.8 1/14/96
9 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_compat.h 146277 2005-05-16 16:22:55Z darrenr $
7 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_compat.h 153084 2005-12-04 10:06:06Z ru $
10 * Id: ip_compat.h,v 2.142.2.25 2005/03/28 09:33:36 darrenr Exp
11 */
12
13#ifndef __IP_COMPAT_H__
14#define __IP_COMPAT_H__
15
16#ifndef __P
17# ifdef __STDC__

--- 14 unchanged lines hidden (view full) ---

32# define KERNEL
33# define _KERNEL
34# define __KERNEL__
35#endif
36
37#ifndef SOLARIS
38#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
39#endif
8 * Id: ip_compat.h,v 2.142.2.25 2005/03/28 09:33:36 darrenr Exp
9 */
10
11#ifndef __IP_COMPAT_H__
12#define __IP_COMPAT_H__
13
14#ifndef __P
15# ifdef __STDC__

--- 14 unchanged lines hidden (view full) ---

30# define KERNEL
31# define _KERNEL
32# define __KERNEL__
33#endif
34
35#ifndef SOLARIS
36#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
37#endif
40#if SOLARIS2 >= 8
38#if defined(SOLARIS2) && SOLARIS2 >= 8
41# ifndef USE_INET6
42# define USE_INET6
43# endif
44#endif
45#if defined(__FreeBSD_version) && (__FreeBSD_version >= 400000) && \
46 !defined(_KERNEL) && !defined(USE_INET6) && !defined(NOINET6)
47# define USE_INET6
48#endif

--- 88 unchanged lines hidden (view full) ---

137#if SOLARIS
138# define MENTAT 1
139# include <sys/cmn_err.h>
140# include <sys/isa_defs.h>
141# include <sys/stream.h>
142# include <sys/ioccom.h>
143# include <sys/sysmacros.h>
144# include <sys/kmem.h>
39# ifndef USE_INET6
40# define USE_INET6
41# endif
42#endif
43#if defined(__FreeBSD_version) && (__FreeBSD_version >= 400000) && \
44 !defined(_KERNEL) && !defined(USE_INET6) && !defined(NOINET6)
45# define USE_INET6
46#endif

--- 88 unchanged lines hidden (view full) ---

135#if SOLARIS
136# define MENTAT 1
137# include <sys/cmn_err.h>
138# include <sys/isa_defs.h>
139# include <sys/stream.h>
140# include <sys/ioccom.h>
141# include <sys/sysmacros.h>
142# include <sys/kmem.h>
145# if SOLARIS2 >= 10
143# if defined(SOLARIS2) && SOLARIS2 >= 10
146# include <sys/procset.h>
147# include <sys/proc.h>
148# include <sys/devops.h>
149# include <sys/ddi_impldefs.h>
150# endif
151/*
152 * because Solaris 2 defines these in two places :-/
153 */
154# ifndef KERNEL
155# define _KERNEL
156# undef RES_INIT
157# endif /* _KERNEL */
158
144# include <sys/procset.h>
145# include <sys/proc.h>
146# include <sys/devops.h>
147# include <sys/ddi_impldefs.h>
148# endif
149/*
150 * because Solaris 2 defines these in two places :-/
151 */
152# ifndef KERNEL
153# define _KERNEL
154# undef RES_INIT
155# endif /* _KERNEL */
156
159# if SOLARIS2 >= 8
157# if defined(SOLARIS2) && SOLARIS2 >= 8
160# include <netinet/ip6.h>
161# include <netinet/icmp6.h>
162# endif
163
164# include <inet/common.h>
165/* These 5 are defined in <inet/ip.h> and <netinet/ip.h> */
166# undef IPOPT_EOL
167# undef IPOPT_NOP

--- 4 unchanged lines hidden (view full) ---

172# define _SYS_PROMIF_H
173# endif
174# include <inet/ip.h>
175# undef COPYOUT
176# include <inet/ip_ire.h>
177# ifndef KERNEL
178# undef _KERNEL
179# endif
158# include <netinet/ip6.h>
159# include <netinet/icmp6.h>
160# endif
161
162# include <inet/common.h>
163/* These 5 are defined in <inet/ip.h> and <netinet/ip.h> */
164# undef IPOPT_EOL
165# undef IPOPT_NOP

--- 4 unchanged lines hidden (view full) ---

170# define _SYS_PROMIF_H
171# endif
172# include <inet/ip.h>
173# undef COPYOUT
174# include <inet/ip_ire.h>
175# ifndef KERNEL
176# undef _KERNEL
177# endif
180# if SOLARIS2 >= 8
178# if defined(SOLARIS2) && SOLARIS2 >= 8
181# define SNPRINTF snprintf
182
183# include <inet/ip_if.h>
184# define ipif_local_addr ipif_lcl_addr
185/* Only defined in private include file */
186# ifndef V4_PART_OF_V6
187# define V4_PART_OF_V6(v6) v6.s6_addr32[3]
188# endif
189struct ip6_ext {
190 u_char ip6e_nxt;
191 u_char ip6e_len;
192};
193# endif /* SOLARIS2 >= 8 */
194
179# define SNPRINTF snprintf
180
181# include <inet/ip_if.h>
182# define ipif_local_addr ipif_lcl_addr
183/* Only defined in private include file */
184# ifndef V4_PART_OF_V6
185# define V4_PART_OF_V6(v6) v6.s6_addr32[3]
186# endif
187struct ip6_ext {
188 u_char ip6e_nxt;
189 u_char ip6e_len;
190};
191# endif /* SOLARIS2 >= 8 */
192
195# if SOLARIS2 >= 6
193# if defined(SOLARIS2) && SOLARIS2 >= 6
196# include <sys/atomic.h>
197typedef uint32_t u_32_t;
198# else
199typedef unsigned int u_32_t;
200# endif
201# define U_32_T 1
202
203# ifdef _KERNEL
204# define KRWLOCK_T krwlock_t
205# define KMUTEX_T kmutex_t
206# include "qif.h"
207# include "pfil.h"
194# include <sys/atomic.h>
195typedef uint32_t u_32_t;
196# else
197typedef unsigned int u_32_t;
198# endif
199# define U_32_T 1
200
201# ifdef _KERNEL
202# define KRWLOCK_T krwlock_t
203# define KMUTEX_T kmutex_t
204# include "qif.h"
205# include "pfil.h"
208# if SOLARIS2 >= 6
206# if defined(SOLARIS2) && SOLARIS2 >= 6
209# if SOLARIS2 == 6
210# define ATOMIC_INCL(x) atomic_add_long((uint32_t*)&(x), 1)
211# define ATOMIC_DECL(x) atomic_add_long((uint32_t*)&(x), -1)
212# else
213# define ATOMIC_INCL(x) atomic_add_long(&(x), 1)
214# define ATOMIC_DECL(x) atomic_add_long(&(x), -1)
215# endif /* SOLARIS2 == 6 */
216# define ATOMIC_INC64(x) atomic_add_64((uint64_t*)&(x), 1)

--- 56 unchanged lines hidden (view full) ---

273# define MTYPE(m) ((m)->b_datap->db_type)
274# define FREE_MB_T(m) freemsg(m)
275# define m_next b_cont
276# define CACHE_HASH(x) (((qpktinfo_t *)(x)->fin_qpi)->qpi_num & 7)
277# define IPF_PANIC(x,y) if (x) { printf y; cmn_err(CE_PANIC, "ipf_panic"); }
278typedef mblk_t mb_t;
279# endif /* _KERNEL */
280
207# if SOLARIS2 == 6
208# define ATOMIC_INCL(x) atomic_add_long((uint32_t*)&(x), 1)
209# define ATOMIC_DECL(x) atomic_add_long((uint32_t*)&(x), -1)
210# else
211# define ATOMIC_INCL(x) atomic_add_long(&(x), 1)
212# define ATOMIC_DECL(x) atomic_add_long(&(x), -1)
213# endif /* SOLARIS2 == 6 */
214# define ATOMIC_INC64(x) atomic_add_64((uint64_t*)&(x), 1)

--- 56 unchanged lines hidden (view full) ---

271# define MTYPE(m) ((m)->b_datap->db_type)
272# define FREE_MB_T(m) freemsg(m)
273# define m_next b_cont
274# define CACHE_HASH(x) (((qpktinfo_t *)(x)->fin_qpi)->qpi_num & 7)
275# define IPF_PANIC(x,y) if (x) { printf y; cmn_err(CE_PANIC, "ipf_panic"); }
276typedef mblk_t mb_t;
277# endif /* _KERNEL */
278
281# if (SOLARIS2 >= 7)
279# if defined(SOLARIS2) && (SOLARIS2 >= 7)
282# ifdef lint
283# define ALIGN32(ptr) (ptr ? 0L : 0L)
284# define ALIGN16(ptr) (ptr ? 0L : 0L)
285# else
286# define ALIGN32(ptr) (ptr)
287# define ALIGN16(ptr) (ptr)
288# endif
289# endif
290
280# ifdef lint
281# define ALIGN32(ptr) (ptr ? 0L : 0L)
282# define ALIGN16(ptr) (ptr ? 0L : 0L)
283# else
284# define ALIGN32(ptr) (ptr)
285# define ALIGN16(ptr) (ptr)
286# endif
287# endif
288
291# if SOLARIS2 < 6
289# if defined(SOLARIS2) && SOLARIS2 < 6
292typedef struct uio uio_t;
293# endif
294typedef int ioctlcmd_t;
295
296# define OS_RECOGNISED 1
297
298#endif /* SOLARIS */
299

--- 917 unchanged lines hidden (view full) ---

1217/* ----------------------------------------------------------------------- */
1218#ifndef OS_RECOGNISED
1219#endif
1220
1221/*
1222 * For BSD kernels, if bpf is in the kernel, enable ipfilter to use bpf in
1223 * filter rules.
1224 */
290typedef struct uio uio_t;
291# endif
292typedef int ioctlcmd_t;
293
294# define OS_RECOGNISED 1
295
296#endif /* SOLARIS */
297

--- 917 unchanged lines hidden (view full) ---

1215/* ----------------------------------------------------------------------- */
1216#ifndef OS_RECOGNISED
1217#endif
1218
1219/*
1220 * For BSD kernels, if bpf is in the kernel, enable ipfilter to use bpf in
1221 * filter rules.
1222 */
1225#if !defined(IPFILTER_BPF) && ((NBPF > 0) || (NBPFILTER > 0) || (DEV_BPF >0))
1223#if !defined(IPFILTER_BPF) && \
1224 ((defined(NBPF) && NBPF > 0) || \
1225 (defined(NBPFILTER) && NBPFILTER > 0) || \
1226 (defined(DEV_BPF) && DEV_BPF >0))
1226# define IPFILTER_BPF
1227#endif
1228
1229/*
1230 * Userland locking primitives
1231 */
1232typedef struct {
1233 char *eMm_owner;

--- 1067 unchanged lines hidden ---
1227# define IPFILTER_BPF
1228#endif
1229
1230/*
1231 * Userland locking primitives
1232 */
1233typedef struct {
1234 char *eMm_owner;

--- 1067 unchanged lines hidden ---