ip_compat.h (92685) | ip_compat.h (95418) |
---|---|
1/* 2 * Copyright (C) 1993-2001 by Darren Reed. 3 * 4 * See the IPFILTER.LICENCE file for details on licencing. 5 * 6 * @(#)ip_compat.h 1.8 1/14/96 7 * $Id: ip_compat.h,v 2.26.2.9 2001/01/14 14:58:01 darrenr Exp $ | 1/* 2 * Copyright (C) 1993-2001 by Darren Reed. 3 * 4 * See the IPFILTER.LICENCE file for details on licencing. 5 * 6 * @(#)ip_compat.h 1.8 1/14/96 7 * $Id: ip_compat.h,v 2.26.2.9 2001/01/14 14:58:01 darrenr Exp $ |
8 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_compat.h 92685 2002-03-19 11:44:16Z darrenr $ | 8 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_compat.h 95418 2002-04-25 03:31:39Z darrenr $ |
9 */ 10 11#ifndef __IP_COMPAT_H__ 12#define __IP_COMPAT_H__ 13 14#ifndef __P 15# ifdef __STDC__ 16# define __P(x) x --- 82 unchanged lines hidden (view full) --- 99#ifdef __sgi 100# include <sys/debug.h> 101#endif 102 103#ifdef linux 104# include <sys/sysmacros.h> 105#endif 106 | 9 */ 10 11#ifndef __IP_COMPAT_H__ 12#define __IP_COMPAT_H__ 13 14#ifndef __P 15# ifdef __STDC__ 16# define __P(x) x --- 82 unchanged lines hidden (view full) --- 99#ifdef __sgi 100# include <sys/debug.h> 101#endif 102 103#ifdef linux 104# include <sys/sysmacros.h> 105#endif 106 |
107 | |
108/* 109 * This is a workaround for <sys/uio.h> troubles on FreeBSD and OpenBSD. 110 */ 111#ifndef _KERNEL 112# define ADD_KERNEL 113# define _KERNEL 114# define KERNEL 115#endif --- 77 unchanged lines hidden (view full) --- 193} qif_t; 194#else /* SOLARIS */ 195# if !defined(__sgi) 196typedef int minor_t; 197# endif 198#endif /* SOLARIS */ 199#define IPMINLEN(i, h) ((i)->ip_len >= ((i)->ip_hl * 4 + sizeof(struct h))) 200 | 107/* 108 * This is a workaround for <sys/uio.h> troubles on FreeBSD and OpenBSD. 109 */ 110#ifndef _KERNEL 111# define ADD_KERNEL 112# define _KERNEL 113# define KERNEL 114#endif --- 77 unchanged lines hidden (view full) --- 192} qif_t; 193#else /* SOLARIS */ 194# if !defined(__sgi) 195typedef int minor_t; 196# endif 197#endif /* SOLARIS */ 198#define IPMINLEN(i, h) ((i)->ip_len >= ((i)->ip_hl * 4 + sizeof(struct h))) 199 |
201#if defined(__FreeBSD__) && (__FreeBSD__ >= 5) && defined(_KERNEL) 202# include <machine/in_cksum.h> 203#endif 204 | |
205#ifndef IP_OFFMASK 206#define IP_OFFMASK 0x1fff 207#endif 208 209#if BSD > 199306 210# define USE_QUAD_T 211# define U_QUAD_T u_quad_t 212# define QUAD_T quad_t 213#else /* BSD > 199306 */ 214# define U_QUAD_T u_long 215# define QUAD_T long 216#endif /* BSD > 199306 */ 217 218 | 200#ifndef IP_OFFMASK 201#define IP_OFFMASK 0x1fff 202#endif 203 204#if BSD > 199306 205# define USE_QUAD_T 206# define U_QUAD_T u_quad_t 207# define QUAD_T quad_t 208#else /* BSD > 199306 */ 209# define U_QUAD_T u_long 210# define QUAD_T long 211#endif /* BSD > 199306 */ 212 213 |
214#if defined(__FreeBSD__) && (defined(KERNEL) || defined(_KERNEL)) 215# include <sys/param.h> 216# ifndef __FreeBSD_version 217# include <sys/osreldate.h> 218# endif 219# ifdef IPFILTER_LKM 220# define ACTUALLY_LKM_NOT_KERNEL 221# endif 222# if defined(__FreeBSD_version) && (__FreeBSD_version < 300000) 223# include <machine/spl.h> 224# else 225# if (__FreeBSD_version >= 300000) && (__FreeBSD_version < 400000) 226# if defined(IPFILTER_LKM) && !defined(ACTUALLY_LKM_NOT_KERNEL) 227# define ACTUALLY_LKM_NOT_KERNEL 228# endif 229# endif 230# endif 231#endif /* __FreeBSD__ && KERNEL */ 232 233#if defined(__FreeBSD_version) && (__FreeBSD_version >= 500000) && \ 234 defined(_KERNEL) 235# include <machine/in_cksum.h> 236#endif 237 |
|
219/* 220 * These operating systems already take care of the problem for us. 221 */ 222#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \ 223 defined(__sgi) 224typedef u_int32_t u_32_t; 225# if defined(_KERNEL) && !defined(IPFILTER_LKM) 226# if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 104110000) 227# include "opt_inet.h" 228# endif 229# if defined(__FreeBSD_version) && (__FreeBSD_version >= 400000) && \ 230 !defined(KLD_MODULE) 231# include "opt_inet6.h" 232# endif 233# ifdef INET6 | 238/* 239 * These operating systems already take care of the problem for us. 240 */ 241#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \ 242 defined(__sgi) 243typedef u_int32_t u_32_t; 244# if defined(_KERNEL) && !defined(IPFILTER_LKM) 245# if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 104110000) 246# include "opt_inet.h" 247# endif 248# if defined(__FreeBSD_version) && (__FreeBSD_version >= 400000) && \ 249 !defined(KLD_MODULE) 250# include "opt_inet6.h" 251# endif 252# ifdef INET6 |
253# define USE_INET6 254# endif 255# endif 256# if !defined(_KERNEL) && !defined(IPFILTER_LKM) 257# if (defined(__FreeBSD_version) && (__FreeBSD_version >= 400000)) || \ 258 (defined(OpenBSD) && (OpenBSD >= 200111)) || \ 259 (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 105000000)) |
|
234# define USE_INET6 235# endif 236# endif 237#else 238/* 239 * Really, any arch where sizeof(long) != sizeof(int). 240 */ 241# if defined(__alpha__) || defined(__alpha) || defined(_LP64) --- 95 unchanged lines hidden (view full) --- 337#endif 338/*#define IPOPT_SSRR 137 */ 339#define IPOPT_ADDEXT 147 /* ADDEXT */ 340#define IPOPT_VISA 142 /* VISA */ 341#define IPOPT_IMITD 144 /* IMITD */ 342#define IPOPT_EIP 145 /* EIP */ 343#define IPOPT_FINN 205 /* FINN */ 344 | 260# define USE_INET6 261# endif 262# endif 263#else 264/* 265 * Really, any arch where sizeof(long) != sizeof(int). 266 */ 267# if defined(__alpha__) || defined(__alpha) || defined(_LP64) --- 95 unchanged lines hidden (view full) --- 363#endif 364/*#define IPOPT_SSRR 137 */ 365#define IPOPT_ADDEXT 147 /* ADDEXT */ 366#define IPOPT_VISA 142 /* VISA */ 367#define IPOPT_IMITD 144 /* IMITD */ 368#define IPOPT_EIP 145 /* EIP */ 369#define IPOPT_FINN 205 /* FINN */ 370 |
371#ifndef TCPOPT_WSCALE 372# define TCPOPT_WSCALE 3 373#endif |
|
345 | 374 |
346#if defined(__FreeBSD__) && (defined(KERNEL) || defined(_KERNEL)) 347# ifdef IPFILTER_LKM 348# ifndef __FreeBSD_cc_version 349# include <osreldate.h> 350# else 351# if __FreeBSD_cc_version < 430000 352# include <osreldate.h> 353# else 354# include <sys/param.h> 355# endif 356# endif 357# define ACTUALLY_LKM_NOT_KERNEL 358# else 359# ifndef __FreeBSD_cc_version 360# include <sys/osreldate.h> 361# else 362# if __FreeBSD_cc_version < 430000 363# include <sys/osreldate.h> 364# else 365# include <sys/param.h> 366# endif 367# endif 368# endif 369# if __FreeBSD__ < 3 370# include <machine/spl.h> 371# else 372# if __FreeBSD__ == 3 373# if defined(IPFILTER_LKM) && !defined(ACTUALLY_LKM_NOT_KERNEL) 374# define ACTUALLY_LKM_NOT_KERNEL 375# endif 376# endif 377# endif 378#endif /* __FreeBSD__ && KERNEL */ 379 | |
380/* 381 * Build some macros and #defines to enable the same code to compile anywhere 382 * Well, that's the idea, anyway :-) 383 */ 384#if SOLARIS 385typedef mblk_t mb_t; 386# if SOLARIS2 >= 7 387# ifdef lint --- 188 unchanged lines hidden (view full) --- 576# ifndef GET_MINOR 577# define GET_MINOR(x) minor(x) 578# endif 579# if (BSD >= 199306) || defined(__FreeBSD__) 580# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ 581 defined(__FreeBSD__) || defined(__OpenBSD__) || defined(_BSDI_VERSION) 582# include <vm/vm.h> 583# endif | 375/* 376 * Build some macros and #defines to enable the same code to compile anywhere 377 * Well, that's the idea, anyway :-) 378 */ 379#if SOLARIS 380typedef mblk_t mb_t; 381# if SOLARIS2 >= 7 382# ifdef lint --- 188 unchanged lines hidden (view full) --- 571# ifndef GET_MINOR 572# define GET_MINOR(x) minor(x) 573# endif 574# if (BSD >= 199306) || defined(__FreeBSD__) 575# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ 576 defined(__FreeBSD__) || defined(__OpenBSD__) || defined(_BSDI_VERSION) 577# include <vm/vm.h> 578# endif |
584# if !defined(__FreeBSD__) || (defined (__FreeBSD__) && __FreeBSD__>=3) | 579# if !defined(__FreeBSD__) || (defined (__FreeBSD_version) && \ 580 (__FreeBSD_version >= 300000)) |
585# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 105180000)) || \ 586 (defined(OpenBSD) && (OpenBSD >= 200111)) 587# include <uvm/uvm_extern.h> 588# else 589# include <vm/vm_extern.h> 590extern vm_map_t kmem_map; 591# endif 592# include <sys/proc.h> | 581# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 105180000)) || \ 582 (defined(OpenBSD) && (OpenBSD >= 200111)) 583# include <uvm/uvm_extern.h> 584# else 585# include <vm/vm_extern.h> 586extern vm_map_t kmem_map; 587# endif 588# include <sys/proc.h> |
593# else /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD__>=3) */ | 589# else /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD_version >= 300000) */ |
594# include <vm/vm_kern.h> | 590# include <vm/vm_kern.h> |
595# endif /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD__>=3) */ | 591# endif /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD_version >= 300000) */ |
596# ifdef M_PFIL 597# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), M_PFIL, M_NOWAIT) 598# define KMALLOCS(a, b, c) MALLOC((a), b, (c), M_PFIL, M_NOWAIT) 599# define KFREE(x) FREE((x), M_PFIL) 600# define KFREES(x,s) FREE((x), M_PFIL) 601# else 602# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), M_TEMP, M_NOWAIT) 603# define KMALLOCS(a, b, c) MALLOC((a), b, (c), M_TEMP, M_NOWAIT) --- 777 unchanged lines hidden --- | 592# ifdef M_PFIL 593# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), M_PFIL, M_NOWAIT) 594# define KMALLOCS(a, b, c) MALLOC((a), b, (c), M_PFIL, M_NOWAIT) 595# define KFREE(x) FREE((x), M_PFIL) 596# define KFREES(x,s) FREE((x), M_PFIL) 597# else 598# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), M_TEMP, M_NOWAIT) 599# define KMALLOCS(a, b, c) MALLOC((a), b, (c), M_TEMP, M_NOWAIT) --- 777 unchanged lines hidden --- |