summaryrefslogtreecommitdiff
path: root/sys/net/if_faith.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-07 19:31:30 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-07 19:31:30 +0000
commitbb42efb1f861f2ac4fbe4745ad83569276ac56cc (patch)
tree4da2476c06054f38439a926ec849ed694a92cef6 /sys/net/if_faith.c
parent6e26578d238bd2535eea0dbcc585e9feed9be11f (diff)
ifdef cleanup
Diffstat (limited to 'sys/net/if_faith.c')
-rw-r--r--sys/net/if_faith.c50
1 files changed, 1 insertions, 49 deletions
diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c
index baadb22e398..360cfc3d58c 100644
--- a/sys/net/if_faith.c
+++ b/sys/net/if_faith.c
@@ -39,11 +39,8 @@
/*
* Loopback interface driver for protocol testing and timing.
*/
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
-#include "opt_inet.h"
-#endif
-
#include "faith.h"
+
#if NFAITH > 0
#include <sys/param.h>
@@ -52,15 +49,8 @@
#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>
-#ifdef __bsdi__
-#include <machine/cpu.h>
-#endif
#include <net/if.h>
#include <net/if_types.h>
@@ -87,21 +77,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];
@@ -110,11 +91,7 @@ static struct ifnet faithif[NFAITH];
/* ARGSUSED */
void
faithattach(faith)
-#ifdef __FreeBSD__
- void *faith;
-#else
int faith;
-#endif
{
register struct ifnet *ifp;
register int i;
@@ -122,12 +99,7 @@ faithattach(faith)
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;
@@ -138,12 +110,8 @@ faithattach(faith)
ifp->if_addrlen = 0;
if_attach(ifp);
#if NBPFILTER > 0
-#ifdef HAVE_OLD_BPF
- bpfattach(ifp, DLT_NULL, sizeof(u_int));
-#else
bpfattach(&ifp->if_bpf, ifp, DLT_NULL, sizeof(u_int));
#endif
-#endif
}
}
@@ -183,11 +151,7 @@ faithoutput(ifp, m, dst, rt)
m0.m_len = 4;
m0.m_data = (char *)&af;
-#ifdef HAVE_OLD_BPF
- bpf_mtap(ifp, &m0);
-#else
bpf_mtap(ifp->if_bpf, &m0);
-#endif
}
#endif
@@ -260,11 +224,7 @@ faithrtrequest(cmd, rt, sa)
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;
@@ -304,14 +264,6 @@ faithioctl(ifp, cmd, data)
}
break;
-#ifdef SIOCSIFMTU
-#ifndef __OpenBSD__
- case SIOCSIFMTU:
- ifp->if_mtu = ifr->ifr_mtu;
- break;
-#endif
-#endif
-
case SIOCSIFFLAGS:
break;