Index: head/contrib/ipfilter/arc4random.c =================================================================== --- head/contrib/ipfilter/arc4random.c +++ head/contrib/ipfilter/arc4random.c @@ -7,7 +7,7 @@ * * Dan Moschuk */ -#if !defined(SOLARIS2) && !defined(__osf__) +#if !defined(SOLARIS2) # include #endif @@ -16,26 +16,16 @@ #ifdef __FreeBSD__ # include #endif -#if !defined(__osf__) # include -#endif #ifdef __FreeBSD__ # include #endif #include -#ifndef __osf__ # include -#endif #include -#if defined(SOLARIS2) && (SOLARIS2 < 9) -# include -#endif #include #include -#ifdef __osf__ -# include -#endif #include #include #include "netinet/ip_compat.h" Index: head/contrib/ipfilter/ip_dstlist.c =================================================================== --- head/contrib/ipfilter/ip_dstlist.c +++ head/contrib/ipfilter/ip_dstlist.c @@ -9,9 +9,6 @@ # define KERNEL 1 # define _KERNEL 1 #endif -#if defined(__osf__) -# define _PROTO_NET_H_ -#endif #include #include #include @@ -21,9 +18,6 @@ # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #else @@ -33,14 +27,12 @@ # endif #endif #include -#if !defined(linux) # include -#endif #include -#if defined(_KERNEL) && (!defined(__SVR4) && !defined(__svr4__)) +#if defined(_KERNEL) && !defined(__SVR4) # include #endif -#if defined(__SVR4) || defined(__svr4__) +#if defined(__SVR4) # include # include # ifdef _KERNEL @@ -49,7 +41,7 @@ # include # include #endif -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000) +#if defined(__FreeBSD_version) # include #endif Index: head/contrib/ipfilter/ip_fil.c =================================================================== --- head/contrib/ipfilter/ip_fil.c +++ head/contrib/ipfilter/ip_fil.c @@ -25,24 +25,10 @@ static void ipf_setifpaddr __P((struct ifnet *, char *)); void init_ifp __P((void)); -#if defined(__sgi) && (IRIX < 60500) static int no_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *)); -static int write_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *)); -#else -# if TRU64 >= 1885 -static int no_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *, char *)); -static int write_output __P((struct ifnet *, struct mbuf *, - struct sockaddr *, struct rtentry *, char *)); -# else -static int no_output __P((struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *)); static int write_output __P((struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *)); -# endif -#endif struct ifaddr { struct sockaddr_storage ifa_addr; @@ -123,17 +109,8 @@ static int -#if defined(__sgi) && (IRIX < 60500) -no_output(ifp, m, s) -#else -# if TRU64 >= 1885 -no_output (ifp, m, s, rt, cp) - char *cp; -# else no_output(ifp, m, s, rt) -# endif struct rtentry *rt; -#endif struct ifnet *ifp; struct mbuf *m; struct sockaddr *s; @@ -143,17 +120,8 @@ static int -#if defined(__sgi) && (IRIX < 60500) -write_output(ifp, m, s) -#else -# if TRU64 >= 1885 -write_output (ifp, m, s, rt, cp) - char *cp; -# else write_output(ifp, m, s, rt) -# endif struct rtentry *rt; -#endif struct ifnet *ifp; struct mbuf *m; struct sockaddr *s; @@ -167,8 +135,7 @@ ip = MTOD(mb, ip_t *); #if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199606)) || \ - (defined(OpenBSD) && (OpenBSD >= 199603)) || defined(linux) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) + defined(__FreeBSD__) sprintf(fname, "/tmp/%s", ifp->if_xname); #else sprintf(fname, "/tmp/%s%d", ifp->if_name, ifp->if_unit); @@ -189,42 +156,26 @@ struct ifnet *ifp; char *addr; { -#ifdef __sgi - struct in_ifaddr *ifa; -#else struct ifaddr *ifa; -#endif -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) +#if defined(__NetBSD__) || defined(__FreeBSD__) if (ifp->if_addrlist.tqh_first != NULL) #else -# ifdef __sgi - if (ifp->in_ifaddr != NULL) -# else if (ifp->if_addrlist != NULL) -# endif #endif return; ifa = (struct ifaddr *)malloc(sizeof(*ifa)); -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) +#if defined(__NetBSD__) || defined(__FreeBSD__) ifp->if_addrlist.tqh_first = ifa; #else -# ifdef __sgi - ifp->in_ifaddr = ifa; -# else ifp->if_addrlist = ifa; -# endif #endif if (ifa != NULL) { struct sockaddr_in *sin; -#ifdef __sgi - sin = (struct sockaddr_in *)&ifa->ia_addr; -#else sin = (struct sockaddr_in *)&ifa->ifa_addr; -#endif #ifdef USE_INET6 if (index(addr, ':') != NULL) { struct sockaddr_in6 *sin6; @@ -263,8 +214,7 @@ struct ifnet *ifp, **ifpp, **old_ifneta; char *addr; #if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199606)) || \ - (defined(OpenBSD) && (OpenBSD >= 199603)) || defined(linux) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) + defined(__FreeBSD__) if (!*name) return NULL; @@ -333,12 +283,11 @@ } ifp = ifneta[nifs - 1]; -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) +#if defined(__NetBSD__) || defined(__FreeBSD__) TAILQ_INIT(&ifp->if_addrlist); #endif #if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199606)) || \ - (defined(OpenBSD) && (OpenBSD >= 199603)) || defined(linux) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) + defined(__FreeBSD__) (void) strncpy(ifp->if_xname, name, sizeof(ifp->if_xname)); #else s = name + strlen(name) - 1; @@ -375,8 +324,7 @@ { static char ifname[LIFNAMSIZ]; -#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(linux) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) +#if defined(__NetBSD__) || defined(__FreeBSD__) sprintf(ifname, "%s", ifp->if_xname); #else if (ifp->if_unit != -1) @@ -397,8 +345,7 @@ int fd; #if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199606)) || \ - (defined(OpenBSD) && (OpenBSD >= 199603)) || defined(linux) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) + defined(__FreeBSD__) for (ifpp = ifneta; ifpp && (ifp = *ifpp); ifpp++) { ifp->if_output = (void *)write_output; sprintf(fname, "/tmp/%s", ifp->if_xname); @@ -717,20 +664,12 @@ i6addr_t *inp, *inpmask; { struct ifnet *ifp = ifptr; -#ifdef __sgi - struct in_ifaddr *ifa; -#else struct ifaddr *ifa; -#endif -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) +#if defined(__NetBSD__) || defined(__FreeBSD__) ifa = ifp->if_addrlist.tqh_first; #else -# ifdef __sgi - ifa = (struct in_ifaddr *)ifp->in_ifaddr; -# else ifa = ifp->if_addrlist; -# endif #endif if (ifa != NULL) { if (v == 4) { @@ -738,11 +677,7 @@ mask.sin_addr.s_addr = 0xffffffff; -#ifdef __sgi - sin = (struct sockaddr_in *)&ifa->ia_addr; -#else sin = (struct sockaddr_in *)&ifa->ifa_addr; -#endif return ipf_ifpfillv4addr(atype, sin, &mask, &inp->in4, &inpmask->in4); Index: head/contrib/ipfilter/ip_fil_compat.c =================================================================== --- head/contrib/ipfilter/ip_fil_compat.c +++ head/contrib/ipfilter/ip_fil_compat.c @@ -9,15 +9,12 @@ # define KERNEL 1 # define _KERNEL 1 #endif -#if defined(__osf__) -# define _PROTO_NET_H_ -#endif #include #include #include #include #include -#if __FreeBSD_version >= 220000 && defined(_KERNEL) +#if defined(__FreeBSD_version) && defined(_KERNEL) # include # include #else @@ -26,17 +23,10 @@ #if !defined(_KERNEL) # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #endif #include -#if (defined(__osf__) || defined(AIX) || defined(__hpux) || defined(__sgi)) && defined(_KERNEL) -# include "radix_ipf_local.h" -# define _RADIX_H_ -#endif #include #if defined(__FreeBSD__) # include @@ -44,7 +34,7 @@ #endif #if defined(_KERNEL) # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif #endif @@ -348,9 +338,6 @@ void *fin_qpi; char fin_ifname[LIFNAMSIZ]; #endif -#ifdef __sgi - void *fin_hbuf; -#endif } fr_info_4_1_32_t; typedef struct fr_info_4_1_24 { @@ -389,9 +376,6 @@ void *fin_qpi; char fin_ifname[LIFNAMSIZ]; #endif -#ifdef __sgi - void *fin_hbuf; -#endif } fr_info_4_1_24_t; typedef struct fr_info_4_1_23 { @@ -429,9 +413,6 @@ void *fin_qpi; char fin_ifname[LIFNAMSIZ]; #endif -#ifdef __sgi - void *fin_hbuf; -#endif } fr_info_4_1_23_t; typedef struct fr_info_4_1_11 { @@ -468,9 +449,6 @@ void *fin_qpi; char fin_ifname[LIFNAMSIZ]; #endif -#ifdef __sgi - void *fin_hbuf; -#endif } fr_info_4_1_11_t; /* ------------------------------------------------------------------------ */ @@ -2678,9 +2656,6 @@ fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif -#ifdef __sgi - fin->fin_hbuf = old->fin_hbuf; -#endif } @@ -2719,9 +2694,6 @@ fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif -#ifdef __sgi - fin->fin_hbuf = old->fin_hbuf; -#endif } @@ -2759,9 +2731,6 @@ fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif -#ifdef __sgi - fin->fin_hbuf = fin->fin_hbuf; -#endif } @@ -2799,9 +2768,6 @@ fin->fin_qfm = old->fin_qfm; fin->fin_qpi = old->fin_qpi; #endif -#ifdef __sgi - fin->fin_hbuf = fin->fin_hbuf; -#endif } @@ -4078,9 +4044,6 @@ old->fin_qpi = fin->fin_qpi; old->fin_ifname[0] = '\0'; #endif -#ifdef __sgi - old->fin_hbuf = fin->fin_hbuf; -#endif } @@ -4121,9 +4084,6 @@ old->fin_qpi = fin->fin_qpi; old->fin_ifname[0] = '\0'; #endif -#ifdef __sgi - old->fin_hbuf = fin->fin_hbuf; -#endif } @@ -4163,9 +4123,6 @@ old->fin_qfm = fin->fin_qfm; old->fin_qpi = fin->fin_qpi; old->fin_ifname[0] = '\0'; -#endif -#ifdef __sgi - old->fin_hbuf = fin->fin_hbuf; #endif } Index: head/contrib/ipfilter/ipf.h =================================================================== --- head/contrib/ipfilter/ipf.h +++ head/contrib/ipfilter/ipf.h @@ -12,11 +12,6 @@ #ifndef __IPF_H__ #define __IPF_H__ -#if defined(__osf__) -# define radix_mask ipf_radix_mask -# define radix_node ipf_radix_node -# define radix_node_head ipf_radix_node_head -#endif #include #include @@ -31,9 +26,6 @@ # define _KERNEL # define KERNEL #endif -#ifdef __OpenBSD__ -struct file; -#endif #include #ifdef ADD_KERNEL # undef _KERNEL @@ -188,9 +180,8 @@ } proxyrule_t; -#if defined(__NetBSD__) || defined(__OpenBSD__) || \ - (_BSDI_VERSION >= 199701) || (__FreeBSD_version >= 300000) || \ - SOLARIS || defined(__sgi) || defined(__osf__) || defined(linux) +#if defined(__NetBSD__) || defined(__FreeBSD_version) || \ + SOLARIS # include typedef int (* ioctlfunc_t) __P((int, ioctlcmd_t, ...)); #else @@ -199,13 +190,6 @@ typedef int (* addfunc_t) __P((int, ioctlfunc_t, void *)); typedef int (* copyfunc_t) __P((void *, void *, size_t)); - -/* - * SunOS4 - */ -#if defined(sun) && !defined(__SVR4) && !defined(__svr4__) -extern int ioctl __P((int, int, void *)); -#endif extern char thishost[]; extern char flagset[]; Index: head/contrib/ipfilter/ipsend/.OLD/ip_compat.h =================================================================== --- head/contrib/ipfilter/ipsend/.OLD/ip_compat.h +++ head/contrib/ipfilter/ipsend/.OLD/ip_compat.h @@ -112,130 +112,12 @@ # define IPOPT_SECUR_TOPSECRET ((u_short)0x6bc5) #endif -#ifdef linux -# if LINUX < 0200 -# define icmp icmphdr -# define icmp_type type -# define icmp_code code -# endif -/* - * From /usr/include/netinet/ip_var.h - * !%@#!$@# linux... - */ -struct ipovly { - caddr_t ih_next, ih_prev; /* for protocol sequence q's */ - u_char ih_x1; /* (unused) */ - u_char ih_pr; /* protocol */ - short ih_len; /* protocol length */ - struct in_addr ih_src; /* source internet address */ - struct in_addr ih_dst; /* destination internet address */ -}; - -typedef struct { - __u16 th_sport; - __u16 th_dport; - __u32 th_seq; - __u32 th_ack; -# if defined(__i386__) || defined(__MIPSEL__) || defined(__alpha__) ||\ - defined(vax) - __u8 th_res:4; - __u8 th_off:4; -#else - __u8 th_off:4; - __u8 th_res:4; -#endif - __u8 th_flags; - __u16 th_win; - __u16 th_sum; - __u16 th_urp; -} tcphdr_t; - -typedef struct { - __u16 uh_sport; - __u16 uh_dport; - __s16 uh_ulen; - __u16 uh_sum; -} udphdr_t; - -typedef struct { -# if defined(__i386__) || defined(__MIPSEL__) || defined(__alpha__) ||\ - defined(vax) - __u8 ip_hl:4; - __u8 ip_v:4; -# else - __u8 ip_hl:4; - __u8 ip_v:4; -# endif - __u8 ip_tos; - __u16 ip_len; - __u16 ip_id; - __u16 ip_off; - __u8 ip_ttl; - __u8 ip_p; - __u16 ip_sum; - struct in_addr ip_src; - struct in_addr ip_dst; -} ip_t; - -typedef struct { - __u8 ether_dhost[6]; - __u8 ether_shost[6]; - __u16 ether_type; -} ether_header_t; - -typedef struct icmp { - u_char icmp_type; /* type of message, see below */ - u_char icmp_code; /* type sub code */ - u_short icmp_cksum; /* ones complement cksum of struct */ - union { - u_char ih_pptr; /* ICMP_PARAMPROB */ - struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ - struct ih_idseq { - n_short icd_id; - n_short icd_seq; - } ih_idseq; - int ih_void; - } icmp_hun; -#define icmp_pptr icmp_hun.ih_pptr -#define icmp_gwaddr icmp_hun.ih_gwaddr -#define icmp_id icmp_hun.ih_idseq.icd_id -#define icmp_seq icmp_hun.ih_idseq.icd_seq -#define icmp_void icmp_hun.ih_void - union { - struct id_ts { - n_time its_otime; - n_time its_rtime; - n_time its_ttime; - } id_ts; - struct id_ip { - ip_t idi_ip; - /* options and then 64 bits of data */ - } id_ip; - u_long id_mask; - char id_data[1]; - } icmp_dun; -#define icmp_otime icmp_dun.id_ts.its_otime -#define icmp_rtime icmp_dun.id_ts.its_rtime -#define icmp_ttime icmp_dun.id_ts.its_ttime -#define icmp_ip icmp_dun.id_ip.idi_ip -#define icmp_mask icmp_dun.id_mask -#define icmp_data icmp_dun.id_data -} icmphdr_t; - -# define bcopy(a,b,c) memmove(b,a,c) -# define bcmp(a,b,c) memcmp(a,b,c) - -# define ifnet device - -#else - typedef struct udphdr udphdr_t; typedef struct tcphdr tcphdr_t; typedef struct ip ip_t; typedef struct ether_header ether_header_t; -#endif #if defined(__SVR4) || defined(__svr4__) # define bcopy(a,b,c) memmove(b,a,c) Index: head/contrib/ipfilter/ipsend/44arp.c =================================================================== --- head/contrib/ipfilter/ipsend/44arp.c +++ head/contrib/ipfilter/ipsend/44arp.c @@ -10,9 +10,7 @@ #include #include #include -#ifndef __osf__ # include -#endif #include #include #include Index: head/contrib/ipfilter/ipsend/arp.c =================================================================== --- head/contrib/ipfilter/ipsend/arp.c +++ head/contrib/ipfilter/ipsend/arp.c @@ -88,7 +88,6 @@ sin = (struct sockaddr_in *)&ar.arp_pa; sin->sin_family = AF_INET; bcopy(ip, (char *)&sin->sin_addr.s_addr, 4); -#ifndef hpux if ((hp = gethostbyaddr(ip, 4, AF_INET))) # if SOLARIS && (SOLARIS2 >= 10) if (!(ether_hostton(hp->h_name, (struct ether_addr *)ether))) @@ -96,7 +95,6 @@ if (!(ether_hostton(hp->h_name, ether))) # endif goto savearp; -#endif if (sfd == -1) if ((sfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) Index: head/contrib/ipfilter/ipsend/dlcommon.c =================================================================== --- head/contrib/ipfilter/ipsend/dlcommon.c +++ head/contrib/ipfilter/ipsend/dlcommon.c @@ -20,11 +20,7 @@ #include #include #include -#ifdef __osf__ -# include -#else # include -#endif #include #include #include Index: head/contrib/ipfilter/ipsend/ip.c =================================================================== --- head/contrib/ipfilter/ipsend/ip.c +++ head/contrib/ipfilter/ipsend/ip.c @@ -17,11 +17,9 @@ #include #include #include -#ifndef linux # include # include # include -#endif #include #include #include Index: head/contrib/ipfilter/ipsend/ipresend.c =================================================================== --- head/contrib/ipfilter/ipsend/ipresend.c +++ head/contrib/ipfilter/ipsend/ipresend.c @@ -18,9 +18,7 @@ #include #include #include -#ifndef linux #include -#endif #include #include #include @@ -37,9 +35,6 @@ int opts = 0; #ifndef DEFAULT_DEVICE -# ifdef linux -char default_device[] = "eth0"; -# else # ifdef sun char default_device[] = "le0"; # else @@ -49,15 +44,10 @@ # ifdef __bsdi__ char default_device[] = "ef0"; # else -# ifdef __sgi -char default_device[] = "ec0"; -# else char default_device[] = "lan0"; -# endif # endif # endif # endif -# endif #else char default_device[] = DEFAULT_DEVICE; #endif Index: head/contrib/ipfilter/ipsend/ipsend.h =================================================================== --- head/contrib/ipfilter/ipsend/ipsend.h +++ head/contrib/ipfilter/ipsend/ipsend.h @@ -26,9 +26,6 @@ #include #include "ipf.h" -#ifdef linux -#include -#endif /* XXX: The following is needed by tcpip.h */ #include #include "netinet/tcpip.h" @@ -49,11 +46,7 @@ extern int addipopt __P((char *, struct ipopt_names *, int, char *)); extern int initdevice __P((char *, int)); extern int sendip __P((int, char *, int)); -#ifdef linux -extern struct sock *find_tcp __P((int, struct tcpiphdr *)); -#else extern struct tcpcb *find_tcp __P((int, struct tcpiphdr *)); -#endif extern int ip_resend __P((char *, int, struct ipread *, struct in_addr, char *)); extern void ip_test1 __P((char *, int, ip_t *, struct in_addr, int)); Index: head/contrib/ipfilter/ipsend/ipsend.c =================================================================== --- head/contrib/ipfilter/ipsend/ipsend.c +++ head/contrib/ipfilter/ipsend/ipsend.c @@ -21,14 +21,10 @@ #include #include #include -#ifndef linux # include -#endif #include "ipsend.h" #include "ipf.h" -#ifndef linux # include -#endif extern char *optarg; @@ -37,27 +33,15 @@ char options[68]; int opts; -#ifdef linux -char default_device[] = "eth0"; -#else # ifdef ultrix char default_device[] = "ln0"; # else # ifdef __bsdi__ char default_device[] = "ef0"; # else -# ifdef __sgi -char default_device[] = "ec0"; -# else -# ifdef __hpux -char default_device[] = "lan0"; -# else char default_device[] = "le0"; -# endif /* __hpux */ -# endif /* __sgi */ # endif /* __bsdi__ */ # endif /* ultrix */ -#endif /* linux */ static void usage __P((char *)); Index: head/contrib/ipfilter/ipsend/ipsopt.c =================================================================== --- head/contrib/ipfilter/ipsend/ipsopt.c +++ head/contrib/ipfilter/ipsend/ipsopt.c @@ -20,9 +20,7 @@ #include #include #include -#ifndef linux #include -#endif #include #include #include "ipsend.h" Index: head/contrib/ipfilter/ipsend/iptest.c =================================================================== --- head/contrib/ipfilter/ipsend/iptest.c +++ head/contrib/ipfilter/ipsend/iptest.c @@ -18,12 +18,7 @@ #include #include #include -#ifndef linux #include -#endif -#ifdef linux -#include -#endif #include #include #include @@ -36,9 +31,6 @@ extern int optind; char options[68]; -#ifdef linux -char default_device[] = "eth0"; -#else # ifdef sun char default_device[] = "le0"; # else @@ -48,15 +40,10 @@ # ifdef __bsdi__ char default_device[] = "ef0"; # else -# ifdef __sgi -char default_device[] = "ec0"; -# else char default_device[] = "lan0"; -# endif # endif # endif # endif -#endif static void usage __P((char *)); int main __P((int, char **)); Index: head/contrib/ipfilter/ipsend/iptests.c =================================================================== --- head/contrib/ipfilter/ipsend/iptests.c +++ head/contrib/ipfilter/ipsend/iptests.c @@ -21,7 +21,6 @@ typedef int boolean_t; #endif #include -#if !defined(__osf__) # ifdef __NetBSD__ # include # include @@ -37,7 +36,6 @@ # endif # undef _KERNEL # undef KERNEL -#endif #if !defined(solaris) && !defined(linux) && !defined(__sgi) # include # include @@ -66,24 +64,13 @@ #endif #include #include -#ifdef __hpux -# define _NET_ROUTE_INCLUDED -#endif #include -#if defined(linux) && (LINUX >= 0200) -# include -#endif -#if !defined(linux) # if defined(__FreeBSD__) # include "radix_ipf.h" # endif # if !defined(solaris) # include # endif -#else -# define __KERNEL__ /* because there's a macro not wrapped by this */ -# include /* in this file :-/ */ -#endif #include #include #include @@ -94,20 +81,13 @@ #include #include #include -#ifdef __hpux -# undef _NET_ROUTE_INCLUDED -#endif -#if !defined(linux) # include # if !defined(__hpux) && !defined(solaris) # include # endif -#endif #include "ipsend.h" -#if !defined(linux) && !defined(__hpux) # include # include -#endif #if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106000000) # define USE_NANOSLEEP #endif @@ -951,9 +931,7 @@ int nfd, i; t = (tcphdr_t *)((char *)ip + (IP_HL(ip) << 2)); -#if !defined(linux) && !defined(__osf__) t->th_x2 = 0; -#endif TCP_OFF_A(t, 0); t->th_sport = htons(1); t->th_dport = htons(1); Index: head/contrib/ipfilter/ipsend/resend.c =================================================================== --- head/contrib/ipfilter/ipsend/resend.c +++ head/contrib/ipfilter/ipsend/resend.c @@ -19,10 +19,8 @@ #include #include #include -#ifndef linux # include # include -#endif #include #include #include Index: head/contrib/ipfilter/ipsend/sdlpi.c =================================================================== --- head/contrib/ipfilter/ipsend/sdlpi.c +++ head/contrib/ipfilter/ipsend/sdlpi.c @@ -25,14 +25,7 @@ # include # include #endif -#ifdef __osf__ -# include -#else # include -#endif -#ifdef __hpux -# include -#endif #include #include Index: head/contrib/ipfilter/ipsend/sock.c =================================================================== --- head/contrib/ipfilter/ipsend/sock.c +++ head/contrib/ipfilter/ipsend/sock.c @@ -29,7 +29,6 @@ #else # include #endif -#if !defined(__osf__) # ifdef __NetBSD__ # include # endif @@ -50,7 +49,6 @@ # undef _KERNEL # undef KERNEL # endif -#endif #include #include #include @@ -74,9 +72,7 @@ #include #include #include -#ifndef __osf__ # include -#endif #include #define _WANT_INPCB #include Index: head/contrib/ipfilter/lib/getifname.c =================================================================== --- head/contrib/ipfilter/lib/getifname.c +++ head/contrib/ipfilter/lib/getifname.c @@ -25,9 +25,6 @@ # include # include # endif -# ifdef __hpux -# include "compat.h" -# endif # include "../pfil/qif.h" char *ifname; qif_t qif; Index: head/contrib/ipfilter/lib/getproto.c =================================================================== --- head/contrib/ipfilter/lib/getproto.c +++ head/contrib/ipfilter/lib/getproto.c @@ -23,14 +23,6 @@ if (*s == '\0') return atoi(name); -#ifdef _AIX51 - /* - * For some bogus reason, "ip" is 252 in /etc/protocols on AIX 5 - * The IANA has doubled up on the definition of 0 - it is now also - * used for IPv6 hop-opts, so we can no longer rely on /etc/protocols - * providing the correct name->number mapping - */ -#endif if (!strcasecmp(name, "ip")) return 0; Index: head/contrib/ipfilter/lib/inet_addr.c =================================================================== --- head/contrib/ipfilter/lib/inet_addr.c +++ head/contrib/ipfilter/lib/inet_addr.c @@ -72,7 +72,6 @@ # define __P(x) () # endif #endif -#ifndef linux int inet_aton __P((const char *, struct in_addr *)); /* @@ -189,7 +188,6 @@ addr->s_addr = htonl(val); return (1); } -#endif /* these are compatibility routines, not needed on recent BSD releases */ Index: head/contrib/ipfilter/lib/kmem.c =================================================================== --- head/contrib/ipfilter/lib/kmem.c +++ head/contrib/ipfilter/lib/kmem.c @@ -18,9 +18,7 @@ #include #include #include -#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && !defined(linux) && !defined(_AIX51) #include -#endif #include #include #include @@ -29,9 +27,6 @@ #include #include #include -#if defined(linux) || defined(__osf__) || defined(__sgi) || defined(__hpux) -# include -#endif #include "kmem.h" @@ -46,82 +41,8 @@ -#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && \ - !defined(linux) && !defined(_AIX51) -/* - * For all platforms where there is a libkvm and a kvm_t, we use that... - */ static kvm_t *kvm_f = NULL; -#else -/* - *...and for the others (HP-UX, IRIX, Tru64), we have to provide our own. - */ - -typedef int * kvm_t; - -static kvm_t kvm_f = NULL; -static char *kvm_errstr = NULL; - -kvm_t kvm_open __P((char *, char *, char *, int, char *)); -int kvm_read __P((kvm_t, u_long, char *, size_t)); - -kvm_t kvm_open(kernel, core, swap, mode, errstr) - char *kernel, *core, *swap; - int mode; - char *errstr; -{ - kvm_t k; - int fd; - - kvm_errstr = errstr; - - if (core == NULL) - core = "/dev/kmem"; - - fd = open(core, mode); - if (fd == -1) - return NULL; - k = malloc(sizeof(*k)); - if (k == NULL) - return NULL; - *k = fd; - return k; -} - -int kvm_read(kvm, pos, buffer, size) - kvm_t kvm; - u_long pos; - char *buffer; - size_t size; -{ - int r = 0, left; - char *bufp; - - if (lseek(*kvm, pos, 0) == -1) { - if (kvm_errstr != NULL) { - fprintf(stderr, "%s", kvm_errstr); - perror("lseek"); - } - return -1; - } - - for (bufp = buffer, left = size; left > 0; bufp += r, left -= r) { - r = read(*kvm, bufp, left); -#ifdef __osf__ - /* - * Tru64 returns "0" for successful operation, not the number - * of bytes read. - */ - if (r == 0) - r = left; -#endif - if (r <= 0) - return -1; - } - return r; -} -#endif /* !defined(__sgi) && !defined(__hpux) && !defined(__osf__) */ int openkmem(kern, core) char *kern, *core; Index: head/contrib/ipfilter/lib/printproto.c =================================================================== --- head/contrib/ipfilter/lib/printproto.c +++ head/contrib/ipfilter/lib/printproto.c @@ -27,14 +27,6 @@ PRINTF("udp"); else if (np->in_flags & IPN_ICMPQUERY) PRINTF("icmp"); -#ifdef _AIX51 - /* - * To make up for "ip = 252" and "hopopt = 0" in /etc/protocols - * The IANA has doubled up on the definition of 0 - it is now - * also used for IPv6 hop-opts, so we can no longer rely on - * /etc/protocols providing the correct name->number mapping. - */ -#endif else if (np->in_pr[0] == 0) PRINTF("ip"); else if (pr != NULL) @@ -42,11 +34,6 @@ else PRINTF("%d", np->in_pr[0]); } else { -#ifdef _AIX51 - if (p == 0) - PRINTF("ip"); - else -#endif if (pr != NULL) PRINTF("%s", pr->p_name); else Index: head/contrib/ipfilter/md5.c =================================================================== --- head/contrib/ipfilter/md5.c +++ head/contrib/ipfilter/md5.c @@ -35,16 +35,11 @@ *********************************************************************** */ -#if defined(linux) && defined(_KERNEL) -extern void *memcpy(void *, const void *, unsigned long); -# define bcopy(a,b,c) memcpy(b,a,c) -#else -# if defined(_KERNEL) && !defined(__sgi) +# if defined(_KERNEL) # include # else # include # endif -#endif #include "md5.h" Index: head/contrib/ipfilter/tools/ipf.c =================================================================== --- head/contrib/ipfilter/tools/ipf.c +++ head/contrib/ipfilter/tools/ipf.c @@ -5,15 +5,6 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ -#ifdef __FreeBSD__ -# ifndef __FreeBSD_cc_version -# include -# else -# if __FreeBSD_cc_version < 430000 -# include -# endif -# endif -#endif #include "ipf.h" #include #include Index: head/contrib/ipfilter/tools/ipfs.c =================================================================== --- head/contrib/ipfilter/tools/ipfs.c +++ head/contrib/ipfilter/tools/ipfs.c @@ -5,15 +5,6 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ -#ifdef __FreeBSD__ -# ifndef __FreeBSD_cc_version -# include -# else -# if __FreeBSD_cc_version < 430000 -# include -# endif -# endif -#endif #include #include #include Index: head/contrib/ipfilter/tools/ipfstat.c =================================================================== --- head/contrib/ipfilter/tools/ipfstat.c +++ head/contrib/ipfilter/tools/ipfstat.c @@ -5,58 +5,26 @@ * * See the IPFILTER.LICENCE file for details on licencing. */ -#ifdef __FreeBSD__ -# ifndef __FreeBSD_cc_version -# include -# else -# if __FreeBSD_cc_version < 430000 -# include -# endif -# endif -#endif #include #include #include -#ifdef linux -# include -#else # include -#endif #include -#if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +#if defined(sun) && defined(__SVR4) # include #endif #include "ipf.h" #include "netinet/ipl.h" -#if defined(STATETOP) -# if defined(_BSDI_VERSION) -# undef STATETOP -# endif -# if defined(__FreeBSD__) && \ - (!defined(__FreeBSD_version) || (__FreeBSD_version < 430000)) -# undef STATETOP -# endif -# if defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105000000) -# undef STATETOP -# endif -# if defined(sun) -# if defined(__svr4__) || defined(__SVR4) +#if defined(STATETOP) +# if defined(sun) && defined(__SVR4) # include -# else -# undef STATETOP /* NOT supported on SunOS4 */ -# endif # endif -#endif -#if defined(STATETOP) && !defined(linux) # include # include -#endif -#ifdef STATETOP # include # include # include -# if SOLARIS || defined(__NetBSD__) || defined(_BSDI_VERSION) || \ - defined(__sgi) +# if SOLARIS || defined(__NetBSD__) # ifdef ERR # undef ERR # endif @@ -66,7 +34,7 @@ # endif /* SOLARIS */ #endif /* STATETOP */ #include "kmem.h" -#if defined(__NetBSD__) || (__OpenBSD__) +#if defined(__NetBSD__) # include #endif @@ -75,9 +43,6 @@ static const char rcsid[] = "@(#)$Id$"; #endif -#ifdef __hpux -# define nlist nlist64 -#endif extern char *optarg; extern int optind; Index: head/contrib/ipfilter/tools/ipftest.c =================================================================== --- head/contrib/ipfilter/tools/ipftest.c +++ head/contrib/ipfilter/tools/ipftest.c @@ -43,9 +43,6 @@ void drain_log __P((char *)); void fixv4sums __P((mb_t *, ip_t *)); -#if defined(__NetBSD__) || defined(__OpenBSD__) || SOLARIS || \ - (_BSDI_VERSION >= 199701) || (__FreeBSD_version >= 300000) || \ - defined(__osf__) || defined(linux) int ipftestioctl __P((int, ioctlcmd_t, ...)); int ipnattestioctl __P((int, ioctlcmd_t, ...)); int ipstatetestioctl __P((int, ioctlcmd_t, ...)); @@ -53,15 +50,6 @@ int ipscantestioctl __P((int, ioctlcmd_t, ...)); int ipsynctestioctl __P((int, ioctlcmd_t, ...)); int ipooltestioctl __P((int, ioctlcmd_t, ...)); -#else -int ipftestioctl __P((dev_t, ioctlcmd_t, void *)); -int ipnattestioctl __P((dev_t, ioctlcmd_t, void *)); -int ipstatetestioctl __P((dev_t, ioctlcmd_t, void *)); -int ipauthtestioctl __P((dev_t, ioctlcmd_t, void *)); -int ipsynctestioctl __P((dev_t, ioctlcmd_t, void *)); -int ipscantestioctl __P((dev_t, ioctlcmd_t, void *)); -int ipooltestioctl __P((dev_t, ioctlcmd_t, void *)); -#endif static ioctlfunc_t iocfunctions[IPL_LOGSIZE] = { ipftestioctl, ipnattestioctl, @@ -292,15 +280,7 @@ ipf_state_flush(softc, 1, 0); if (dir && (ifp != NULL) && IP_V(ip) && (m != NULL)) -#if defined(__sgi) && (IRIX < 60500) - (*ifp->if_output)(ifp, (void *)m, NULL); -#else -# if TRU64 >= 1885 - (*ifp->if_output)(ifp, (void *)m, NULL, 0, 0); -# else (*ifp->if_output)(ifp, (void *)m, NULL, 0); -# endif -#endif while ((m != NULL) && (m != &mb)) { n = m->mb_next; @@ -351,9 +331,6 @@ } -#if defined(__NetBSD__) || defined(__OpenBSD__) || SOLARIS || \ - (_BSDI_VERSION >= 199701) || (__FreeBSD_version >= 300000) || \ - defined(__osf__) || defined(linux) int ipftestioctl(int dev, ioctlcmd_t cmd, ...) { caddr_t data; @@ -513,141 +490,6 @@ } return 0; } -#else -int ipftestioctl(dev, cmd, data) - dev_t dev; - ioctlcmd_t cmd; - void *data; -{ - int i; - - dev = dev; /* gcc -Wextra */ - i = ipfioctl(softc, IPL_LOGIPF, cmd, data, FWRITE|FREAD); - if ((opts & OPT_DEBUG) || (i != 0)) - fprintf(stderr, "ipfioctl(IPF,%#x,%p) = %d (%d)\n", - cmd, data, i, softc->ipf_interror); - if (i != 0) { - errno = i; - return -1; - } - return 0; -} - - -int ipnattestioctl(dev, cmd, data) - dev_t dev; - ioctlcmd_t cmd; - void *data; -{ - int i; - - dev = dev; /* gcc -Wextra */ - i = ipfioctl(softc, IPL_LOGNAT, cmd, data, FWRITE|FREAD); - if ((opts & OPT_DEBUG) || (i != 0)) - fprintf(stderr, "ipfioctl(NAT,%#x,%p) = %d\n", cmd, data, i); - if (i != 0) { - errno = i; - return -1; - } - return 0; -} - - -int ipstatetestioctl(dev, cmd, data) - dev_t dev; - ioctlcmd_t cmd; - void *data; -{ - int i; - - dev = dev; /* gcc -Wextra */ - i = ipfioctl(softc, IPL_LOGSTATE, cmd, data, FWRITE|FREAD); - if ((opts & OPT_DEBUG) || (i != 0)) - fprintf(stderr, "ipfioctl(STATE,%#x,%p) = %d\n", cmd, data, i); - if (i != 0) { - errno = i; - return -1; - } - return 0; -} - - -int ipauthtestioctl(dev, cmd, data) - dev_t dev; - ioctlcmd_t cmd; - void *data; -{ - int i; - - dev = dev; /* gcc -Wextra */ - i = ipfioctl(softc, IPL_LOGAUTH, cmd, data, FWRITE|FREAD); - if ((opts & OPT_DEBUG) || (i != 0)) - fprintf(stderr, "ipfioctl(AUTH,%#x,%p) = %d\n", cmd, data, i); - if (i != 0) { - errno = i; - return -1; - } - return 0; -} - - -int ipsynctestioctl(dev, cmd, data) - dev_t dev; - ioctlcmd_t cmd; - void *data; -{ - int i; - - dev = dev; /* gcc -Wextra */ - i = ipfioctl(softc, IPL_LOGSYNC, cmd, data, FWRITE|FREAD); - if ((opts & OPT_DEBUG) || (i != 0)) - fprintf(stderr, "ipfioctl(SYNC,%#x,%p) = %d\n", cmd, data, i); - if (i != 0) { - errno = i; - return -1; - } - return 0; -} - - -int ipscantestioctl(dev, cmd, data) - dev_t dev; - ioctlcmd_t cmd; - void *data; -{ - int i; - - dev = dev; /* gcc -Wextra */ - i = ipfioctl(softc, IPL_LOGSCAN, cmd, data, FWRITE|FREAD); - if ((opts & OPT_DEBUG) || (i != 0)) - fprintf(stderr, "ipfioctl(SCAN,%#x,%p) = %d\n", cmd, data, i); - if (i != 0) { - errno = i; - return -1; - } - return 0; -} - - -int ipooltestioctl(dev, cmd, data) - dev_t dev; - ioctlcmd_t cmd; - void *data; -{ - int i; - - dev = dev; /* gcc -Wextra */ - i = ipfioctl(softc, IPL_LOGLOOKUP, cmd, data, FWRITE|FREAD); - if (opts & OPT_DEBUG) - fprintf(stderr, "ipfioctl(POOL,%#x,%p) = %d (%d)\n", - cmd, data, i, softc->ipf_interror); - if (i != 0) { - errno = i; - return -1; - } - return 0; -} -#endif int kmemcpy(addr, offset, size) Index: head/contrib/ipfilter/tools/ipmon.c =================================================================== --- head/contrib/ipfilter/tools/ipmon.c +++ head/contrib/ipfilter/tools/ipmon.c @@ -20,12 +20,7 @@ #endif -#if defined(sun) && !defined(SOLARIS2) -#define STRERROR(x) sys_errlist[x] -extern char *sys_errlist[]; -#else #define STRERROR(x) strerror(x) -#endif extern int optind; extern char *optarg; @@ -116,11 +111,7 @@ #ifdef MENTAT static char *pidfile = "/etc/opt/ipf/ipmon.pid"; #else -# if BSD >= 199306 static char *pidfile = "/var/run/ipmon.pid"; -# else -static char *pidfile = "/etc/ipmon.pid"; -# endif #endif static char line[2048]; @@ -138,11 +129,7 @@ static char *icmpname6 __P((u_int, u_int)); static icmp_type_t *find_icmptype __P((int, icmp_type_t *, size_t)); static icmp_subtype_t *find_icmpsubtype __P((int, icmp_subtype_t *, size_t)); -#ifdef __hpux -static struct tm *get_tm __P((u_32_t)); -#else static struct tm *get_tm __P((time_t)); -#endif char *portlocalname __P((int, char *, u_int)); int main __P((int, char *[])); @@ -400,11 +387,6 @@ if (protocols[0]) free(protocols[0]); protocols[0] = strdup("ip"); -#if defined(_AIX51) - if (protocols[252]) - free(protocols[252]); - protocols[252] = NULL; -#endif } if (udp_ports != NULL) { @@ -643,11 +625,7 @@ static struct tm *get_tm(sec) -#ifdef __hpux - u_32_t sec; -#else time_t sec; -#endif { struct tm *tm; time_t t; @@ -1123,10 +1101,6 @@ sprintf(t, "%dx ", ipl->ipl_count); t += strlen(t); } -#if (defined(MENTAT) || \ - (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199603)) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 501113)) || \ - (defined(OpenBSD) && (OpenBSD >= 199603))) || defined(linux) { char ifname[sizeof(ipf->fl_ifname) + 1]; @@ -1134,28 +1108,13 @@ ifname[sizeof(ipf->fl_ifname)] = '\0'; sprintf(t, "%s", ifname); t += strlen(t); -# if defined(MENTAT) || defined(linux) -# if defined(linux) - /* - * On Linux, the loopback interface is just "lo", not "lo0". - */ - if (strcmp(ifname, "lo") != 0) -# endif +# if defined(MENTAT) if (ISALPHA(*(t - 1))) { sprintf(t, "%d", ipf->fl_unit); t += strlen(t); } # endif } -#else - for (len = 0; len < 3; len++) - if (ipf->fl_ifname[len] == '\0') - break; - if (ipf->fl_ifname[len]) - len++; - sprintf(t, "%*.*s%u", len, len, ipf->fl_ifname, ipf->fl_unit); - t += strlen(t); -#endif if ((ipf->fl_group[0] == (char)~0) && (ipf->fl_group[1] == '\0')) strcat(t, " @-1:"); else if (ipf->fl_group[0] == '\0') Index: head/contrib/ipfilter/tools/ipnat.c =================================================================== --- head/contrib/ipfilter/tools/ipnat.c +++ head/contrib/ipfilter/tools/ipnat.c @@ -12,7 +12,7 @@ #include #include #include -#if !defined(__SVR4) && !defined(__svr4__) +#if !defined(__SVR4) #include #else #include @@ -28,7 +28,7 @@ #undef _KERNEL #include #include -#if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +#if defined(sun) && defined(__SVR4) # include # include #endif @@ -42,25 +42,13 @@ #include #include #include -#if defined(linux) -# include -#else # include -#endif #include "ipf.h" #include "netinet/ipl.h" #include "kmem.h" -#ifdef __hpux -# define nlist nlist64 -#endif -#if defined(sun) && !SOLARIS2 -# define STRERROR(x) sys_errlist[x] -extern char *sys_errlist[]; -#else # define STRERROR(x) strerror(x) -#endif #if !defined(lint) static const char sccsid[] ="@(#)ipnat.c 1.9 6/5/96 (C) 1993 Darren Reed"; Index: head/contrib/ipfilter/tools/ipnat_y.y =================================================================== --- head/contrib/ipfilter/tools/ipnat_y.y +++ head/contrib/ipfilter/tools/ipnat_y.y @@ -6,15 +6,6 @@ * See the IPFILTER.LICENCE file for details on licencing. */ %{ -#ifdef __FreeBSD__ -# ifndef __FreeBSD_cc_version -# include -# else -# if __FreeBSD_cc_version < 430000 -# include -# endif -# endif -#endif #include #include #include Index: head/contrib/ipfilter/tools/ippool.c =================================================================== --- head/contrib/ipfilter/tools/ippool.c +++ head/contrib/ipfilter/tools/ippool.c @@ -9,9 +9,7 @@ #include #include #include -#if defined(BSD) && (BSD >= 199306) # include -#endif #include #include @@ -26,11 +24,7 @@ #include #include #include -#ifdef linux -# include -#else # include -#endif #include "ipf.h" #include "netinet/ipl.h" Index: head/contrib/ipfilter/tools/ippool_y.y =================================================================== --- head/contrib/ipfilter/tools/ippool_y.y +++ head/contrib/ipfilter/tools/ippool_y.y @@ -10,9 +10,7 @@ #include #include #include -#if defined(BSD) && (BSD >= 199306) # include -#endif #include #include Index: head/sys/contrib/ipfilter/netinet/fil.c =================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c +++ head/sys/contrib/ipfilter/netinet/fil.c @@ -20,26 +20,18 @@ #include #include #include -#if defined(_KERNEL) && defined(__FreeBSD_version) && \ - (__FreeBSD_version >= 220000) -# if (__FreeBSD_version >= 400000) +#if defined(_KERNEL) && defined(__FreeBSD_version) # if !defined(IPFILTER_LKM) # include "opt_inet6.h" # endif -# if (__FreeBSD_version == 400019) -# define CSUM_DELAY_DATA -# endif -# endif # include #else # include #endif -#if (defined(__SVR4) || defined(__svr4__)) && defined(sun) +#if defined(__SVR4) || defined(sun) /* SOLARIS */ # include #endif -#if !defined(_AIX51) # include -#endif #if defined(_KERNEL) # include # include @@ -50,29 +42,18 @@ # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #endif -#if !defined(__SVR4) && !defined(__svr4__) && !defined(__hpux) && \ - !defined(linux) +#if !defined(__SVR4) # include #else -# if !defined(linux) # include -# endif # if (SOLARIS2 < 5) && defined(sun) # include # endif #endif -#ifdef __hpux -# define _NET_ROUTE_INCLUDED -#endif -#if !defined(linux) # include -#endif #include #include #ifdef sun @@ -81,25 +62,13 @@ #include #include #include -#if defined(__sgi) && defined(IFF_DRVRLOCK) /* IRIX 6 */ -# include -# include -#endif #include -#if (!defined(__sgi) && !defined(AIX)) || defined(_KERNEL) # include # include -#endif -#ifdef __hpux -# undef _NET_ROUTE_INCLUDED -#endif -#ifdef __osf__ -# undef _RADIX_H_ -#endif #include "netinet/ip_compat.h" #ifdef USE_INET6 # include -# if !SOLARIS && defined(_KERNEL) && !defined(__osf__) && !defined(__hpux) +# if !SOLARIS && defined(_KERNEL) # include # endif #endif @@ -122,7 +91,7 @@ #if defined(IPFILTER_BPF) && defined(_KERNEL) # include #endif -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000) +#if defined(__FreeBSD_version) # include #endif #include "netinet/ipl.h" @@ -131,10 +100,6 @@ # include extern struct callout ipf_slowtimer_ch; #endif -#if defined(__OpenBSD__) -# include -extern struct timeout ipf_slowtimer_ch; -#endif /* END OF INCLUDES */ #if !defined(lint) @@ -214,10 +179,7 @@ static int ipf_settimeout __P((struct ipf_main_softc_s *, struct ipftuneable *, ipftuneval_t *)); -#if !defined(_KERNEL) || (!defined(__NetBSD__) && !defined(__OpenBSD__) && \ - !defined(__FreeBSD__)) || \ - FREEBSD_LT_REV(501000) || NETBSD_LT_REV(105000000) || \ - OPENBSD_LT_REV(200006) +#if !defined(_KERNEL) || SOLARIS static int ppsratecheck(struct timeval *, int *, int); #endif @@ -3267,12 +3229,6 @@ } } else { LBUMP(ipf_stats[out].fr_pass); -#if defined(_KERNEL) && defined(__sgi) - if ((fin->fin_hbuf != NULL) && - (mtod(fin->fin_m, struct ip *) != fin->fin_ip)) { - COPYBACK(fin->fin_m, 0, fin->fin_plen, fin->fin_hbuf); - } -#endif } SPL_X(s); @@ -5483,10 +5439,7 @@ } -#if !defined(_KERNEL) || (!defined(__NetBSD__) && !defined(__OpenBSD__) && \ - !defined(__FreeBSD__)) || \ - FREEBSD_LT_REV(501000) || NETBSD_LT_REV(105000000) || \ - OPENBSD_LT_REV(200006) +#if !defined(_KERNEL) || SOLARIS /* * From: NetBSD * ppsratecheck(): packets (or events) per second limitation. @@ -10111,9 +10064,6 @@ ipf_rule_expire(softc); ipf_sync_expire(softc); softc->ipf_ticks++; -# if defined(__OpenBSD__) - timeout_add(&ipf_slowtimer_ch, hz/2); -# endif } Index: head/sys/contrib/ipfilter/netinet/ip_auth.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_auth.c +++ head/sys/contrib/ipfilter/netinet/ip_auth.c @@ -24,29 +24,24 @@ # endif # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #endif -#if defined(_KERNEL) && (__FreeBSD_version >= 220000) +#if defined(_KERNEL) && defined(__FreeBSD_version) # include # include #else # include #endif -#if !defined(linux) # include -#endif #include #if defined(_KERNEL) # include -# if !defined(__SVR4) && !defined(__svr4__) && !defined(linux) +# if !defined(__SVR4) # include # endif #endif -#if defined(__SVR4) || defined(__svr4__) +#if defined(__SVR4) # include # include # ifdef _KERNEL @@ -55,11 +50,10 @@ # include # include #endif -#if (defined(_BSDI_VERSION) && (_BSDI_VERSION >= 199802)) || \ - (defined(__FreeBSD_version) &&(__FreeBSD_version >= 400000)) +#if defined(__FreeBSD_version) # include #endif -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(bsdi) +#if defined(__NetBSD__) # include #endif #if defined(_KERNEL) && defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) @@ -76,10 +70,8 @@ #include #include #include -#if !defined(linux) # include -#endif -#if !defined(_KERNEL) && !defined(__osf__) && !defined(__sgi) +#if !defined(_KERNEL) # define KERNEL # define _KERNEL # define NOT_KERNEL @@ -89,34 +81,26 @@ # undef KERNEL #endif #include -#if defined(IRIX) && (IRIX < 60516) /* IRIX < 6 */ -extern struct ifqueue ipintrq; /* ip packet input queue */ -#else -# if !defined(__hpux) && !defined(linux) -# if __FreeBSD_version >= 300000 +# if defined(__FreeBSD_version) # include -# if __FreeBSD_version >= 500042 # define IF_QFULL _IF_QFULL # define IF_DROP _IF_DROP -# endif /* __FreeBSD_version >= 500042 */ # endif # include # include -# endif -#endif #include #include #include "netinet/ip_compat.h" #include #include "netinet/ip_fil.h" #include "netinet/ip_auth.h" -#if !defined(MENTAT) && !defined(linux) +#if !defined(MENTAT) # include # ifdef __FreeBSD__ # include # endif #endif -#if (__FreeBSD_version >= 300000) +#if defined(__FreeBSD_version) # include # if defined(_KERNEL) && !defined(IPFILTER_LKM) # include @@ -232,9 +216,6 @@ bzero((char *)softa->ipf_auth_pkts, softa->ipf_auth_size * sizeof(*softa->ipf_auth_pkts)); -#if defined(linux) && defined(_KERNEL) - init_waitqueue_head(&softa->ipf_auth_next_linux); -#endif return 0; } @@ -1106,22 +1087,7 @@ error = EINTR; } # else /* SOLARIS */ -# ifdef __hpux - { - lock_t *l; - - l = get_sleep_lock(&softa->ipf_auth_next); - error = sleep(&softa->ipf_auth_next, PZERO+1); - spinunlock(l); - } -# else -# ifdef __osf__ - error = mpsleep(&softa->ipf_auth_next, PSUSP|PCATCH, "ipf_auth_next", - 0, &softa->ipf_auth_mx, MS_LOCK_SIMPLE); -# else error = SLEEP(&softa->ipf_auth_next, "ipf_auth_next"); -# endif /* __osf__ */ -# endif /* __hpux */ # endif /* SOLARIS */ #endif MUTEX_EXIT(&softa->ipf_auth_mx); Index: head/sys/contrib/ipfilter/netinet/ip_compat.h =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h +++ head/sys/contrib/ipfilter/netinet/ip_compat.h @@ -33,7 +33,7 @@ #endif #ifndef SOLARIS -# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# if defined(sun) && defined(__SVR4) # define SOLARIS 1 # else # define SOLARIS 0 @@ -41,7 +41,7 @@ #endif -#if defined(__SVR4) || defined(__svr4__) || defined(__sgi) +#if defined(__SVR4) # define index strchr # if !defined(_KERNEL) # define bzero(a,b) memset(a,0,b) @@ -62,11 +62,6 @@ # endif #endif -#if defined(__sgi) || defined(bsdi) || defined(__hpux) || defined(hpux) -struct ether_addr { - u_char ether_addr_octet[6]; -}; -#endif # ifdef __STDC__ # define IPL_EXTERN(ep) ipl##ep @@ -100,15 +95,6 @@ (__FreeBSD_version > (x))) #define FREEBSD_LT_REV(x) (defined(__FreeBSD_version) && \ (__FreeBSD_version < (x))) -#define BSDOS_GE_REV(x) (defined(_BSDI_VERSION) && \ - (_BSDI_VERSION >= (x))) -#define BSDOS_GT_REV(x) (defined(_BSDI_VERSION) && \ - (_BSDI_VERSION > (x))) -#define BSDOS_LT_REV(x) (defined(_BSDI_VERSION) && \ - (_BSDI_VERSION < (x))) -#define OPENBSD_GE_REV(x) (defined(OpenBSD) && (OpenBSD >= (x))) -#define OPENBSD_GT_REV(x) (defined(OpenBSD) && (OpenBSD > (x))) -#define OPENBSD_LT_REV(x) (defined(OpenBSD) && (OpenBSD < (x))) #define BSD_GE_YEAR(x) (defined(BSD) && (BSD >= (x))) #define BSD_GT_YEAR(x) (defined(BSD) && (BSD > (x))) #define BSD_LT_YEAR(x) (defined(BSD) && (BSD < (x))) @@ -321,8 +307,7 @@ #define ipf_isw ipf_lkun_s.ipf_sw #define ipf_magic ipf_lkun_s.ipf_magic -#if !defined(__GNUC__) || \ - (defined(__FreeBSD_version) && (__FreeBSD_version >= 503000)) +#if !defined(__GNUC__) || defined(__FreeBSD_version) # ifndef INLINE # define INLINE # endif @@ -473,11 +458,10 @@ #ifdef USE_INET6 -# if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \ - defined(__osf__) || defined(linux) +# if defined(__NetBSD__) || defined(__FreeBSD__) # include # include -# if defined(_KERNEL) && !defined(__osf__) +# if defined(_KERNEL) # include # endif typedef struct ip6_hdr ip6_t; @@ -497,21 +481,16 @@ # define COPYBACK m_copyback # endif # if (defined(__NetBSD_Version__) && (__NetBSD_Version__ < 105180000)) || \ - defined(__FreeBSD__) || (defined(OpenBSD) && (OpenBSD < 200206)) || \ - defined(_BSDI_VERSION) + defined(__FreeBSD__) # include # endif -# if !defined(__FreeBSD__) || FREEBSD_GE_REV(300000) -# if NETBSD_GE_REV(105180000) || OPENBSD_GE_REV(200111) +# if NETBSD_GE_REV(105180000) # include # else # include extern vm_map_t kmem_map; # endif # include -# else /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD_version >= 300000) */ -# include -# endif /* !__FreeBSD__ || (__FreeBSD__ && __FreeBSD_version >= 300000) */ # ifdef IPFILTER_M_IPFILTER # include Index: head/sys/contrib/ipfilter/netinet/ip_dstlist.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_dstlist.c +++ head/sys/contrib/ipfilter/netinet/ip_dstlist.c @@ -9,9 +9,6 @@ # define KERNEL 1 # define _KERNEL 1 #endif -#if defined(__osf__) -# define _PROTO_NET_H_ -#endif #include #include #include @@ -21,9 +18,6 @@ # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #else @@ -33,14 +27,12 @@ # endif #endif #include -#if !defined(linux) # include -#endif #include -#if defined(_KERNEL) && (!defined(__SVR4) && !defined(__svr4__)) +#if defined(_KERNEL) && !defined(__SVR4) # include #endif -#if defined(__SVR4) || defined(__svr4__) +#if defined(__SVR4) # include # include # ifdef _KERNEL @@ -49,7 +41,7 @@ # include # include #endif -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000) +#if defined(__FreeBSD_version) # include #endif Index: head/sys/contrib/ipfilter/netinet/ip_fil.h =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h +++ head/sys/contrib/ipfilter/netinet/ip_fil.h @@ -11,9 +11,7 @@ #ifndef __IP_FIL_H__ #define __IP_FIL_H__ -#if !defined(linux) || !defined(_KERNEL) # include -#endif #include "netinet/ip_compat.h" #include "netinet/ipf_rb.h" @@ -21,15 +19,11 @@ # include #endif #if defined(BSD) && defined(_KERNEL) -# if NETBSD_LT_REV(399000000) || defined(__osf__) || FREEBSD_LT_REV(500043) -# include -# else # include -# endif #endif #ifndef SOLARIS -# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# if defined(sun) && defined(__SVR4) # define SOLARIS 1 # else # define SOLARIS 0 @@ -44,7 +38,7 @@ # endif #endif -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) +#if defined(__STDC__) || defined(__GNUC__) # define SIOCADAFR _IOW('r', 60, struct ipfobj) # define SIOCRMAFR _IOW('r', 61, struct ipfobj) # define SIOCSETFF _IOW('r', 62, u_int) @@ -459,9 +453,6 @@ void *fin_qpi; char fin_ifname[LIFNAMSIZ]; #endif -#ifdef __sgi - void *fin_hbuf; -#endif void *fin_fraghdr; /* pointer to start of ipv6 frag hdr */ } fr_info_t; @@ -1425,10 +1416,6 @@ /* ** HPUX Port */ -#ifdef __hpux -/* HP-UX locking sequence deadlock detection module lock MAJOR ID */ -# define IPF_SMAJ 0 /* temp assignment XXX, not critical */ -#endif #if !defined(CDEV_MAJOR) && defined (__FreeBSD_version) && \ (__FreeBSD_version >= 220000) @@ -1624,22 +1611,14 @@ frentry_t *ipf_rule_explist[2]; ipftoken_t *ipf_token_head; ipftoken_t **ipf_token_tail; -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000) && \ - defined(_KERNEL) +#if defined(__FreeBSD_version) && defined(_KERNEL) struct callout ipf_slow_ch; #endif -#if defined(linux) && defined(_KERNEL) - struct timer_list ipf_timer; -#endif #if NETBSD_GE_REV(104040000) struct callout ipf_slow_ch; #endif #if SOLARIS -# if SOLARIS2 >= 7 timeout_id_t ipf_slow_ch; -# else - int ipf_slow_ch; -# endif #endif #if defined(_KERNEL) # if SOLARIS @@ -1662,12 +1641,7 @@ hook_t *ipf_hk_loop_v6_out; # endif # else -# if defined(linux) && defined(_KERNEL) - struct poll_table_struct ipf_selwait[IPL_LOGSIZE]; - wait_queue_head_t iplh_linux[IPL_LOGSIZE]; -# else struct selinfo ipf_selwait[IPL_LOGSIZE]; -# endif # endif #endif void *ipf_slow; @@ -1697,67 +1671,27 @@ extern int ipl_enable __P((void)); extern int ipl_disable __P((void)); # ifdef MENTAT +/* XXX MENTAT is always defined for Solaris */ extern int ipf_check __P((void *, struct ip *, int, void *, int, void *, mblk_t **)); # if SOLARIS extern void ipf_prependmbt(fr_info_t *, mblk_t *); -# if SOLARIS2 >= 7 extern int ipfioctl __P((dev_t, int, intptr_t, int, cred_t *, int *)); -# else -extern int ipfioctl __P((dev_t, int, int *, int, cred_t *, int *)); -# endif # endif -# ifdef __hpux -extern int ipfioctl __P((dev_t, int, caddr_t, int)); -extern int ipf_select __P((dev_t, int)); -# endif extern int ipf_qout __P((queue_t *, mblk_t *)); # else /* MENTAT */ +/* XXX MENTAT is never defined for FreeBSD & NetBSD */ extern int ipf_check __P((void *, struct ip *, int, void *, int, mb_t **)); extern int (*fr_checkp) __P((ip_t *, int, void *, int, mb_t **)); extern size_t mbufchainlen __P((mb_t *)); -# ifdef __sgi -# include -extern int ipfioctl __P((dev_t, int, caddr_t, int, cred_t *, int *)); -extern int ipfilter_sgi_attach __P((void)); -extern void ipfilter_sgi_detach __P((void)); -extern void ipfilter_sgi_intfsync __P((void)); -# else # ifdef IPFILTER_LKM extern int ipf_identify __P((char *)); # endif -# if BSDOS_GE_REV(199510) || FREEBSD_GE_REV(220000) || \ - (defined(NetBSD) && (NetBSD >= 199511)) || defined(__OpenBSD__) -# if defined(__NetBSD__) || BSDOS_GE_REV(199701) || \ - defined(__OpenBSD__) || FREEBSD_GE_REV(300000) -# if (__FreeBSD_version >= 500024) -# if (__FreeBSD_version >= 502116) +# if defined(__FreeBSD_version) extern int ipfioctl __P((struct cdev*, u_long, caddr_t, int, struct thread *)); -# else -extern int ipfioctl __P((dev_t, u_long, caddr_t, int, struct thread *)); -# endif /* __FreeBSD_version >= 502116 */ -# else -# if NETBSD_GE_REV(499001000) +# elif defined(__NetBSD__) extern int ipfioctl __P((dev_t, u_long, void *, int, struct lwp *)); -# else -# if NETBSD_GE_REV(399001400) -extern int ipfioctl __P((dev_t, u_long, caddr_t, int, struct lwp *)); -# else -extern int ipfioctl __P((dev_t, u_long, caddr_t, int, struct proc *)); -# endif -# endif -# endif /* __FreeBSD_version >= 500024 */ -# else -extern int ipfioctl __P((dev_t, int, caddr_t, int, struct proc *)); -# endif -# else -# ifdef linux -extern int ipfioctl __P((struct inode *, struct file *, u_int, u_long)); -# else -extern int ipfioctl __P((dev_t, int, caddr_t, int)); -# endif -# endif /* (_BSDI_VERSION >= 199510) */ -# endif /* __ sgi */ +# endif # endif /* MENTAT */ # if defined(__FreeBSD_version) Index: head/sys/contrib/ipfilter/netinet/ip_frag.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_frag.c +++ head/sys/contrib/ipfilter/netinet/ip_frag.c @@ -16,30 +16,21 @@ #include #include #include -#ifdef __hpux -# include -#endif #if !defined(_KERNEL) # include # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #endif -#if defined(_KERNEL) && \ - defined(__FreeBSD_version) && (__FreeBSD_version >= 220000) +#if defined(_KERNEL) && defined(__FreeBSD_version) # include # include #else # include #endif -#if !defined(linux) # include -#endif #include #if defined(_KERNEL) # include @@ -48,7 +39,7 @@ # endif #endif #if !defined(__SVR4) && !defined(__svr4__) -# if defined(_KERNEL) && !defined(__sgi) && !defined(AIX) +# if defined(_KERNEL) # include # endif #else @@ -66,9 +57,7 @@ #include #include #include -#if !defined(linux) # include -#endif #include #include #include Index: head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c +++ head/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c @@ -1308,11 +1308,7 @@ t = &ftp->ftp_side[1 - rv]; thseq = ntohl(tcp->th_seq); thack = ntohl(tcp->th_ack); -#ifdef __sgi - mlen = fin->fin_plen - off; -#else mlen = MSGDSIZE(m) - off; -#endif DT3(process_debug, tcphdr_t *, tcp, int, off, int, mlen); if (softf->ipf_p_ftp_debug & DEBUG_INFO) @@ -1609,11 +1605,7 @@ if (tcp->th_flags & TH_FIN) f->ftps_seq[1]++; if (softf->ipf_p_ftp_debug & DEBUG_PARSE_INFO) { -#ifdef __sgi - mlen = fin->fin_plen; -#else mlen = MSGDSIZE(m); -#endif mlen -= off; printf("ftps_seq[1] = %x inc %d len %d\n", f->ftps_seq[1], inc, mlen); Index: head/sys/contrib/ipfilter/netinet/ip_htable.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_htable.c +++ head/sys/contrib/ipfilter/netinet/ip_htable.c @@ -20,22 +20,18 @@ # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #endif #include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000) +#if defined(__FreeBSD_version) # include #endif #if defined(__FreeBSD__) # include # include #endif -#if !defined(__svr4__) && !defined(__SVR4) && !defined(__hpux) && \ - !defined(linux) +#if !defined(__SVR4) # include #endif #if defined(_KERNEL) Index: head/sys/contrib/ipfilter/netinet/ip_irc_pxy.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_irc_pxy.c +++ head/sys/contrib/ipfilter/netinet/ip_irc_pxy.c @@ -278,11 +278,7 @@ bzero(ctcpbuf, sizeof(ctcpbuf)); off = (char *)tcp - (char *)ip + (TCP_OFF(tcp) << 2) + fin->fin_ipoff; -#ifdef __sgi - dlen = fin->fin_plen - off; -#else dlen = MSGDSIZE(m) - off; -#endif if (dlen <= 0) return 0; COPYDATA(m, off, MIN(sizeof(ctcpbuf), dlen), ctcpbuf); @@ -361,7 +357,7 @@ fin->fin_flx |= FI_DOCKSUM; if (inc != 0) { -#if defined(MENTAT) || defined(__sgi) +#if defined(MENTAT) register u_32_t sum1, sum2; sum1 = fin->fin_plen; Index: head/sys/contrib/ipfilter/netinet/ip_log.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_log.c +++ head/sys/contrib/ipfilter/netinet/ip_log.c @@ -19,7 +19,7 @@ # include #endif #ifndef SOLARIS -# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# if defined(sun) && defined(__SVR4) # define SOLARIS 1 # else # define SOLARIS 0 @@ -35,15 +35,11 @@ # include # define _KERNEL # define KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL # undef KERNEL #endif -#if (defined(__FreeBSD_version) && (__FreeBSD_version >= 220000)) && \ - defined(_KERNEL) +#if defined(__FreeBSD_version) && defined(_KERNEL) # include # include #else @@ -56,21 +52,15 @@ # include # endif #endif /* _KERNEL */ -#if !SOLARIS && !defined(__hpux) && !defined(linux) -# if (defined(NetBSD) && (NetBSD > 199609)) || \ - (defined(OpenBSD) && (OpenBSD > 199603)) || \ - (defined(__FreeBSD_version) && (__FreeBSD_version >= 300000)) +# if defined(NetBSD) || defined(__FreeBSD_version) # include -# else -# include -# endif # include # include -# if __FreeBSD_version >= 500000 +# endif +# if defined(__FreeBSD_version) # include # endif -#else -# if !defined(__hpux) && defined(_KERNEL) +#if SOLARIS && defined(_KERNEL) # include # include # include @@ -80,24 +70,18 @@ # include # include # include -# endif /* !__hpux */ -#endif /* !SOLARIS && !__hpux */ -#if !defined(linux) +#endif /* SOLARIS && _KERNEL */ # include -#endif #include #include #ifdef sun # include #endif -#if __FreeBSD_version >= 300000 +#if defined(__FreeBSD_version) # include #endif #include -#ifdef __sgi -# include -#endif # include #include #include @@ -107,9 +91,7 @@ #ifdef USE_INET6 # include #endif -#if !defined(linux) # include -#endif #ifndef _KERNEL # include #endif @@ -120,7 +102,7 @@ #include "netinet/ip_frag.h" #include "netinet/ip_state.h" #include "netinet/ip_auth.h" -#if (__FreeBSD_version >= 300000) || defined(__NetBSD__) +#if defined(__FreeBSD_version) || defined(__NetBSD__) # include #endif /* END OF INCLUDES */ @@ -139,12 +121,6 @@ # if SOLARIS && defined(_KERNEL) kcondvar_t ipl_wait[IPL_LOGSIZE]; # endif -# if defined(linux) && defined(_KERNEL) - wait_queue_head_t iplh_linux[IPL_LOGSIZE]; -# endif -# if defined(__hpux) && defined(_KERNEL) - iplog_select_t ipl_ss[IPL_LOGSIZE]; -# endif iplog_t **iplh[IPL_LOGSIZE]; iplog_t *iplt[IPL_LOGSIZE]; iplog_t *ipll[IPL_LOGSIZE]; @@ -386,11 +362,11 @@ ipflog_t ipfl; u_char p; mb_t *m; -# if (SOLARIS || defined(__hpux)) && defined(_KERNEL) && !defined(FW_HOOKS) +# if SOLARIS && defined(_KERNEL) && !defined(FW_HOOKS) qif_t *ifp; # else struct ifnet *ifp; -# endif /* SOLARIS || __hpux */ +# endif /* SOLARIS */ m = fin->fin_m; if (m == NULL) @@ -460,14 +436,14 @@ * Get the interface number and name to which this packet is * currently associated. */ -# if (SOLARIS || defined(__hpux)) && defined(_KERNEL) +# if SOLARIS && defined(_KERNEL) # if !defined(FW_HOOKS) ipfl.fl_unit = (u_int)ifp->qf_ppa; # endif COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname); # else # if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199603)) || \ - OPENBSD_GE_REV(199603) || defined(linux) || FREEBSD_GE_REV(501113) + defined(__FreeBSD_version) COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname); # else ipfl.fl_unit = (u_int)ifp->if_unit; @@ -738,32 +714,9 @@ return EINTR; } # else -# if defined(__hpux) && defined(_KERNEL) - lock_t *l; - -# ifdef IPL_SELECT - if (uio->uio_fpflags & (FNBLOCK|FNDELAY)) { - /* this is no blocking system call */ - softl->ipl_readers[unit]--; - MUTEX_EXIT(&softl->ipl_mutex[unit]); - return 0; - } -# endif - MUTEX_EXIT(&softl->ipl_mutex[unit]); - l = get_sleep_lock(&softl->iplh[unit]); - error = sleep(&softl->iplh[unit], PZERO+1); - spinunlock(l); -# else -# if defined(__osf__) && defined(_KERNEL) - error = mpsleep(&softl->iplh[unit], PSUSP|PCATCH, "ipfread", 0, - &softl->ipl_mutex, MS_LOCK_SIMPLE); -# else - MUTEX_EXIT(&softl->ipl_mutex[unit]); SPL_X(s); error = SLEEP(unit + softl->iplh, "ipl sleep"); -# endif /* __osf__ */ -# endif /* __hpux */ SPL_NET(s); MUTEX_ENTER(&softl->ipl_mutex[unit]); if (error) { @@ -781,8 +734,7 @@ return EIO; } -# if (defined(BSD) && (BSD >= 199101)) || defined(__FreeBSD__) || \ - defined(__osf__) +# if (defined(BSD) && (BSD >= 199101)) || defined(__FreeBSD__) uio->uio_rw = UIO_READ; # endif Index: head/sys/contrib/ipfilter/netinet/ip_lookup.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_lookup.c +++ head/sys/contrib/ipfilter/netinet/ip_lookup.c @@ -10,15 +10,12 @@ # define KERNEL 1 # define _KERNEL 1 #endif -#if defined(__osf__) -# define _PROTO_NET_H_ -#endif #include #include #include #include #include -#if __FreeBSD_version >= 220000 && defined(_KERNEL) +#if defined(__FreeBSD_version) && defined(_KERNEL) # include # include #else @@ -29,9 +26,6 @@ # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #endif @@ -43,7 +37,7 @@ #endif #if defined(_KERNEL) # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif #else Index: head/sys/contrib/ipfilter/netinet/ip_nat.h =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.h +++ head/sys/contrib/ipfilter/netinet/ip_nat.h @@ -14,7 +14,7 @@ #define __IP_NAT_H__ #ifndef SOLARIS -# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# if defined(sun) && defined(__SVR4) # define SOLARIS 1 # else # define SOLARIS 0 @@ -694,9 +694,6 @@ ipftuneable_t *, ipftuneval_t *)); extern nat_t *ipf_nat_icmperrorlookup __P((fr_info_t *, int)); extern nat_t *ipf_nat_icmperror __P((fr_info_t *, u_int *, int)); -#if defined(__OpenBSD__) -extern void ipf_nat_ifdetach __P((void *)); -#endif extern int ipf_nat_init __P((void)); extern nat_t *ipf_nat_inlookup __P((fr_info_t *, u_int, u_int, struct in_addr, struct in_addr)); Index: head/sys/contrib/ipfilter/netinet/ip_nat.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c +++ head/sys/contrib/ipfilter/netinet/ip_nat.c @@ -31,27 +31,22 @@ # include # undef KERNEL #endif -#if defined(_KERNEL) && \ - defined(__FreeBSD_version) && (__FreeBSD_version >= 220000) +#if defined(_KERNEL) && defined(__FreeBSD_version) # include # include #else # include #endif -#if !defined(AIX) # include -#endif -#if !defined(linux) # include -#endif #include #if defined(_KERNEL) # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif #endif -#if defined(__SVR4) || defined(__svr4__) +#if defined(__SVR4) # include # include # ifdef KERNEL @@ -60,11 +55,11 @@ # include # include #endif -#if __FreeBSD_version >= 300000 +#if defined(__FreeBSD_version) # include #endif #include -#if __FreeBSD_version >= 300000 +#if defined(__FreeBSD_version) # include #endif #ifdef sun @@ -80,9 +75,7 @@ extern struct ifnet vpnif; #endif -#if !defined(linux) # include -#endif #include #include #include @@ -97,7 +90,7 @@ #include "netinet/ip_lookup.h" #include "netinet/ip_dstlist.h" #include "netinet/ip_sync.h" -#if FREEBSD_GE_REV(300000) +#if defined(__FreeBSD_version) # include #endif #ifdef HAS_SYS_MD5_H @@ -1024,7 +1017,7 @@ KAUTH_REQ_NETWORK_FIREWALL_FW, NULL, NULL, NULL)) # else -# if defined(__FreeBSD_version) && (__FreeBSD_version >= 500034) +# if defined(__FreeBSD_version) if (securelevel_ge(curthread->td_ucred, 3) && (mode & FWRITE)) # else if ((securelevel >= 3) && (mode & FWRITE)) @@ -1036,11 +1029,7 @@ } #endif -#if defined(__osf__) && defined(_KERNEL) - getlock = 0; -#else getlock = (mode & NAT_LOCKHELD) ? 0 : 1; -#endif n = NULL; nt = NULL; @@ -3302,7 +3291,7 @@ u_32_t sum1, sum2, sumd; frentry_t *fr; u_32_t flags; -#if SOLARIS && defined(_KERNEL) && (SOLARIS2 >= 6) && defined(ICK_M_CTL_MAGIC) +#if SOLARIS && defined(_KERNEL) && defined(ICK_M_CTL_MAGIC) qpktinfo_t *qpi = fin->fin_qpi; #endif @@ -5234,8 +5223,8 @@ uh = (udphdr_t *)(ip + 1); uh->uh_ulen += fin->fin_plen; uh->uh_ulen = htons(uh->uh_ulen); -#if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(linux) || defined(BRIDGE_IPF) || defined(__FreeBSD__) +#if !defined(_KERNEL) || defined(MENTAT) || \ + defined(BRIDGE_IPF) || defined(__FreeBSD__) ipf_fix_outcksum(0, &ip->ip_sum, sumd, 0); #endif @@ -5655,8 +5644,7 @@ } fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; -#if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(__osf__) || defined(linux) +#if !defined(_KERNEL) || defined(MENTAT) ipf_fix_incksum(0, &fin->fin_ip->ip_sum, ipsumd, 0); #endif break; @@ -5688,8 +5676,7 @@ sum2 += ntohs(ip->ip_off) & IP_DF; CALC_SUMD(sum1, sum2, sumd); -#if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(__osf__) || defined(linux) +#if !defined(_KERNEL) || defined(MENTAT) ipf_fix_outcksum(0, &ip->ip_sum, sumd, 0); #endif PREP_MB_T(fin, m); @@ -6208,29 +6195,8 @@ } -#if defined(__OpenBSD__) -/* ------------------------------------------------------------------------ */ -/* Function: ipf_nat_ifdetach */ -/* Returns: Nil */ -/* Parameters: ifp(I) - pointer to network interface */ -/* */ -/* Compatibility interface for OpenBSD to trigger the correct updating of */ -/* interface references within IPFilter. */ -/* ------------------------------------------------------------------------ */ -void -ipf_nat_ifdetach(ifp) - void *ifp; -{ - ipf_main_softc_t *softc; - softc = ipf_get_softc(0); - ipf_sync(ifp); - return; -} -#endif - - /* ------------------------------------------------------------------------ */ /* Function: ipf_nat_rule_deref */ /* Returns: Nil */ @@ -7459,8 +7425,7 @@ CALC_SUMD(sum1, sum2, sumd); fin->fin_ip->ip_dst = nat->nat_osrcip; fin->fin_daddr = nat->nat_osrcaddr; -#if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(__osf__) || defined(linux) +#if !defined(_KERNEL) || defined(MENTAT) ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, sumd, 0); #endif } Index: head/sys/contrib/ipfilter/netinet/ip_nat6.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat6.c +++ head/sys/contrib/ipfilter/netinet/ip_nat6.c @@ -29,26 +29,22 @@ # include # undef _KERNEL #endif -#if defined(_KERNEL) && (__FreeBSD_version >= 220000) +#if defined(_KERNEL) && defined(__FreeBSD_version) # include # include #else # include #endif -#if !defined(AIX) # include -#endif -#if !defined(linux) # include -#endif #include #if defined(_KERNEL) # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif #endif -#if defined(__SVR4) || defined(__svr4__) +#if defined(__SVR4) # include # include # ifdef _KERNEL @@ -57,11 +53,11 @@ # include # include #endif -#if __FreeBSD_version >= 300000 +#if defined(__FreeBSD_version) # include #endif #include -#if __FreeBSD_version >= 300000 +#if defined(__FreeBSD_version) # include #endif #ifdef sun @@ -78,9 +74,7 @@ extern struct ifnet vpnif; #endif -#if !defined(linux) # include -#endif #include #include #include @@ -94,7 +88,7 @@ #include "netinet/ip_lookup.h" #include "netinet/ip_dstlist.h" #include "netinet/ip_sync.h" -#if (__FreeBSD_version >= 300000) +#if defined(__FreeBSD_version) # include #endif #ifdef HAS_SYS_MD5_H @@ -970,7 +964,7 @@ u_int nflags; natinfo_t ni; int move; -#if SOLARIS && defined(_KERNEL) && (SOLARIS2 >= 6) && defined(ICK_M_CTL_MAGIC) +#if SOLARIS && defined(_KERNEL) && defined(ICK_M_CTL_MAGIC) qpktinfo_t *qpi = fin->fin_qpi; #endif Index: head/sys/contrib/ipfilter/netinet/ip_pool.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_pool.c +++ head/sys/contrib/ipfilter/netinet/ip_pool.c @@ -9,9 +9,6 @@ # define KERNEL 1 # define _KERNEL 1 #endif -#if defined(__osf__) -# define _PROTO_NET_H_ -#endif #include #include #include @@ -21,9 +18,6 @@ # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #else @@ -36,7 +30,7 @@ #if defined(_KERNEL) && !defined(SOLARIS2) # include #endif -#if defined(__SVR4) || defined(__svr4__) +#if defined(__SVR4) # include # ifdef _KERNEL # include @@ -44,7 +38,7 @@ # include # include #endif -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000) +#if defined(__FreeBSD_version) # include #endif Index: head/sys/contrib/ipfilter/netinet/ip_proxy.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_proxy.c +++ head/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -16,43 +16,34 @@ #include #include #include -#if !defined(AIX) # include -#endif #if !defined(_KERNEL) && !defined(__KERNEL__) # include # include # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #endif -#if !defined(linux) # include -#endif #include #if defined(_KERNEL) -# if !defined(__NetBSD__) && !defined(sun) && !defined(__osf__) && \ - !defined(__OpenBSD__) && !defined(__hpux) && !defined(__sgi) && \ - !defined(AIX) +#ifdef __FreeBSD_version # include # endif # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif #endif -#if defined(_KERNEL) && (__FreeBSD_version >= 220000) +#if defined(_KERNEL) && defined(__FreeBSD_version) # include # include #else # include #endif -#if defined(__SVR4) || defined(__svr4__) +#if defined(__SVR4) # include # ifdef _KERNEL # include @@ -64,7 +55,7 @@ # include #endif #include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) && defined(_KERNEL) +#if defined(__FreeBSD_version) && defined(_KERNEL) #include #else #define CURVNET_SET(arg) @@ -79,9 +70,7 @@ #include #include #include -#ifndef linux # include -#endif #include #include #include @@ -91,7 +80,7 @@ #include "netinet/ip_nat.h" #include "netinet/ip_state.h" #include "netinet/ip_proxy.h" -#if (__FreeBSD_version >= 300000) +#if defined(__FreeBSD_version) # include #endif @@ -925,7 +914,7 @@ ip_t *ip; short rv; int err; -#if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) +#if !defined(_KERNEL) || defined(MENTAT) u_32_t s1, s2, sd; #endif @@ -1017,7 +1006,7 @@ * packet. */ adjlen = APR_INC(err); -#if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) +#if !defined(_KERNEL) || defined(MENTAT) s1 = LONG_SUM(fin->fin_plen - adjlen); s2 = LONG_SUM(fin->fin_plen); CALC_SUMD(s1, s2, sd); Index: head/sys/contrib/ipfilter/netinet/ip_raudio_pxy.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_raudio_pxy.c +++ head/sys/contrib/ipfilter/netinet/ip_raudio_pxy.c @@ -105,11 +105,7 @@ off = (char *)tcp - (char *)fin->fin_ip; off += (TCP_OFF(tcp) << 2) + fin->fin_ipoff; -#ifdef __sgi - dlen = fin->fin_plen - off; -#else dlen = MSGDSIZE(m) - off; -#endif if (dlen <= 0) return 0; @@ -222,11 +218,7 @@ off = (char *)tcp - (char *)fin->fin_ip; off += (TCP_OFF(tcp) << 2) + fin->fin_ipoff; -#ifdef __sgi - dlen = fin->fin_plen - off; -#else dlen = MSGDSIZE(m) - off; -#endif if (dlen <= 0) return 0; Index: head/sys/contrib/ipfilter/netinet/ip_scan.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_scan.c +++ head/sys/contrib/ipfilter/netinet/ip_scan.c @@ -10,9 +10,6 @@ # define _KERNEL 1 #endif #include -#if defined(__hpux) && (HPUXREV >= 1111) && !defined(_KERNEL) -# include -#endif #include #include #include @@ -20,21 +17,16 @@ # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #else # include -# if !defined(__svr4__) && !defined(__SVR4) +# if !defined(__SVR4) # include # endif #endif #include -#if !defined(__hpux) && !defined(__osf__) && !defined(linux) && !defined(AIX) # include -#endif #ifdef __FreeBSD__ # include # include Index: head/sys/contrib/ipfilter/netinet/ip_state.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_state.c +++ head/sys/contrib/ipfilter/netinet/ip_state.c @@ -20,7 +20,7 @@ #include #include #if defined(_KERNEL) && defined(__FreeBSD_version) && \ - (__FreeBSD_version >= 400000) && !defined(KLD_MODULE) + !defined(KLD_MODULE) #include "opt_inet6.h" #endif #if !defined(_KERNEL) && !defined(__KERNEL__) @@ -28,30 +28,25 @@ # include # include # define _KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL #endif -#if defined(_KERNEL) && (__FreeBSD_version >= 220000) +#if defined(_KERNEL) && defined(__FreeBSD_version) # include # include #else # include #endif #include -#if !defined(linux) # include -#endif #include #if defined(_KERNEL) # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif #endif -#if defined(__SVR4) || defined(__svr4__) +#if defined(__SVR4) # include # include # ifdef _KERNEL @@ -69,9 +64,7 @@ #include #include #include -#if !defined(__hpux) && !defined(linux) # include -#endif #include #include #if !defined(_KERNEL) Index: head/sys/contrib/ipfilter/netinet/ip_sync.c =================================================================== --- head/sys/contrib/ipfilter/netinet/ip_sync.c +++ head/sys/contrib/ipfilter/netinet/ip_sync.c @@ -21,15 +21,12 @@ # include # define _KERNEL # define KERNEL -# ifdef __OpenBSD__ -struct file; -# endif # include # undef _KERNEL # undef KERNEL #else # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif # include @@ -40,18 +37,16 @@ #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) # include #endif -#if defined(_KERNEL) && (__FreeBSD_version >= 220000) +#if defined(_KERNEL) && defined(__FreeBSD_version) # include # include #else # include #endif #include -#if !defined(linux) # include -#endif #include -#if defined(__SVR4) || defined(__svr4__) +#if defined(__SVR4) # include # include # ifdef _KERNEL @@ -69,12 +64,8 @@ #include #include #include -#if !defined(linux) # include -#endif -#if !defined(__hpux) && !defined(linux) # include -#endif #include #include #include "netinet/ip_compat.h" @@ -88,7 +79,7 @@ #ifdef USE_INET6 #include #endif -#if (__FreeBSD_version >= 300000) +#if defined(__FreeBSD_version) # include # if defined(_KERNEL) && !defined(IPFILTER_LKM) # include @@ -112,9 +103,6 @@ #if SOLARIS && defined(_KERNEL) kcondvar_t ipslwait; #endif -#if defined(linux) && defined(_KERNEL) - wait_queue_head_t sl_tail_linux; -#endif synclist_t **syncstatetab; synclist_t **syncnattab; synclogent_t *synclog; @@ -308,7 +296,7 @@ } -# if !defined(sparc) && !defined(__hppa) +# if !defined(sparc) /* ------------------------------------------------------------------------ */ /* Function: ipf_sync_tcporder */ /* Returns: Nil */ @@ -418,11 +406,11 @@ ips->is_smsk[1] = ntohl(ips->is_smsk[1]); } } -# else /* !defined(sparc) && !defined(__hppa) */ +# else /* !defined(sparc) */ # define ipf_sync_tcporder(x,y) # define ipf_sync_natorder(x,y) # define ipf_sync_storder(x,y) -# endif /* !defined(sparc) && !defined(__hppa) */ +# endif /* !defined(sparc) */ /* ------------------------------------------------------------------------ */ @@ -449,7 +437,7 @@ int err = 0; -# if BSD_GE_YEAR(199306) || defined(__FreeBSD__) || defined(__osf__) +# if BSD_GE_YEAR(199306) || defined(__FreeBSD__) uio->uio_rw = UIO_WRITE; # endif @@ -597,7 +585,7 @@ return EINVAL; } -# if BSD_GE_YEAR(199306) || defined(__FreeBSD__) || defined(__osf__) +# if BSD_GE_YEAR(199306) || defined(__FreeBSD__) uio->uio_rw = UIO_READ; # endif @@ -612,28 +600,6 @@ return EINTR; } # else -# ifdef __hpux - { - lock_t *l; - - l = get_sleep_lock(&softs->sl_tail); - err = sleep(&softs->sl_tail, PZERO+1); - if (err) { - MUTEX_EXIT(&softs->ipsl_mutex); - IPFERROR(110010); - return EINTR; - } - spinunlock(l); - } -# else /* __hpux */ -# ifdef __osf__ - err = mpsleep(&softs->sl_tail, PSUSP|PCATCH, "ipl sleep", 0, - &softs->ipsl_mutex, MS_LOCK_SIMPLE); - if (err) { - IPFERROR(110011); - return EINTR; - } -# else MUTEX_EXIT(&softs->ipsl_mutex); err = SLEEP(&softs->sl_tail, "ipl sleep"); if (err) { @@ -641,8 +607,6 @@ return EINTR; } MUTEX_ENTER(&softs->ipsl_mutex); -# endif /* __osf__ */ -# endif /* __hpux */ # endif /* SOLARIS */ # endif /* _KERNEL */ }