ip_compat.h (80482) | ip_compat.h (92685) |
---|---|
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 80482 2001-07-28 11:58:26Z darrenr $ | 8 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_compat.h 92685 2002-03-19 11:44:16Z 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 --- 4 unchanged lines hidden (view full) --- 21#ifndef __STDC__ 22# undef const 23# define const 24#endif 25 26#ifndef SOLARIS 27#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) 28#endif | 9 */ 10 11#ifndef __IP_COMPAT_H__ 12#define __IP_COMPAT_H__ 13 14#ifndef __P 15# ifdef __STDC__ 16# define __P(x) x --- 4 unchanged lines hidden (view full) --- 21#ifndef __STDC__ 22# undef const 23# define const 24#endif 25 26#ifndef SOLARIS 27#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) 28#endif |
29#if SOLARIS && !defined(SOLARIS2) 30# define SOLARIS2 4 /* Pick an old version */ 31#endif 32#if SOLARIS2 >= 8 33# ifndef USE_INET6 34# define USE_INET6 | 29#if SOLARIS 30# if !defined(SOLARIS2) 31# define SOLARIS2 3 /* Pick an old version */ |
35# endif | 32# endif |
33# if SOLARIS2 >= 8 34# ifndef USE_INET6 35# define USE_INET6 36# endif 37# else 38# undef USE_INET6 39# endif |
|
36#endif | 40#endif |
41#if defined(sun) && !(defined(__svr4__) || defined(__SVR4)) 42# undef USE_INET6 43#endif |
|
37 38#if defined(_KERNEL) || defined(KERNEL) || defined(__KERNEL__) 39# undef KERNEL 40# undef _KERNEL 41# undef __KERNEL__ 42# define KERNEL 43# define _KERNEL 44# define __KERNEL__ --- 13 unchanged lines hidden (view full) --- 58#endif 59 60#if defined(__sgi) || defined(bsdi) 61struct ether_addr { 62 u_char ether_addr_octet[6]; 63}; 64#endif 65 | 44 45#if defined(_KERNEL) || defined(KERNEL) || defined(__KERNEL__) 46# undef KERNEL 47# undef _KERNEL 48# undef __KERNEL__ 49# define KERNEL 50# define _KERNEL 51# define __KERNEL__ --- 13 unchanged lines hidden (view full) --- 65#endif 66 67#if defined(__sgi) || defined(bsdi) 68struct ether_addr { 69 u_char ether_addr_octet[6]; 70}; 71#endif 72 |
73#ifndef LIFNAMSIZ 74# ifdef IF_NAMESIZE 75# define LIFNAMSIZ IF_NAMESIZE 76# else 77# ifdef IFNAMSIZ 78# define LIFNAMSIZ IFNAMSIZ 79# else 80# define LIFNAMSIZ 16 81# endif 82# endif 83#endif 84 |
|
66#if defined(__sgi) && !defined(IPFILTER_LKM) 67# ifdef __STDC__ 68# define IPL_EXTERN(ep) ipfilter##ep 69# else 70# define IPL_EXTERN(ep) ipfilter/**/ep 71# endif 72#else 73# ifdef __STDC__ 74# define IPL_EXTERN(ep) ipl##ep 75# else 76# define IPL_EXTERN(ep) ipl/**/ep 77# endif 78#endif 79 | 85#if defined(__sgi) && !defined(IPFILTER_LKM) 86# ifdef __STDC__ 87# define IPL_EXTERN(ep) ipfilter##ep 88# else 89# define IPL_EXTERN(ep) ipfilter/**/ep 90# endif 91#else 92# ifdef __STDC__ 93# define IPL_EXTERN(ep) ipl##ep 94# else 95# define IPL_EXTERN(ep) ipl/**/ep 96# endif 97#endif 98 |
99#ifdef __sgi 100# include <sys/debug.h> 101#endif 102 |
|
80#ifdef linux 81# include <sys/sysmacros.h> 82#endif | 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 116#ifdef __OpenBSD__ 117struct file; 118#endif 119#include <sys/uio.h> 120#ifdef ADD_KERNEL 121# undef _KERNEL 122# undef KERNEL 123#endif 124 |
|
83#if SOLARIS 84# define MTYPE(m) ((m)->b_datap->db_type) | 125#if SOLARIS 126# define MTYPE(m) ((m)->b_datap->db_type) |
85# include <sys/isa_defs.h> | 127# if SOLARIS2 >= 4 128# include <sys/isa_defs.h> 129# endif |
86# include <sys/ioccom.h> 87# include <sys/sysmacros.h> 88# include <sys/kmem.h> 89/* 90 * because Solaris 2 defines these in two places :-/ 91 */ 92# undef IPOPT_EOL 93# undef IPOPT_NOP --- 39 unchanged lines hidden (view full) --- 133 struct qinit *qf_wqinfo; 134 struct qinit *qf_rqinfo; 135 struct qinit qf_wqinit; 136 struct qinit qf_rqinit; 137 mblk_t *qf_m; /* These three fields are for passing data up from */ 138 queue_t *qf_q; /* fr_qin and fr_qout to the packet processing. */ 139 size_t qf_off; 140 size_t qf_len; /* this field is used for in ipfr_fastroute */ | 130# include <sys/ioccom.h> 131# include <sys/sysmacros.h> 132# include <sys/kmem.h> 133/* 134 * because Solaris 2 defines these in two places :-/ 135 */ 136# undef IPOPT_EOL 137# undef IPOPT_NOP --- 39 unchanged lines hidden (view full) --- 177 struct qinit *qf_wqinfo; 178 struct qinit *qf_rqinfo; 179 struct qinit qf_wqinit; 180 struct qinit qf_rqinit; 181 mblk_t *qf_m; /* These three fields are for passing data up from */ 182 queue_t *qf_q; /* fr_qin and fr_qout to the packet processing. */ 183 size_t qf_off; 184 size_t qf_len; /* this field is used for in ipfr_fastroute */ |
141 char qf_name[8]; | 185 char qf_name[LIFNAMSIZ]; |
142 /* 143 * in case the ILL has disappeared... 144 */ 145 size_t qf_hl; /* header length */ 146 int qf_sap; | 186 /* 187 * in case the ILL has disappeared... 188 */ 189 size_t qf_hl; /* header length */ 190 int qf_sap; |
191 size_t qf_incnt; 192 size_t qf_outcnt; |
|
147} qif_t; 148#else /* SOLARIS */ 149# if !defined(__sgi) 150typedef int minor_t; 151# endif 152#endif /* SOLARIS */ 153#define IPMINLEN(i, h) ((i)->ip_len >= ((i)->ip_hl * 4 + sizeof(struct h))) 154 --- 51 unchanged lines hidden (view full) --- 206#ifdef USE_INET6 207# if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) 208# include <netinet/ip6.h> 209# ifdef _KERNEL 210# include <netinet6/ip6_var.h> 211# endif 212typedef struct ip6_hdr ip6_t; 213# endif | 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 --- 51 unchanged lines hidden (view full) --- 252#ifdef USE_INET6 253# if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) 254# include <netinet/ip6.h> 255# ifdef _KERNEL 256# include <netinet6/ip6_var.h> 257# endif 258typedef struct ip6_hdr ip6_t; 259# endif |
260# include <netinet/icmp6.h> |
|
214union i6addr { 215 u_32_t i6[4]; 216 struct in_addr in4; 217 struct in6_addr in6; 218}; 219#else 220union i6addr { 221 u_32_t i6[4]; 222 struct in_addr in4; 223}; 224#endif 225 226#define IP6CMP(a,b) bcmp((char *)&(a), (char *)&(b), sizeof(a)) 227#define IP6EQ(a,b) (bcmp((char *)&(a), (char *)&(b), sizeof(a)) == 0) 228#define IP6NEQ(a,b) (bcmp((char *)&(a), (char *)&(b), sizeof(a)) != 0) | 261union i6addr { 262 u_32_t i6[4]; 263 struct in_addr in4; 264 struct in6_addr in6; 265}; 266#else 267union i6addr { 268 u_32_t i6[4]; 269 struct in_addr in4; 270}; 271#endif 272 273#define IP6CMP(a,b) bcmp((char *)&(a), (char *)&(b), sizeof(a)) 274#define IP6EQ(a,b) (bcmp((char *)&(a), (char *)&(b), sizeof(a)) == 0) 275#define IP6NEQ(a,b) (bcmp((char *)&(a), (char *)&(b), sizeof(a)) != 0) |
276#define IP6_ISZERO(a) ((((union i6addr *)(a))->i6[0] | \ 277 ((union i6addr *)(a))->i6[1] | \ 278 ((union i6addr *)(a))->i6[2] | \ 279 ((union i6addr *)(a))->i6[3]) == 0) 280#define IP6_NOTZERO(a) ((((union i6addr *)(a))->i6[0] | \ 281 ((union i6addr *)(a))->i6[1] | \ 282 ((union i6addr *)(a))->i6[2] | \ 283 ((union i6addr *)(a))->i6[3]) != 0) |
|
229 230#ifndef MAX 231#define MAX(a,b) (((a) > (b)) ? (a) : (b)) 232#endif 233 234/* 235 * Security Options for Intenet Protocol (IPSO) as defined in RFC 1108. 236 * --- 84 unchanged lines hidden (view full) --- 321# endif 322# endif 323#endif /* __FreeBSD__ && KERNEL */ 324 325/* 326 * Build some macros and #defines to enable the same code to compile anywhere 327 * Well, that's the idea, anyway :-) 328 */ | 284 285#ifndef MAX 286#define MAX(a,b) (((a) > (b)) ? (a) : (b)) 287#endif 288 289/* 290 * Security Options for Intenet Protocol (IPSO) as defined in RFC 1108. 291 * --- 84 unchanged lines hidden (view full) --- 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 388# define ALIGN32(ptr) (ptr ? 0L : 0L) 389# define ALIGN16(ptr) (ptr ? 0L : 0L) 390# else 391# define ALIGN32(ptr) (ptr) 392# define ALIGN16(ptr) (ptr) 393# endif 394# endif 395#else 396typedef struct mbuf mb_t; 397#endif /* SOLARIS */ 398 |
|
329#if !SOLARIS || (SOLARIS2 < 6) || !defined(KERNEL) 330# define ATOMIC_INCL ATOMIC_INC 331# define ATOMIC_INC64 ATOMIC_INC 332# define ATOMIC_INC32 ATOMIC_INC 333# define ATOMIC_INC16 ATOMIC_INC 334# define ATOMIC_DECL ATOMIC_DEC 335# define ATOMIC_DEC64 ATOMIC_DEC 336# define ATOMIC_DEC32 ATOMIC_DEC --- 165 unchanged lines hidden (view full) --- 502# define KMALLOCS(a,b,c) (a) = (b)new_kmem_alloc((c), KMEM_NOSLEEP) 503# endif /* SOLARIS */ 504# endif /* __sgi */ 505# endif /* sun && !linux */ 506# ifndef GET_MINOR 507# define GET_MINOR(x) minor(x) 508# endif 509# if (BSD >= 199306) || defined(__FreeBSD__) | 399#if !SOLARIS || (SOLARIS2 < 6) || !defined(KERNEL) 400# define ATOMIC_INCL ATOMIC_INC 401# define ATOMIC_INC64 ATOMIC_INC 402# define ATOMIC_INC32 ATOMIC_INC 403# define ATOMIC_INC16 ATOMIC_INC 404# define ATOMIC_DECL ATOMIC_DEC 405# define ATOMIC_DEC64 ATOMIC_DEC 406# define ATOMIC_DEC32 ATOMIC_DEC --- 165 unchanged lines hidden (view full) --- 572# define KMALLOCS(a,b,c) (a) = (b)new_kmem_alloc((c), KMEM_NOSLEEP) 573# endif /* SOLARIS */ 574# endif /* __sgi */ 575# endif /* sun && !linux */ 576# ifndef GET_MINOR 577# define GET_MINOR(x) minor(x) 578# endif 579# if (BSD >= 199306) || defined(__FreeBSD__) |
510# include <vm/vm.h> | 580# if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ 581 defined(__FreeBSD__) || defined(__OpenBSD__) || defined(_BSDI_VERSION) 582# include <vm/vm.h> 583# endif |
511# if !defined(__FreeBSD__) || (defined (__FreeBSD__) && __FreeBSD__>=3) | 584# if !defined(__FreeBSD__) || (defined (__FreeBSD__) && __FreeBSD__>=3) |
512# include <vm/vm_extern.h> 513# include <sys/proc.h> | 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> |
514extern vm_map_t kmem_map; | 590extern vm_map_t kmem_map; |
591# endif 592# include <sys/proc.h> |
|
515# else /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD__>=3) */ 516# include <vm/vm_kern.h> 517# endif /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD__>=3) */ 518# ifdef M_PFIL 519# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), M_PFIL, M_NOWAIT) 520# define KMALLOCS(a, b, c) MALLOC((a), b, (c), M_PFIL, M_NOWAIT) 521# define KFREE(x) FREE((x), M_PFIL) 522# define KFREES(x,s) FREE((x), M_PFIL) --- 15 unchanged lines hidden (view full) --- 538# if !SOLARIS && !defined(linux) 539# define SPL_IMP(x) x = splimp() 540# define SPL_NET(x) x = splnet() 541# define SPL_X(x) (void) splx(x) 542# endif 543# endif /* NetBSD && (NetBSD <= 1991011) && (NetBSD >= 199407) */ 544# define PANIC(x,y) if (x) panic y 545#else /* KERNEL */ | 593# else /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD__>=3) */ 594# include <vm/vm_kern.h> 595# endif /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD__>=3) */ 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) --- 15 unchanged lines hidden (view full) --- 616# if !SOLARIS && !defined(linux) 617# define SPL_IMP(x) x = splimp() 618# define SPL_NET(x) x = splnet() 619# define SPL_X(x) (void) splx(x) 620# endif 621# endif /* NetBSD && (NetBSD <= 1991011) && (NetBSD >= 199407) */ 622# define PANIC(x,y) if (x) panic y 623#else /* KERNEL */ |
546# define SLEEP(x,y) ; | 624# define SLEEP(x,y) 1 |
547# define WAKEUP(x) ; 548# define PANIC(x,y) ; 549# define ATOMIC_INC(x) (x)++ 550# define ATOMIC_DEC(x) (x)-- 551# define MUTEX_ENTER(x) ; 552# define READ_ENTER(x) ; 553# define MUTEX_INIT(x,y,z) ; 554# define MUTEX_DESTROY(x) ; --- 5 unchanged lines hidden (view full) --- 560# define SPL_NET(x) ; 561# define SPL_IMP(x) ; 562# undef SPL_X 563# define SPL_X(x) ; 564# define KMALLOC(a,b) (a) = (b)malloc(sizeof(*a)) 565# define KMALLOCS(a,b,c) (a) = (b)malloc(c) 566# define KFREE(x) free(x) 567# define KFREES(x,s) free(x) | 625# define WAKEUP(x) ; 626# define PANIC(x,y) ; 627# define ATOMIC_INC(x) (x)++ 628# define ATOMIC_DEC(x) (x)-- 629# define MUTEX_ENTER(x) ; 630# define READ_ENTER(x) ; 631# define MUTEX_INIT(x,y,z) ; 632# define MUTEX_DESTROY(x) ; --- 5 unchanged lines hidden (view full) --- 638# define SPL_NET(x) ; 639# define SPL_IMP(x) ; 640# undef SPL_X 641# define SPL_X(x) ; 642# define KMALLOC(a,b) (a) = (b)malloc(sizeof(*a)) 643# define KMALLOCS(a,b,c) (a) = (b)malloc(c) 644# define KFREE(x) free(x) 645# define KFREES(x,s) free(x) |
646# define FREE_MB_T(x) ; |
|
568# define GETUNIT(x, v) get_unit(x,v) 569# define IRCOPY(a,b,c) (bcopy((a), (b), (c)), 0) 570# define IWCOPY(a,b,c) (bcopy((a), (b), (c)), 0) 571# define IRCOPYPTR ircopyptr 572# define IWCOPYPTR iwcopyptr | 647# define GETUNIT(x, v) get_unit(x,v) 648# define IRCOPY(a,b,c) (bcopy((a), (b), (c)), 0) 649# define IWCOPY(a,b,c) (bcopy((a), (b), (c)), 0) 650# define IRCOPYPTR ircopyptr 651# define IWCOPYPTR iwcopyptr |
652# define IFNAME(x) get_ifname((struct ifnet *)x) 653# define UIOMOVE(a,b,c,d) ipfuiomove(a,b,c,d) 654extern void m_copydata __P((mb_t *, int, int, caddr_t)); 655extern int ipfuiomove __P((caddr_t, int, int, struct uio *)); |
|
573#endif /* KERNEL */ 574 | 656#endif /* KERNEL */ 657 |
575#if SOLARIS 576typedef mblk_t mb_t; 577# if SOLARIS2 >= 7 578# ifdef lint 579# define ALIGN32(ptr) (ptr ? 0L : 0L) 580# define ALIGN16(ptr) (ptr ? 0L : 0L) 581# else 582# define ALIGN32(ptr) (ptr) 583# define ALIGN16(ptr) (ptr) 584# endif 585# endif 586#else 587# ifdef linux 588# ifndef kernel 589typedef struct mb { 590 struct mb *next; 591 u_int len; 592 u_char *data; 593} mb_t; 594# else 595typedef struct sk_buff mb_t; 596# endif 597# else 598typedef struct mbuf mb_t; 599# endif 600#endif /* SOLARIS */ 601 | |
602/* 603 * These #ifdef's are here mainly for linux, but who knows, they may 604 * not be in other places or maybe one day linux will grow up and some 605 * of these will turn up there too. 606 */ 607#ifndef ICMP_MINLEN 608# define ICMP_MINLEN 8 609#endif | 658/* 659 * These #ifdef's are here mainly for linux, but who knows, they may 660 * not be in other places or maybe one day linux will grow up and some 661 * of these will turn up there too. 662 */ 663#ifndef ICMP_MINLEN 664# define ICMP_MINLEN 8 665#endif |
666#ifndef ICMP_ECHOREPLY 667# define ICMP_ECHOREPLY 0 668#endif |
|
610#ifndef ICMP_UNREACH | 669#ifndef ICMP_UNREACH |
611# define ICMP_UNREACH ICMP_DEST_UNREACH | 670# define ICMP_UNREACH 3 |
612#endif | 671#endif |
672#ifndef ICMP_UNREACH_NET 673# define ICMP_UNREACH_NET 0 674#endif 675#ifndef ICMP_UNREACH_HOST 676# define ICMP_UNREACH_HOST 1 677#endif 678#ifndef ICMP_UNREACH_PROTOCOL 679# define ICMP_UNREACH_PROTOCOL 2 680#endif 681#ifndef ICMP_UNREACH_PORT 682# define ICMP_UNREACH_PORT 3 683#endif 684#ifndef ICMP_UNREACH_NEEDFRAG 685# define ICMP_UNREACH_NEEDFRAG 4 686#endif 687#ifndef ICMP_UNREACH_SRCFAIL 688# define ICMP_UNREACH_SRCFAIL 5 689#endif 690#ifndef ICMP_UNREACH_NET_UNKNOWN 691# define ICMP_UNREACH_NET_UNKNOWN 6 692#endif 693#ifndef ICMP_UNREACH_HOST_UNKNOWN 694# define ICMP_UNREACH_HOST_UNKNOWN 7 695#endif 696#ifndef ICMP_UNREACH_ISOLATED 697# define ICMP_UNREACH_ISOLATED 8 698#endif 699#ifndef ICMP_UNREACH_NET_PROHIB 700# define ICMP_UNREACH_NET_PROHIB 9 701#endif 702#ifndef ICMP_UNREACH_HOST_PROHIB 703# define ICMP_UNREACH_HOST_PROHIB 10 704#endif 705#ifndef ICMP_UNREACH_TOSNET 706# define ICMP_UNREACH_TOSNET 11 707#endif 708#ifndef ICMP_UNREACH_TOSHOST 709# define ICMP_UNREACH_TOSHOST 12 710#endif 711#ifndef ICMP_UNREACH_ADMIN_PROHIBIT 712# define ICMP_UNREACH_ADMIN_PROHIBIT 13 713#endif 714#ifndef ICMP_UNREACH_HOST_PRECEDENCE 715# define ICMP_UNREACH_HOST_PRECEDENCE 14 716#endif 717#ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF 718# define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 719#endif |
|
613#ifndef ICMP_SOURCEQUENCH | 720#ifndef ICMP_SOURCEQUENCH |
614# define ICMP_SOURCEQUENCH ICMP_SOURCE_QUENCH | 721# define ICMP_SOURCEQUENCH 4 |
615#endif | 722#endif |
723#ifndef ICMP_REDIRECT_NET 724# define ICMP_REDIRECT_NET 0 725#endif 726#ifndef ICMP_REDIRECT_HOST 727# define ICMP_REDIRECT_HOST 1 728#endif 729#ifndef ICMP_REDIRECT_TOSNET 730# define ICMP_REDIRECT_TOSNET 2 731#endif 732#ifndef ICMP_REDIRECT_TOSHOST 733# define ICMP_REDIRECT_TOSHOST 3 734#endif 735#ifndef ICMP_ALTHOSTADDR 736# define ICMP_ALTHOSTADDR 6 737#endif |
|
616#ifndef ICMP_TIMXCEED | 738#ifndef ICMP_TIMXCEED |
617# define ICMP_TIMXCEED ICMP_TIME_EXCEEDED | 739# define ICMP_TIMXCEED 11 |
618#endif | 740#endif |
741#ifndef ICMP_TIMXCEED_INTRANS 742# define ICMP_TIMXCEED_INTRANS 0 743#endif 744#ifndef ICMP_TIMXCEED_REASS 745# define ICMP_TIMXCEED_REASS 1 746#endif |
|
619#ifndef ICMP_PARAMPROB | 747#ifndef ICMP_PARAMPROB |
620# define ICMP_PARAMPROB ICMP_PARAMETERPROB | 748# define ICMP_PARAMPROB 12 |
621#endif | 749#endif |
750#ifndef ICMP_PARAMPROB_ERRATPTR 751# define ICMP_PARAMPROB_ERRATPTR 0 752#endif 753#ifndef ICMP_PARAMPROB_OPTABSENT 754# define ICMP_PARAMPROB_OPTABSENT 1 755#endif 756#ifndef ICMP_PARAMPROB_LENGTH 757# define ICMP_PARAMPROB_LENGTH 2 758#endif |
|
622#ifndef ICMP_TSTAMP | 759#ifndef ICMP_TSTAMP |
623# define ICMP_TSTAMP ICMP_TIMESTAMP | 760# define ICMP_TSTAMP 13 |
624#endif 625#ifndef ICMP_TSTAMPREPLY | 761#endif 762#ifndef ICMP_TSTAMPREPLY |
626# define ICMP_TSTAMPREPLY ICMP_TIMESTAMPREPLY | 763# define ICMP_TSTAMPREPLY 14 |
627#endif 628#ifndef ICMP_IREQ | 764#endif 765#ifndef ICMP_IREQ |
629# define ICMP_IREQ ICMP_INFO_REQUEST | 766# define ICMP_IREQ 15 |
630#endif 631#ifndef ICMP_IREQREPLY | 767#endif 768#ifndef ICMP_IREQREPLY |
632# define ICMP_IREQREPLY ICMP_INFO_REPLY | 769# define ICMP_IREQREPLY 16 |
633#endif 634#ifndef ICMP_MASKREQ | 770#endif 771#ifndef ICMP_MASKREQ |
635# define ICMP_MASKREQ ICMP_ADDRESS | 772# define ICMP_MASKREQ 17 |
636#endif 637#ifndef ICMP_MASKREPLY | 773#endif 774#ifndef ICMP_MASKREPLY |
638# define ICMP_MASKREPLY ICMP_ADDRESSREPLY | 775# define ICMP_MASKREPLY 18 |
639#endif | 776#endif |
640#ifndef ICMP_PARAMPROB_OPTABSENT 641# define ICMP_PARAMPROB_OPTABSENT 1 | 777#ifndef ICMP_TRACEROUTE 778# define ICMP_TRACEROUTE 30 |
642#endif | 779#endif |
780#ifndef ICMP_DATACONVERR 781# define ICMP_DATACONVERR 31 782#endif 783#ifndef ICMP_MOBILE_REDIRECT 784# define ICMP_MOBILE_REDIRECT 32 785#endif 786#ifndef ICMP_IPV6_WHEREAREYOU 787# define ICMP_IPV6_WHEREAREYOU 33 788#endif 789#ifndef ICMP_IPV6_IAMHERE 790# define ICMP_IPV6_IAMHERE 34 791#endif 792#ifndef ICMP_MOBILE_REGREQUEST 793# define ICMP_MOBILE_REGREQUEST 35 794#endif 795#ifndef ICMP_MOBILE_REGREPLY 796# define ICMP_MOBILE_REGREPLY 36 797#endif 798#ifndef ICMP_SKIP 799# define ICMP_SKIP 39 800#endif 801#ifndef ICMP_PHOTURIS 802# define ICMP_PHOTURIS 40 803#endif 804#ifndef ICMP_PHOTURIS_UNKNOWN_INDEX 805# define ICMP_PHOTURIS_UNKNOWN_INDEX 1 806#endif 807#ifndef ICMP_PHOTURIS_AUTH_FAILED 808# define ICMP_PHOTURIS_AUTH_FAILED 2 809#endif 810#ifndef ICMP_PHOTURIS_DECRYPT_FAILED 811# define ICMP_PHOTURIS_DECRYPT_FAILED 3 812#endif |
|
643#ifndef IPVERSION 644# define IPVERSION 4 645#endif 646#ifndef IPOPT_MINOFF 647# define IPOPT_MINOFF 4 648#endif 649#ifndef IPOPT_COPIED 650# define IPOPT_COPIED(x) ((x)&0x80) --- 71 unchanged lines hidden (view full) --- 722# define IPOPT_SECUR_SECRET ((u_short)0xd788) 723#endif 724#ifndef IPOPT_SECUR_TOPSECRET 725# define IPOPT_SECUR_TOPSECRET ((u_short)0x6bc5) 726#endif 727#ifndef IPOPT_OLEN 728# define IPOPT_OLEN 1 729#endif | 813#ifndef IPVERSION 814# define IPVERSION 4 815#endif 816#ifndef IPOPT_MINOFF 817# define IPOPT_MINOFF 4 818#endif 819#ifndef IPOPT_COPIED 820# define IPOPT_COPIED(x) ((x)&0x80) --- 71 unchanged lines hidden (view full) --- 892# define IPOPT_SECUR_SECRET ((u_short)0xd788) 893#endif 894#ifndef IPOPT_SECUR_TOPSECRET 895# define IPOPT_SECUR_TOPSECRET ((u_short)0x6bc5) 896#endif 897#ifndef IPOPT_OLEN 898# define IPOPT_OLEN 1 899#endif |
900#ifndef IPPROTO_GRE 901# define IPPROTO_GRE 47 /* GRE encaps RFC 1701 */ 902#endif 903#ifndef IPPROTO_ESP 904# define IPPROTO_ESP 50 905#endif 906#ifndef IPPROTO_ICMPV6 907# define IPPROTO_ICMPV6 58 908#endif |
|
730 731#ifdef linux 732#include <linux/in_systm.h> 733/* 734 * TCP States 735 */ 736#define TCPS_CLOSED 0 /* closed */ 737#define TCPS_LISTEN 1 /* listening for connection */ --- 255 unchanged lines hidden (view full) --- 993 * XXX - This is one of those *awful* hacks which nobody likes 994 */ 995#ifdef ultrix 996#define A_A 997#else 998#define A_A & 999#endif 1000 | 909 910#ifdef linux 911#include <linux/in_systm.h> 912/* 913 * TCP States 914 */ 915#define TCPS_CLOSED 0 /* closed */ 916#define TCPS_LISTEN 1 /* listening for connection */ --- 255 unchanged lines hidden (view full) --- 1172 * XXX - This is one of those *awful* hacks which nobody likes 1173 */ 1174#ifdef ultrix 1175#define A_A 1176#else 1177#define A_A & 1178#endif 1179 |
1180#if (BSD >= 199306) && !defined(m_act) 1181# define m_act m_nextpkt 1182#endif 1183 |
|
1001#ifndef ICMP_ROUTERADVERT 1002# define ICMP_ROUTERADVERT 9 1003#endif 1004#ifndef ICMP_ROUTERSOLICIT 1005# define ICMP_ROUTERSOLICIT 10 1006#endif 1007#undef ICMP_MAX_UNREACH 1008#define ICMP_MAX_UNREACH 14 1009#undef ICMP_MAXTYPE 1010#define ICMP_MAXTYPE 18 1011/* 1012 * ICMP error replies have an IP header (20 bytes), 8 bytes of ICMP data, 1013 * another IP header and then 64 bits of data, totalling 56. Of course, 1014 * the last 64 bits is dependant on that being available. 1015 */ 1016#define ICMPERR_ICMPHLEN 8 1017#define ICMPERR_IPICMPHLEN (20 + 8) 1018#define ICMPERR_MINPKTLEN (20 + 8 + 20) 1019#define ICMPERR_MAXPKTLEN (20 + 8 + 20 + 8) | 1184#ifndef ICMP_ROUTERADVERT 1185# define ICMP_ROUTERADVERT 9 1186#endif 1187#ifndef ICMP_ROUTERSOLICIT 1188# define ICMP_ROUTERSOLICIT 10 1189#endif 1190#undef ICMP_MAX_UNREACH 1191#define ICMP_MAX_UNREACH 14 1192#undef ICMP_MAXTYPE 1193#define ICMP_MAXTYPE 18 1194/* 1195 * ICMP error replies have an IP header (20 bytes), 8 bytes of ICMP data, 1196 * another IP header and then 64 bits of data, totalling 56. Of course, 1197 * the last 64 bits is dependant on that being available. 1198 */ 1199#define ICMPERR_ICMPHLEN 8 1200#define ICMPERR_IPICMPHLEN (20 + 8) 1201#define ICMPERR_MINPKTLEN (20 + 8 + 20) 1202#define ICMPERR_MAXPKTLEN (20 + 8 + 20 + 8) |
1203#define ICMP6_MINLEN 8 |
|
1020#define ICMP6ERR_MINPKTLEN (40 + 8) 1021#define ICMP6ERR_IPICMPHLEN (40 + 8 + 40) 1022 | 1204#define ICMP6ERR_MINPKTLEN (40 + 8) 1205#define ICMP6ERR_IPICMPHLEN (40 + 8 + 40) 1206 |
1207#ifndef ICMP6_DST_UNREACH 1208# define ICMP6_DST_UNREACH 1 1209#endif 1210#ifndef ICMP6_PACKET_TOO_BIG 1211# define ICMP6_PACKET_TOO_BIG 2 1212#endif 1213#ifndef ICMP6_TIME_EXCEEDED 1214# define ICMP6_TIME_EXCEEDED 3 1215#endif 1216#ifndef ICMP6_PARAM_PROB 1217# define ICMP6_PARAM_PROB 4 1218#endif 1219 1220#ifndef ICMP6_ECHO_REQUEST 1221# define ICMP6_ECHO_REQUEST 128 1222#endif 1223#ifndef ICMP6_ECHO_REPLY 1224# define ICMP6_ECHO_REPLY 129 1225#endif 1226#ifndef ICMP6_MEMBERSHIP_QUERY 1227# define ICMP6_MEMBERSHIP_QUERY 130 1228#endif 1229#ifndef MLD6_LISTENER_QUERY 1230# define MLD6_LISTENER_QUERY 130 1231#endif 1232#ifndef ICMP6_MEMBERSHIP_REPORT 1233# define ICMP6_MEMBERSHIP_REPORT 131 1234#endif 1235#ifndef MLD6_LISTENER_REPORT 1236# define MLD6_LISTENER_REPORT 131 1237#endif 1238#ifndef ICMP6_MEMBERSHIP_REDUCTION 1239# define ICMP6_MEMBERSHIP_REDUCTION 132 1240#endif 1241#ifndef MLD6_LISTENER_DONE 1242# define MLD6_LISTENER_DONE 132 1243#endif 1244#ifndef ND_ROUTER_SOLICIT 1245# define ND_ROUTER_SOLICIT 133 1246#endif 1247#ifndef ND_ROUTER_ADVERT 1248# define ND_ROUTER_ADVERT 134 1249#endif 1250#ifndef ND_NEIGHBOR_SOLICIT 1251# define ND_NEIGHBOR_SOLICIT 135 1252#endif 1253#ifndef ND_NEIGHBOR_ADVERT 1254# define ND_NEIGHBOR_ADVERT 136 1255#endif 1256#ifndef ND_REDIRECT 1257# define ND_REDIRECT 137 1258#endif 1259#ifndef ICMP6_ROUTER_RENUMBERING 1260# define ICMP6_ROUTER_RENUMBERING 138 1261#endif 1262#ifndef ICMP6_WRUREQUEST 1263# define ICMP6_WRUREQUEST 139 1264#endif 1265#ifndef ICMP6_WRUREPLY 1266# define ICMP6_WRUREPLY 140 1267#endif 1268#ifndef ICMP6_FQDN_QUERY 1269# define ICMP6_FQDN_QUERY 139 1270#endif 1271#ifndef ICMP6_FQDN_REPLY 1272# define ICMP6_FQDN_REPLY 140 1273#endif 1274#ifndef ICMP6_NI_QUERY 1275# define ICMP6_NI_QUERY 139 1276#endif 1277#ifndef ICMP6_NI_REPLY 1278# define ICMP6_NI_REPLY 140 1279#endif 1280#ifndef MLD6_MTRACE_RESP 1281# define MLD6_MTRACE_RESP 200 1282#endif 1283#ifndef MLD6_MTRACE 1284# define MLD6_MTRACE 201 1285#endif 1286#ifndef ICMP6_HADISCOV_REQUEST 1287# define ICMP6_HADISCOV_REQUEST 202 1288#endif 1289#ifndef ICMP6_HADISCOV_REPLY 1290# define ICMP6_HADISCOV_REPLY 203 1291#endif 1292#ifndef ICMP6_MOBILEPREFIX_SOLICIT 1293# define ICMP6_MOBILEPREFIX_SOLICIT 204 1294#endif 1295#ifndef ICMP6_MOBILEPREFIX_ADVERT 1296# define ICMP6_MOBILEPREFIX_ADVERT 205 1297#endif 1298#ifndef ICMP6_MAXTYPE 1299# define ICMP6_MAXTYPE 205 1300#endif 1301 1302#ifndef ICMP6_DST_UNREACH_NOROUTE 1303# define ICMP6_DST_UNREACH_NOROUTE 0 1304#endif 1305#ifndef ICMP6_DST_UNREACH_ADMIN 1306# define ICMP6_DST_UNREACH_ADMIN 1 1307#endif 1308#ifndef ICMP6_DST_UNREACH_NOTNEIGHBOR 1309# define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 1310#endif 1311#ifndef ICMP6_DST_UNREACH_BEYONDSCOPE 1312# define ICMP6_DST_UNREACH_BEYONDSCOPE 2 1313#endif 1314#ifndef ICMP6_DST_UNREACH_ADDR 1315# define ICMP6_DST_UNREACH_ADDR 3 1316#endif 1317#ifndef ICMP6_DST_UNREACH_NOPORT 1318# define ICMP6_DST_UNREACH_NOPORT 4 1319#endif 1320#ifndef ICMP6_TIME_EXCEED_TRANSIT 1321# define ICMP6_TIME_EXCEED_TRANSIT 0 1322#endif 1323#ifndef ICMP6_TIME_EXCEED_REASSEMBLY 1324# define ICMP6_TIME_EXCEED_REASSEMBLY 1 1325#endif 1326 1327#ifndef ICMP6_NI_SUCCESS 1328# define ICMP6_NI_SUCCESS 0 1329#endif 1330#ifndef ICMP6_NI_REFUSED 1331# define ICMP6_NI_REFUSED 1 1332#endif 1333#ifndef ICMP6_NI_UNKNOWN 1334# define ICMP6_NI_UNKNOWN 2 1335#endif 1336 1337#ifndef ICMP6_ROUTER_RENUMBERING_COMMAND 1338# define ICMP6_ROUTER_RENUMBERING_COMMAND 0 1339#endif 1340#ifndef ICMP6_ROUTER_RENUMBERING_RESULT 1341# define ICMP6_ROUTER_RENUMBERING_RESULT 1 1342#endif 1343#ifndef ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 1344# define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 1345#endif 1346 1347#ifndef ICMP6_PARAMPROB_HEADER 1348# define ICMP6_PARAMPROB_HEADER 0 1349#endif 1350#ifndef ICMP6_PARAMPROB_NEXTHEADER 1351# define ICMP6_PARAMPROB_NEXTHEADER 1 1352#endif 1353#ifndef ICMP6_PARAMPROB_OPTION 1354# define ICMP6_PARAMPROB_OPTION 2 1355#endif 1356 1357#ifndef ICMP6_NI_SUBJ_IPV6 1358# define ICMP6_NI_SUBJ_IPV6 0 1359#endif 1360#ifndef ICMP6_NI_SUBJ_FQDN 1361# define ICMP6_NI_SUBJ_FQDN 1 1362#endif 1363#ifndef ICMP6_NI_SUBJ_IPV4 1364# define ICMP6_NI_SUBJ_IPV4 2 1365#endif 1366 |
|
1023/* 1024 * ECN is a new addition to TCP - RFC 2481 1025 */ 1026#ifndef TH_ECN 1027# define TH_ECN 0x40 1028#endif 1029#ifndef TH_CWR 1030# define TH_CWR 0x80 1031#endif 1032#define TH_ECNALL (TH_ECN|TH_CWR) 1033 1034#define TCPF_ALL (TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG|TH_ECN|TH_CWR) 1035 1036#endif /* __IP_COMPAT_H__ */ | 1367/* 1368 * ECN is a new addition to TCP - RFC 2481 1369 */ 1370#ifndef TH_ECN 1371# define TH_ECN 0x40 1372#endif 1373#ifndef TH_CWR 1374# define TH_CWR 0x80 1375#endif 1376#define TH_ECNALL (TH_ECN|TH_CWR) 1377 1378#define TCPF_ALL (TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG|TH_ECN|TH_CWR) 1379 1380#endif /* __IP_COMPAT_H__ */ |