Permalink
Browse files

Compilable on darwin with mip6 configuration

  • Loading branch information...
1 parent 01e56da commit a9fe4a5b2eaf5f8c5ec79a1bf594744f7de32e2a t-momose committed Jul 17, 2005
@@ -1,4 +1,4 @@
-/* $Id: if_mip.c,v 1.4 2005/04/14 06:22:38 suz Exp $ */
+/* $KAME: if_mip.c,v 1.5 2005/07/17 20:40:45 t-momose Exp $ */
/*
* Copyright (C) 2004 WIDE Project.
@@ -1,4 +1,4 @@
-/* $ID: $ */
+/* $KAME: if_mip.h,v 1.2 2005/07/17 20:40:45 t-momose Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1,4 +1,4 @@
-/* $KAME: net_osdep.c,v 1.15 2005/04/14 06:22:38 suz Exp $ */
+/* $KAME: net_osdep.c,v 1.16 2005/07/17 20:40:45 t-momose Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -41,17 +41,23 @@
#endif
#include <sys/time.h>
#include <sys/syslog.h>
+#ifdef __APPLE__
+#include <kern/cpu_number.h>
+#else
#include <machine/cpu.h>
+#endif
#include <net/if.h>
#include <net/if_types.h>
+#ifndef __APPLE__
#include <net/netisr.h>
+#endif
#include <net/route.h>
#include <net/bpf.h>
#include <net/net_osdep.h>
-#if 0
+#ifdef __APPLE__
const char *
if_name(ifp)
struct ifnet *ifp;
@@ -96,7 +102,7 @@ ppsratecheck(lasttime, curpps, maxpps)
int s, rv;
s = splclock();
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__APPLE__)
tv = mono_time;
#else
microtime(&tv);
@@ -1,4 +1,4 @@
-/* $KAME: net_osdep.h,v 1.85 2004/05/20 08:15:53 suz Exp $ */
+/* $KAME: net_osdep.h,v 1.86 2005/07/17 20:40:45 t-momose Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -260,6 +260,9 @@
* NetBSD 1.5: always use IFAREF whenever reference gets added.
* always use IFAFREE whenever reference gets freed.
* IFAFREE frees ifaddr when ifa_refcnt reaches 0.
+ * Darwin: always use ifaref whenever reference gets added.
+ * always use ifafree whenever reference gets freed.
+ * ifaref and ifafree are responsible for determining when to free.
* others: do not increase refcnt for ifp->if_addrlist and in_ifaddr.
* use IFAFREE once when ifaddr is disconnected from
* ifp->if_addrlist and in_ifaddr. IFAFREE frees ifaddr when
@@ -321,7 +324,7 @@
#define if_name(ifp) ((ifp)->if_xname)
#else
struct ifnet;
-extern const char *if_name __P((struct ifnet *));
+extern const char *if_name(struct ifnet *);
#endif
#if defined(__FreeBSD__) || defined(__NetBSD__)
@@ -330,8 +333,11 @@ extern const char *if_name __P((struct ifnet *));
#if defined(__FreeBSD__) && __FreeBSD_version < 500000
#define HAVE_NEW_BPF
#endif
+#ifdef __APPLE__
+#define HAVE_OLD_BPF
+#endif
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__APPLE__)
#define ifa_list ifa_link
#define if_addrlist if_addrhead
#define if_list if_link
@@ -1,4 +1,4 @@
-/* $KAME: dest6.c,v 1.72 2005/06/16 18:29:26 jinmei Exp $ */
+/* $KAME: dest6.c,v 1.73 2005/07/17 20:40:46 t-momose Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -79,9 +79,15 @@ static void mip6_notify_be_hint(struct in6_addr *, struct in6_addr *,
* Destination options header processing.
*/
int
+#ifndef __APPLE__
dest6_input(mp, offp, proto)
struct mbuf **mp;
int *offp, proto;
+#else
+dest6_input(mp, offp)
+ struct mbuf **mp;
+ int *offp;
+#endif
{
struct mbuf *m = *mp;
int off = *offp, dstoptlen, optlen;
@@ -190,7 +196,11 @@ dest6_input(mp, offp, proto)
#endif /* MIP6 */
default: /* unknown option */
optlen = ip6_unknown_opt(opt, m,
- opt - mtod(m, u_int8_t *));
+ opt - mtod(m, u_int8_t *)
+#ifdef __APPLE__
+ ,0
+#endif
+ );
if (optlen == -1)
return (IPPROTO_DONE);
optlen += 2;
Oops, something went wrong. Retry.

0 comments on commit a9fe4a5

Please sign in to comment.