summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchuck <chuck@cvs.openbsd.org>1996-07-03 17:14:33 +0000
committerchuck <chuck@cvs.openbsd.org>1996-07-03 17:14:33 +0000
commit0c859f504513a3d9f87f265f576a9ab81cadcb10 (patch)
treec4e2053ff38ce80755ec4dbf47342139ed790203
parent2681bf68f3d8d1eef2238bfbf51b16fd9cafe660 (diff)
ported to FreeBSD 2.2-960612-SNAP.
-rw-r--r--sys/net/if_atm.h14
-rw-r--r--sys/net/if_atmsubr.c23
-rw-r--r--sys/netinet/if_atm.c4
-rw-r--r--sys/netinet/if_atm.h8
4 files changed, 38 insertions, 11 deletions
diff --git a/sys/net/if_atm.h b/sys/net/if_atm.h
index 5620bc89b3e..a30fe506749 100644
--- a/sys/net/if_atm.h
+++ b/sys/net/if_atm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atm.h,v 1.6 1996/06/29 20:05:41 chuck Exp $ */
+/* $OpenBSD: if_atm.h,v 1.7 1996/07/03 17:14:30 chuck Exp $ */
/*
*
@@ -36,6 +36,18 @@
* net/if_atm.h
*/
+#if (defined(__FreeBSD__) || defined(__bsdi__)) && defined(KERNEL)
+#ifndef _KERNEL
+#define _KERNEL
+#endif
+#endif /* freebsd doesn't define _KERNEL */
+
+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
+#define RTALLOC1(A,B) rtalloc1((A),(B))
+#elif defined(__FreeBSD__)
+#define RTALLOC1(A,B) rtalloc1((A),(B),0UL)
+#endif
+
/*
* pseudo header for packet transmission
*/
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index e45189c2b0f..19547e7fd06 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atmsubr.c,v 1.5 1996/06/29 20:05:41 chuck Exp $ */
+/* $OpenBSD: if_atmsubr.c,v 1.6 1996/07/03 17:14:30 chuck Exp $ */
/*
*
@@ -57,6 +57,7 @@
#include <net/if_atm.h>
#include <netinet/in.h>
+#include <netinet/if_atm.h>
#include <netinet/if_ether.h> /* XXX: for ETHERTYPE_* */
#ifdef INET
#include <netinet/in_var.h>
@@ -107,7 +108,7 @@ atm_output(ifp, m0, dst, rt0)
if ((rt = rt0) != NULL) {
if ((rt->rt_flags & RTF_UP) == 0) { /* route went down! */
- if ((rt0 = rt = rtalloc1(dst, 0)) != NULL)
+ if ((rt0 = rt = RTALLOC1(dst, 0)) != NULL)
rt->rt_refcnt--;
else
senderr(EHOSTUNREACH);
@@ -118,7 +119,7 @@ atm_output(ifp, m0, dst, rt0)
goto lookup;
if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {
rtfree(rt); rt = rt0;
- lookup: rt->rt_gwroute = rtalloc1(rt->rt_gateway, 0);
+ lookup: rt->rt_gwroute = RTALLOC1(rt->rt_gateway, 0);
if ((rt = rt->rt_gwroute) == 0)
senderr(EHOSTUNREACH);
}
@@ -147,8 +148,13 @@ atm_output(ifp, m0, dst, rt0)
#endif
default:
+#if defined(__NetBSD__) || defined(__OpenBSD__)
printf("%s: can't handle af%d\n", ifp->if_xname,
dst->sa_family);
+#elif defined(__FreeBSD__) || defined(__bsdi__)
+ printf("%s%d: can't handle af%d\n", ifp->if_name,
+ ifp->if_unit, dst->sa_family);
+#endif
senderr(EAFNOSUPPORT);
}
@@ -242,8 +248,13 @@ atm_input(ifp, ah, m, rxhand)
return; /* failed */
alc = mtod(m, struct atmllc *);
if (bcmp(alc, ATMLLC_HDR, 6)) {
+#if defined(__NetBSD__) || defined(__OpenBSD__)
printf("%s: recv'd invalid LLC/SNAP frame [vp=%d,vc=%d]\n",
ifp->if_xname, ATM_PH_VPI(ah), ATM_PH_VCI(ah));
+#elif defined(__FreeBSD__) || defined(__bsdi__)
+ printf("%s%d: recv'd invalid LLC/SNAP frame [vp=%d,vc=%d]\n",
+ ifp->if_name, ifp->if_unit, ATM_PH_VPI(ah), ATM_PH_VCI(ah));
+#endif
m_freem(m);
return;
}
@@ -288,8 +299,14 @@ atm_ifattach(ifp)
ifp->if_hdrlen = 0;
ifp->if_mtu = ATMMTU;
ifp->if_output = atm_output;
+
+#if defined(__NetBSD__) || defined(__OpenBSD__)
for (ifa = ifp->if_addrlist.tqh_first; ifa != 0;
ifa = ifa->ifa_list.tqe_next)
+#elif defined(__FreeBSD__) || defined(__bsdi__)
+ for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
+#endif
+
if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
sdl->sdl_family == AF_LINK) {
sdl->sdl_type = IFT_ATM;
diff --git a/sys/netinet/if_atm.c b/sys/netinet/if_atm.c
index 6d4b3799e14..262bf60e6ca 100644
--- a/sys/netinet/if_atm.c
+++ b/sys/netinet/if_atm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atm.c,v 1.4 1996/06/29 20:05:42 chuck Exp $ */
+/* $OpenBSD: if_atm.c,v 1.5 1996/07/03 17:14:31 chuck Exp $ */
/*
*
@@ -237,7 +237,7 @@ register struct atm_pseudohdr *desten; /* OUT */
}
if (rt == NULL) {
- rt = rtalloc1(dst, 0);
+ rt = RTALLOC1(dst, 0);
if (rt == NULL) goto bad; /* failed */
rt->rt_refcnt--; /* don't keep LL references */
if ((rt->rt_flags & RTF_GATEWAY) != 0 ||
diff --git a/sys/netinet/if_atm.h b/sys/netinet/if_atm.h
index cff90566db4..d725e44b098 100644
--- a/sys/netinet/if_atm.h
+++ b/sys/netinet/if_atm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atm.h,v 1.2 1996/06/21 21:35:20 chuck Exp $ */
+/* $OpenBSD: if_atm.h,v 1.3 1996/07/03 17:14:32 chuck Exp $ */
/*
*
@@ -15,8 +15,8 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by Charles D. Cranor and
- * Washington University.
+ * This product includes software developed by Charles D. Cranor and
+ * Washington University.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
@@ -36,8 +36,6 @@
* if_atm.h
*/
-#ifdef _KERNEL
void atm_rtrequest __P((int, struct rtentry *, struct sockaddr *));
int atmresolve __P((struct rtentry *, struct mbuf *, struct sockaddr *,
struct atm_pseudohdr *));
-#endif /* _KERNEL */