Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys remove extra portability #ifdef (like #ifdef __FreeBSD__...
details: https://anonhg.NetBSD.org/src/rev/9e76d162ab75
branches: trunk
changeset: 480196:9e76d162ab75
user: itojun <itojun%NetBSD.org@localhost>
date: Thu Jan 06 15:46:07 2000 +0000
description:
remove extra portability #ifdef (like #ifdef __FreeBSD__) in KAME IPv6/IPsec
code, from netbsd-current repository.
#ifdef'ed version is always available from ftp.kame.net.
XXX please do not make too many diff-unfriendly changes, we'll need to take
bunch of diffs on upgrade...
diffstat:
sys/net/if_faith.c | 34 +----
sys/net/if_gif.c | 32 +----
sys/netinet/udp_usrreq.c | 8 +-
sys/netinet6/TODO | 18 +--
sys/netinet6/frag6.c | 17 +--
sys/netinet6/icmp6.c | 167 +---------------------
sys/netinet6/icmp6.h | 9 +-
sys/netinet6/in6.c | 153 +-------------------
sys/netinet6/in6.h | 53 +-----
sys/netinet6/in6_gif.c | 10 +-
sys/netinet6/in6_ifattach.c | 87 +-----------
sys/netinet6/in6_pcb.c | 27 +---
sys/netinet6/in6_prefix.c | 58 +-------
sys/netinet6/in6_proto.c | 329 +------------------------------------------
sys/netinet6/in6_var.h | 85 +----------
sys/netinet6/ip6.h | 5 +-
sys/netinet6/ip6_forward.c | 22 +--
sys/netinet6/ip6_input.c | 126 +---------------
sys/netinet6/ip6_mroute.c | 172 +----------------------
sys/netinet6/ip6_output.c | 72 +---------
sys/netinet6/ip6_var.h | 36 +----
sys/netinet6/ip6protosw.h | 23 +--
sys/netinet6/ipcomp.h | 4 +-
sys/netinet6/ipcomp_core.c | 4 +-
sys/netinet6/ipcomp_input.c | 8 +-
sys/netinet6/ipcomp_output.c | 6 +-
sys/netinet6/ipsec.c | 239 +------------------------------
sys/netinet6/ipsec.h | 24 +--
sys/netinet6/mld6.c | 34 +----
sys/netinet6/nd6.c | 140 +------------------
sys/netinet6/nd6.h | 7 +-
sys/netinet6/nd6_nbr.c | 60 +-------
sys/netinet6/nd6_rtr.c | 56 +-------
sys/netinet6/pim6_var.h | 4 +-
sys/netinet6/raw_ip6.c | 6 +-
sys/netinet6/udp6.h | 3 +-
sys/netinet6/udp6_usrreq.c | 38 +----
sys/netinet6/udp6_var.h | 34 +----
38 files changed, 82 insertions(+), 2128 deletions(-)
diffs (truncated from 5396 to 300 lines):
diff -r 477618dafb44 -r 9e76d162ab75 sys/net/if_faith.c
--- a/sys/net/if_faith.c Thu Jan 06 12:14:33 2000 +0000
+++ b/sys/net/if_faith.c Thu Jan 06 15:46:07 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_faith.c,v 1.8 1999/12/22 03:58:12 itojun Exp $ */
+/* $NetBSD: if_faith.c,v 1.9 2000/01/06 15:46:07 itojun Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -41,9 +41,7 @@
/*
* Loopback interface driver for protocol testing and timing.
*/
-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__NetBSD__)
#include "opt_inet.h"
-#endif
#include "faith.h"
#if NFAITH > 0
@@ -54,15 +52,9 @@
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/errno.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/sockio.h>
-#else
#include <sys/ioctl.h>
-#endif
#include <sys/time.h>
-#if defined(__bsdi__) || defined(__NetBSD__)
#include <machine/cpu.h>
-#endif
#include <net/if.h>
#include <net/if_types.h>
@@ -89,21 +81,12 @@
#include <net/net_osdep.h>
-#if defined(__FreeBSD__) && __FreeBSD__ < 3
-static int faithioctl __P((struct ifnet *, int, caddr_t));
-#else
static int faithioctl __P((struct ifnet *, u_long, caddr_t));
-#endif
int faithoutput __P((struct ifnet *, register struct mbuf *, struct sockaddr *,
register struct rtentry *));
static void faithrtrequest __P((int, struct rtentry *, struct sockaddr *));
-#ifdef __FreeBSD__
-void faithattach __P((void *));
-PSEUDO_SET(faithattach, if_faith);
-#else
void faithattach __P((int));
-#endif
static struct ifnet faithif[NFAITH];
@@ -112,11 +95,7 @@
/* ARGSUSED */
void
faithattach(faith)
-#ifdef __FreeBSD__
- void *faith;
-#else
int faith;
-#endif
{
register struct ifnet *ifp;
register int i;
@@ -124,12 +103,7 @@
for (i = 0; i < NFAITH; i++) {
ifp = &faithif[i];
bzero(ifp, sizeof(faithif[i]));
-#if defined(__NetBSD__) || defined(__OpenBSD__)
sprintf(ifp->if_xname, "faith%d", i);
-#else
- ifp->if_name = "faith";
- ifp->if_unit = i;
-#endif
ifp->if_mtu = FAITHMTU;
/* Change to BROADCAST experimentaly to announce its prefix. */
ifp->if_flags = /* IFF_LOOPBACK */ IFF_BROADCAST | IFF_MULTICAST;
@@ -262,11 +236,7 @@
static int
faithioctl(ifp, cmd, data)
register struct ifnet *ifp;
-#if defined(__FreeBSD__) && __FreeBSD__ < 3
- int cmd;
-#else
u_long cmd;
-#endif
caddr_t data;
{
register struct ifaddr *ifa;
@@ -307,12 +277,10 @@
break;
#ifdef SIOCSIFMTU
-#ifndef __OpenBSD__
case SIOCSIFMTU:
ifp->if_mtu = ifr->ifr_mtu;
break;
#endif
-#endif
case SIOCSIFFLAGS:
break;
diff -r 477618dafb44 -r 9e76d162ab75 sys/net/if_gif.c
--- a/sys/net/if_gif.c Thu Jan 06 12:14:33 2000 +0000
+++ b/sys/net/if_gif.c Thu Jan 06 15:46:07 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gif.c,v 1.4 1999/12/13 15:17:19 itojun Exp $ */
+/* $NetBSD: if_gif.c,v 1.5 2000/01/06 15:46:08 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -33,25 +33,16 @@
* gif.c
*/
-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__NetBSD__)
#include "opt_inet.h"
-#endif
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include <sys/malloc.h>
-#endif
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/errno.h>
-#if defined(__FreeBSD__) || __FreeBSD__ >= 3
-/*nothing*/
-#else
#include <sys/ioctl.h>
-#endif
#include <sys/time.h>
#include <sys/syslog.h>
#include <machine/cpu.h>
@@ -89,11 +80,7 @@
#if NGIF > 0
-#ifdef __FreeBSD__
-void gifattach __P((void *));
-#else
void gifattach __P((int));
-#endif
/*
* gif global variable definitions
@@ -103,11 +90,7 @@
void
gifattach(dummy)
-#ifdef __FreeBSD__
- void *dummy;
-#else
int dummy;
-#endif
{
register struct gif_softc *sc;
register int i;
@@ -128,10 +111,6 @@
}
}
-#ifdef __FreeBSD__
-PSEUDO_SET(gifattach, if_gif);
-#endif
-
int
gif_output(ifp, m, dst, rt)
struct ifnet *ifp;
@@ -330,7 +309,6 @@
case SIOCADDMULTI:
case SIOCDELMULTI:
-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3)
switch (ifr->ifr_addr.sa_family) {
#ifdef INET
case AF_INET: /* IP supports Multicast */
@@ -344,29 +322,21 @@
error = EAFNOSUPPORT;
break;
}
-#endif /*not FreeBSD3*/
break;
#ifdef SIOCSIFMTU /* xxx */
-#ifndef __OpenBSD__
case SIOCGIFMTU:
break;
case SIOCSIFMTU:
{
-#ifdef __bsdi__
- short mtu;
- mtu = *(short *)ifr->ifr_data;
-#else
u_long mtu;
mtu = ifr->ifr_mtu;
-#endif
if (mtu < GIF_MTU_MIN || mtu > GIF_MTU_MAX) {
return (EINVAL);
}
ifp->if_mtu = mtu;
}
break;
-#endif
#endif /* SIOCSIFMTU */
case SIOCSIFPHYADDR:
diff -r 477618dafb44 -r 9e76d162ab75 sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c Thu Jan 06 12:14:33 2000 +0000
+++ b/sys/netinet/udp_usrreq.c Thu Jan 06 15:46:07 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udp_usrreq.c,v 1.55 2000/01/06 06:41:19 itojun Exp $ */
+/* $NetBSD: udp_usrreq.c,v 1.56 2000/01/06 15:46:08 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -155,6 +155,7 @@
in_pcbinit(&udbtable, udbhashsize, udbhashsize);
}
+#ifndef UDP6
void
#if __STDC__
udp_input(struct mbuf *m, ...)
@@ -873,7 +874,8 @@
}
#endif
-#if 0
+#else /*UDP6*/
+
void
#if __STDC__
udp_input(struct mbuf *m, ...)
@@ -1144,7 +1146,7 @@
if (opts)
m_freem(opts);
}
-#endif
+#endif /*UDP6*/
/*
* Notify a udp user of an asynchronous error;
diff -r 477618dafb44 -r 9e76d162ab75 sys/netinet6/TODO
--- a/sys/netinet6/TODO Thu Jan 06 12:14:33 2000 +0000
+++ b/sys/netinet6/TODO Thu Jan 06 15:46:07 2000 +0000
@@ -1,5 +1,5 @@
KAME/NetBSD integration TODOs
-$NetBSD: TODO,v 1.7 2000/01/05 13:19:36 itojun Exp $
+$NetBSD: TODO,v 1.8 2000/01/06 15:46:08 itojun Exp $
Jun-ichiro itojun Hagino <itojun%itojun.org@localhost>
@@ -39,20 +39,6 @@
Current kernel code implement separate port number spaces, since it uses
separate inpcb/in6pcb.
-* udp4/6 wildcard bind
-
-Mapped address is now supported well. We may want a way to disable it
-(setsockopt) as mapped address is just to ease transition.
-
-setsockopt and sysctl are now being tested.
-
-* tcp4/6 wildcard bind
-
-Mapped address is now supported well. We may want a way to disable it
-(setsockopt) as mapped address is just to ease transition.
-
-setsockopt and sysctl are now being tested.
-
* net/if_types.h
IFT_GIF and IFT_FAITH are not defined in IANA assignment, but we need to
@@ -143,7 +129,7 @@
and should never be used from standard userland applications.
(see 1.3 in sys/netinet6/IMPLEMENTATION)
-We start hiding it by using NI_WITHSCOPEID.
+We start hiding it by using getnameinfo(NI_WITHSCOPEID).
* more IPv6 support
diff -r 477618dafb44 -r 9e76d162ab75 sys/netinet6/frag6.c
--- a/sys/netinet6/frag6.c Thu Jan 06 12:14:33 2000 +0000
+++ b/sys/netinet6/frag6.c Thu Jan 06 15:46:07 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: frag6.c,v 1.7 1999/12/13 15:17:21 itojun Exp $ */
+/* $NetBSD: frag6.c,v 1.8 2000/01/06 15:46:08 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Home |
Main Index |
Thread Index |
Old Index