+/*
+ * Copyright (c) 2008 Apple Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+
/* $FreeBSD: src/sys/netinet6/ip6_mroute.h,v 1.2.2.2 2001/07/03 11:01:53 ume Exp $ */
/* $KAME: ip6_mroute.h,v 1.17 2001/02/10 02:05:52 itojun Exp $ */
/*
* Multicast Routing set/getsockopt commands.
*/
-#ifdef KERNEL
+#ifdef KERNEL_PRIVATE
#define MRT6_OINIT 100 /* initialize forwarder (omrt6msg) */
#endif
#define MRT6_DONE 101 /* shut down forwarder */
#define MRT6_PIM 107 /* enable pim code */
#define MRT6_INIT 108 /* initialize forwarder (mrt6msg) */
-#if BSD >= 199103
-#define GET_TIME(t) microtime(&t)
-#elif defined(sun)
-#define GET_TIME(t) uniqtime(&t)
-#else
-#define GET_TIME(t) ((t) = time)
+#ifdef __APPLE__
+#define GET_TIME(t) getmicrotime(&t)
#endif
/*
#define NIFBITS (sizeof(if_mask) * NBBY) /* bits per mask */
#ifndef howmany
-#define howmany(x, y) (((x) + ((y) - 1)) / (y))
+#define howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1))
#endif
typedef struct if_set {
u_quad_t mrt6s_upq_sockfull; /* upcalls dropped - socket full */
};
+#ifdef KERNEL_PRIVATE
#if MRT6_OINIT
/*
* Struct used to communicate from kernel to multicast router
* XXX old version, superseded by mrt6msg.
*/
struct omrt6msg {
- u_long unused1;
+ u_int32_t unused1;
u_char im6_msgtype; /* what type of message */
#if 0
#define MRT6MSG_NOCACHE 1
struct in6_addr im6_src, im6_dst;
};
#endif
+#endif /* KERNEL_PRIVATE */
/*
* Structure used to communicate from kernel to multicast router.
u_quad_t obytes; /* Output byte count on mif */
};
-#ifdef KERNEL
-#ifdef __APPLE_API_PRIVATE
+#if defined(KERNEL_PRIVATE)
+struct sioc_mif_req6_32 {
+ mifi_t mifi;
+ u_quad_t icount;
+ u_quad_t ocount;
+ u_quad_t ibytes;
+ u_quad_t obytes;
+} __attribute__((aligned(4), packed));
+
+struct sioc_mif_req6_64 {
+ mifi_t mifi;
+ u_quad_t icount __attribute__((aligned(8)));
+ u_quad_t ocount;
+ u_quad_t ibytes;
+ u_quad_t obytes;
+} __attribute__((aligned(8)));
+#endif /* KERNEL_PRIVATE */
+
+#ifdef PRIVATE
/*
* The kernel's multicast-interface structure.
*/
#define MF6C_INCOMPLETE_PARENT ((mifi_t)-1)
+#define MF6CTBLSIZ 256
+#if (MF6CTBLSIZ & (MF6CTBLSIZ - 1)) == 0 /* from sys:route.h */
+#define MF6CHASHMOD(h) ((h) & (MF6CTBLSIZ - 1))
+#else
+#define MF6CHASHMOD(h) ((h) % MF6CTBLSIZ)
+#endif
+
+#define MAX_UPQ6 4 /* max. no of pkts in upcall Q */
+
/*
* Argument structure used for pkt info. while upcall is made
*/
};
#endif /* _NETINET_IP_MROUTE_H_ */
-#define MF6CTBLSIZ 256
-#if (MF6CTBLSIZ & (MF6CTBLSIZ - 1)) == 0 /* from sys:route.h */
-#define MF6CHASHMOD(h) ((h) & (MF6CTBLSIZ - 1))
-#else
-#define MF6CHASHMOD(h) ((h) % MF6CTBLSIZ)
-#endif
-
-#define MAX_UPQ6 4 /* max. no of pkts in upcall Q */
+#if MROUTING
+#ifdef KERNEL_PRIVATE
+extern struct mrt6stat mrt6stat;
-int ip6_mrouter_set __P((struct socket *so, struct sockopt *sopt));
-int ip6_mrouter_get __P((struct socket *so, struct sockopt *sopt));
-int ip6_mrouter_done __P((void));
-int mrt6_ioctl __P((int, caddr_t));
-#endif /* __APPLE_API_PRIVATE */
-#endif /* KERNEL */
+extern int ip6_mrouter_set(struct socket *, struct sockopt *);
+extern int ip6_mrouter_get(struct socket *, struct sockopt *);
+extern int ip6_mrouter_done(void);
+extern int mrt6_ioctl(u_long, caddr_t);
+#endif /* KERNEL_PRIVATE */
+#endif /* PRIVATE */
+#endif
#endif /* !_NETINET6_IP6_MROUTE_H_ */