xref: /freebsd/sys/netinet6/ip6_mroute.h (revision 18b35df8fe3aac88b341734d5a7db059b15a6074)
1686cdd19SJun-ichiro itojun Hagino /*	$FreeBSD$	*/
288ff5695SSUZUKI Shinsuke /*	$KAME: ip6_mroute.h,v 1.19 2001/06/14 06:12:55 suz Exp $	*/
391ec0a1eSYoshinobu Inoue 
4caf43b02SWarner Losh /*-
591ec0a1eSYoshinobu Inoue  * Copyright (C) 1998 WIDE Project.
691ec0a1eSYoshinobu Inoue  * All rights reserved.
791ec0a1eSYoshinobu Inoue  *
891ec0a1eSYoshinobu Inoue  * Redistribution and use in source and binary forms, with or without
991ec0a1eSYoshinobu Inoue  * modification, are permitted provided that the following conditions
1091ec0a1eSYoshinobu Inoue  * are met:
1191ec0a1eSYoshinobu Inoue  * 1. Redistributions of source code must retain the above copyright
1291ec0a1eSYoshinobu Inoue  *    notice, this list of conditions and the following disclaimer.
1391ec0a1eSYoshinobu Inoue  * 2. Redistributions in binary form must reproduce the above copyright
1491ec0a1eSYoshinobu Inoue  *    notice, this list of conditions and the following disclaimer in the
1591ec0a1eSYoshinobu Inoue  *    documentation and/or other materials provided with the distribution.
1691ec0a1eSYoshinobu Inoue  * 3. Neither the name of the project nor the names of its contributors
1791ec0a1eSYoshinobu Inoue  *    may be used to endorse or promote products derived from this software
1891ec0a1eSYoshinobu Inoue  *    without specific prior written permission.
1991ec0a1eSYoshinobu Inoue  *
2091ec0a1eSYoshinobu Inoue  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
2191ec0a1eSYoshinobu Inoue  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2291ec0a1eSYoshinobu Inoue  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2391ec0a1eSYoshinobu Inoue  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2491ec0a1eSYoshinobu Inoue  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2591ec0a1eSYoshinobu Inoue  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2691ec0a1eSYoshinobu Inoue  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2791ec0a1eSYoshinobu Inoue  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2891ec0a1eSYoshinobu Inoue  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2991ec0a1eSYoshinobu Inoue  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3091ec0a1eSYoshinobu Inoue  * SUCH DAMAGE.
3191ec0a1eSYoshinobu Inoue  */
3291ec0a1eSYoshinobu Inoue 
3391ec0a1eSYoshinobu Inoue /*	BSDI ip_mroute.h,v 2.5 1996/10/11 16:01:48 pjd Exp	*/
3491ec0a1eSYoshinobu Inoue 
3591ec0a1eSYoshinobu Inoue /*
3691ec0a1eSYoshinobu Inoue  * Definitions for IP multicast forwarding.
3791ec0a1eSYoshinobu Inoue  *
3891ec0a1eSYoshinobu Inoue  * Written by David Waitzman, BBN Labs, August 1988.
3991ec0a1eSYoshinobu Inoue  * Modified by Steve Deering, Stanford, February 1989.
4091ec0a1eSYoshinobu Inoue  * Modified by Ajit Thyagarajan, PARC, August 1993.
4191ec0a1eSYoshinobu Inoue  * Modified by Ajit Thyagarajan, PARC, August 1994.
4291ec0a1eSYoshinobu Inoue  * Modified by Ahmed Helmy, USC, September 1996.
4391ec0a1eSYoshinobu Inoue  *
4491ec0a1eSYoshinobu Inoue  * MROUTING Revision: 1.2
4591ec0a1eSYoshinobu Inoue  */
4691ec0a1eSYoshinobu Inoue 
4791ec0a1eSYoshinobu Inoue #ifndef _NETINET6_IP6_MROUTE_H_
4891ec0a1eSYoshinobu Inoue #define _NETINET6_IP6_MROUTE_H_
4991ec0a1eSYoshinobu Inoue 
5091ec0a1eSYoshinobu Inoue /*
5191ec0a1eSYoshinobu Inoue  * Multicast Routing set/getsockopt commands.
5291ec0a1eSYoshinobu Inoue  */
53686cdd19SJun-ichiro itojun Hagino #ifdef _KERNEL
54686cdd19SJun-ichiro itojun Hagino #define MRT6_OINIT		100	/* initialize forwarder (omrt6msg) */
55686cdd19SJun-ichiro itojun Hagino #endif
5691ec0a1eSYoshinobu Inoue #define MRT6_DONE		101	/* shut down forwarder */
5791ec0a1eSYoshinobu Inoue #define MRT6_ADD_MIF		102	/* add multicast interface */
5891ec0a1eSYoshinobu Inoue #define MRT6_DEL_MIF		103	/* delete multicast interface */
5991ec0a1eSYoshinobu Inoue #define MRT6_ADD_MFC		104	/* insert forwarding cache entry */
6091ec0a1eSYoshinobu Inoue #define MRT6_DEL_MFC		105	/* delete forwarding cache entry */
6191ec0a1eSYoshinobu Inoue #define MRT6_PIM                107     /* enable pim code */
62686cdd19SJun-ichiro itojun Hagino #define MRT6_INIT		108	/* initialize forwarder (mrt6msg) */
6391ec0a1eSYoshinobu Inoue 
6491ec0a1eSYoshinobu Inoue #if BSD >= 199103
6591ec0a1eSYoshinobu Inoue #define GET_TIME(t)	microtime(&t)
6691ec0a1eSYoshinobu Inoue #elif defined(sun)
6791ec0a1eSYoshinobu Inoue #define GET_TIME(t)	uniqtime(&t)
6891ec0a1eSYoshinobu Inoue #else
6991ec0a1eSYoshinobu Inoue #define GET_TIME(t)	((t) = time)
7091ec0a1eSYoshinobu Inoue #endif
7191ec0a1eSYoshinobu Inoue 
7291ec0a1eSYoshinobu Inoue /*
7391ec0a1eSYoshinobu Inoue  * Types and macros for handling bitmaps with one bit per multicast interface.
7491ec0a1eSYoshinobu Inoue  */
7591ec0a1eSYoshinobu Inoue typedef u_short mifi_t;		/* type of a mif index */
7691ec0a1eSYoshinobu Inoue #define MAXMIFS		64
7791ec0a1eSYoshinobu Inoue 
7891ec0a1eSYoshinobu Inoue #ifndef	IF_SETSIZE
7991ec0a1eSYoshinobu Inoue #define	IF_SETSIZE	256
8091ec0a1eSYoshinobu Inoue #endif
8191ec0a1eSYoshinobu Inoue 
8233841545SHajimu UMEMOTO typedef	u_int32_t	if_mask;
8391ec0a1eSYoshinobu Inoue #define	NIFBITS	(sizeof(if_mask) * NBBY)	/* bits per mask */
8491ec0a1eSYoshinobu Inoue 
8591ec0a1eSYoshinobu Inoue #ifndef howmany
8691ec0a1eSYoshinobu Inoue #define	howmany(x, y)	(((x) + ((y) - 1)) / (y))
8791ec0a1eSYoshinobu Inoue #endif
8891ec0a1eSYoshinobu Inoue 
8991ec0a1eSYoshinobu Inoue typedef	struct if_set {
9033841545SHajimu UMEMOTO 	if_mask	ifs_bits[howmany(IF_SETSIZE, NIFBITS)];
9191ec0a1eSYoshinobu Inoue } if_set;
9291ec0a1eSYoshinobu Inoue 
9391ec0a1eSYoshinobu Inoue #define	IF_SET(n, p)	((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
9491ec0a1eSYoshinobu Inoue #define	IF_CLR(n, p)	((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
9591ec0a1eSYoshinobu Inoue #define	IF_ISSET(n, p)	((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
9691ec0a1eSYoshinobu Inoue #define	IF_COPY(f, t)	bcopy(f, t, sizeof(*(f)))
9791ec0a1eSYoshinobu Inoue #define	IF_ZERO(p)	bzero(p, sizeof(*(p)))
9891ec0a1eSYoshinobu Inoue 
9991ec0a1eSYoshinobu Inoue /*
10091ec0a1eSYoshinobu Inoue  * Argument structure for MRT6_ADD_IF.
10191ec0a1eSYoshinobu Inoue  */
10291ec0a1eSYoshinobu Inoue struct mif6ctl {
10391ec0a1eSYoshinobu Inoue 	mifi_t	    mif6c_mifi;	    	/* the index of the mif to be added  */
10491ec0a1eSYoshinobu Inoue 	u_char	    mif6c_flags;     	/* MIFF_ flags defined below         */
10591ec0a1eSYoshinobu Inoue 	u_short	    mif6c_pifi;		/* the index of the physical IF */
10691ec0a1eSYoshinobu Inoue #ifdef notyet
10791ec0a1eSYoshinobu Inoue 	u_int	    mif6c_rate_limit;    /* max rate           		     */
10891ec0a1eSYoshinobu Inoue #endif
10991ec0a1eSYoshinobu Inoue };
11091ec0a1eSYoshinobu Inoue 
11191ec0a1eSYoshinobu Inoue #define	MIFF_REGISTER	0x1	/* mif represents a register end-point */
11291ec0a1eSYoshinobu Inoue 
11391ec0a1eSYoshinobu Inoue /*
11491ec0a1eSYoshinobu Inoue  * Argument structure for MRT6_ADD_MFC and MRT6_DEL_MFC
11591ec0a1eSYoshinobu Inoue  */
11691ec0a1eSYoshinobu Inoue struct mf6cctl {
11791ec0a1eSYoshinobu Inoue 	struct sockaddr_in6 mf6cc_origin;	/* IPv6 origin of mcasts */
11891ec0a1eSYoshinobu Inoue 	struct sockaddr_in6 mf6cc_mcastgrp; /* multicast group associated */
11991ec0a1eSYoshinobu Inoue 	mifi_t		mf6cc_parent;	/* incoming ifindex */
12091ec0a1eSYoshinobu Inoue 	struct if_set	mf6cc_ifset;	/* set of forwarding ifs */
12191ec0a1eSYoshinobu Inoue };
12291ec0a1eSYoshinobu Inoue 
12391ec0a1eSYoshinobu Inoue /*
12491ec0a1eSYoshinobu Inoue  * The kernel's multicast routing statistics.
12591ec0a1eSYoshinobu Inoue  */
12691ec0a1eSYoshinobu Inoue struct mrt6stat {
12791ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_mfc_lookups;	/* # forw. cache hash table hits   */
12891ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_mfc_misses;	/* # forw. cache hash table misses */
12991ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_upcalls;		/* # calls to mrouted              */
13091ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_no_route;	/* no route for packet's origin    */
13191ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_bad_tunnel;	/* malformed tunnel options        */
13291ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_cant_tunnel;	/* no room for tunnel options      */
13391ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_wrong_if;	/* arrived on wrong interface	   */
13491ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_upq_ovflw;	/* upcall Q overflow		   */
13591ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_cache_cleanups;	/* # entries with no upcalls 	   */
13691ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_drop_sel;     	/* pkts dropped selectively        */
13791ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_q_overflow;    	/* pkts dropped - Q overflow       */
13891ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_pkt2large;     	/* pkts dropped - size > BKT SIZE  */
13991ec0a1eSYoshinobu Inoue 	u_quad_t mrt6s_upq_sockfull;	/* upcalls dropped - socket full   */
14091ec0a1eSYoshinobu Inoue };
14191ec0a1eSYoshinobu Inoue 
142686cdd19SJun-ichiro itojun Hagino #ifdef MRT6_OINIT
14391ec0a1eSYoshinobu Inoue /*
14491ec0a1eSYoshinobu Inoue  * Struct used to communicate from kernel to multicast router
14591ec0a1eSYoshinobu Inoue  * note the convenient similarity to an IPv6 header.
146686cdd19SJun-ichiro itojun Hagino  * XXX old version, superseded by mrt6msg.
14791ec0a1eSYoshinobu Inoue  */
148686cdd19SJun-ichiro itojun Hagino struct omrt6msg {
14991ec0a1eSYoshinobu Inoue 	u_long	    unused1;
15091ec0a1eSYoshinobu Inoue 	u_char	    im6_msgtype;		/* what type of message	    */
151686cdd19SJun-ichiro itojun Hagino #if 0
152686cdd19SJun-ichiro itojun Hagino #define MRT6MSG_NOCACHE	1
153686cdd19SJun-ichiro itojun Hagino #define MRT6MSG_WRONGMIF	2
154686cdd19SJun-ichiro itojun Hagino #define MRT6MSG_WHOLEPKT	3		/* used for user level encap*/
155686cdd19SJun-ichiro itojun Hagino #endif
156686cdd19SJun-ichiro itojun Hagino 	u_char	    im6_mbz;			/* must be zero		    */
157686cdd19SJun-ichiro itojun Hagino 	u_char	    im6_mif;			/* mif rec'd on		    */
158686cdd19SJun-ichiro itojun Hagino 	u_char	    unused2;
159686cdd19SJun-ichiro itojun Hagino 	struct in6_addr  im6_src, im6_dst;
160686cdd19SJun-ichiro itojun Hagino };
161686cdd19SJun-ichiro itojun Hagino #endif
162686cdd19SJun-ichiro itojun Hagino 
163686cdd19SJun-ichiro itojun Hagino /*
164686cdd19SJun-ichiro itojun Hagino  * Structure used to communicate from kernel to multicast router.
165686cdd19SJun-ichiro itojun Hagino  * We'll overlay the structure onto an MLD header (not an IPv6 header
166686cdd19SJun-ichiro itojun Hagino  * like igmpmsg{} used for IPv4 implementation). This is because this
167686cdd19SJun-ichiro itojun Hagino  * structure will be passed via an IPv6 raw socket, on which an application
168686cdd19SJun-ichiro itojun Hagino  * will only receive the payload i.e. the data after the IPv6 header and all
16918b35df8SHajimu UMEMOTO  * the extension headers. (see Section 3 of RFC3542)
170686cdd19SJun-ichiro itojun Hagino  */
171686cdd19SJun-ichiro itojun Hagino struct mrt6msg {
17291ec0a1eSYoshinobu Inoue #define MRT6MSG_NOCACHE		1
17391ec0a1eSYoshinobu Inoue #define MRT6MSG_WRONGMIF	2
17491ec0a1eSYoshinobu Inoue #define MRT6MSG_WHOLEPKT	3		/* used for user level encap*/
17591ec0a1eSYoshinobu Inoue 	u_char	    im6_mbz;			/* must be zero		    */
176686cdd19SJun-ichiro itojun Hagino 	u_char	    im6_msgtype;		/* what type of message	    */
177686cdd19SJun-ichiro itojun Hagino 	u_int16_t   im6_mif;			/* mif rec'd on		    */
178686cdd19SJun-ichiro itojun Hagino 	u_int32_t   im6_pad;			/* padding for 64bit arch   */
17991ec0a1eSYoshinobu Inoue 	struct in6_addr  im6_src, im6_dst;
18091ec0a1eSYoshinobu Inoue };
18191ec0a1eSYoshinobu Inoue 
18291ec0a1eSYoshinobu Inoue /*
18391ec0a1eSYoshinobu Inoue  * Argument structure used by multicast routing daemon to get src-grp
18491ec0a1eSYoshinobu Inoue  * packet counts
18591ec0a1eSYoshinobu Inoue  */
18691ec0a1eSYoshinobu Inoue struct sioc_sg_req6 {
18791ec0a1eSYoshinobu Inoue 	struct sockaddr_in6 src;
18891ec0a1eSYoshinobu Inoue 	struct sockaddr_in6 grp;
18991ec0a1eSYoshinobu Inoue 	u_quad_t pktcnt;
19091ec0a1eSYoshinobu Inoue 	u_quad_t bytecnt;
19191ec0a1eSYoshinobu Inoue 	u_quad_t wrong_if;
19291ec0a1eSYoshinobu Inoue };
19391ec0a1eSYoshinobu Inoue 
19491ec0a1eSYoshinobu Inoue /*
19591ec0a1eSYoshinobu Inoue  * Argument structure used by mrouted to get mif pkt counts
19691ec0a1eSYoshinobu Inoue  */
19791ec0a1eSYoshinobu Inoue struct sioc_mif_req6 {
19891ec0a1eSYoshinobu Inoue 	mifi_t mifi;		/* mif number				*/
19991ec0a1eSYoshinobu Inoue 	u_quad_t icount;	/* Input packet count on mif		*/
20091ec0a1eSYoshinobu Inoue 	u_quad_t ocount;	/* Output packet count on mif		*/
20191ec0a1eSYoshinobu Inoue 	u_quad_t ibytes;	/* Input byte count on mif		*/
20291ec0a1eSYoshinobu Inoue 	u_quad_t obytes;	/* Output byte count on mif		*/
20391ec0a1eSYoshinobu Inoue };
20491ec0a1eSYoshinobu Inoue 
20591ec0a1eSYoshinobu Inoue #if defined(_KERNEL) || defined(KERNEL)
20691ec0a1eSYoshinobu Inoue /*
20791ec0a1eSYoshinobu Inoue  * The kernel's multicast-interface structure.
20891ec0a1eSYoshinobu Inoue  */
20991ec0a1eSYoshinobu Inoue struct mif6 {
21091ec0a1eSYoshinobu Inoue         u_char   	m6_flags;     	/* MIFF_ flags defined above         */
21191ec0a1eSYoshinobu Inoue 	u_int      	m6_rate_limit; 	/* max rate			     */
21291ec0a1eSYoshinobu Inoue #ifdef notyet
21391ec0a1eSYoshinobu Inoue 	struct tbf      *m6_tbf;      	/* token bucket structure at intf.   */
21491ec0a1eSYoshinobu Inoue #endif
21591ec0a1eSYoshinobu Inoue 	struct in6_addr	m6_lcl_addr;   	/* local interface address           */
21691ec0a1eSYoshinobu Inoue 	struct ifnet    *m6_ifp;     	/* pointer to interface              */
21791ec0a1eSYoshinobu Inoue 	u_quad_t	m6_pkt_in;	/* # pkts in on interface            */
21891ec0a1eSYoshinobu Inoue 	u_quad_t	m6_pkt_out;	/* # pkts out on interface           */
21991ec0a1eSYoshinobu Inoue 	u_quad_t	m6_bytes_in;	/* # bytes in on interface	     */
22091ec0a1eSYoshinobu Inoue 	u_quad_t	m6_bytes_out;	/* # bytes out on interface	     */
22191ec0a1eSYoshinobu Inoue 	struct route_in6 m6_route;/* cached route if this is a tunnel */
22291ec0a1eSYoshinobu Inoue #ifdef notyet
22391ec0a1eSYoshinobu Inoue 	u_int		m6_rsvp_on;	/* RSVP listening on this vif */
22491ec0a1eSYoshinobu Inoue 	struct socket   *m6_rsvpd;	/* RSVP daemon socket */
22591ec0a1eSYoshinobu Inoue #endif
22691ec0a1eSYoshinobu Inoue };
22791ec0a1eSYoshinobu Inoue 
22891ec0a1eSYoshinobu Inoue /*
22991ec0a1eSYoshinobu Inoue  * The kernel's multicast forwarding cache entry structure
23091ec0a1eSYoshinobu Inoue  */
23191ec0a1eSYoshinobu Inoue struct mf6c {
23291ec0a1eSYoshinobu Inoue 	struct sockaddr_in6  mf6c_origin;	/* IPv6 origin of mcasts     */
23391ec0a1eSYoshinobu Inoue 	struct sockaddr_in6  mf6c_mcastgrp;	/* multicast group associated*/
23491ec0a1eSYoshinobu Inoue 	mifi_t	    	 mf6c_parent; 		/* incoming IF               */
23591ec0a1eSYoshinobu Inoue 	struct if_set	 mf6c_ifset;		/* set of outgoing IFs */
23691ec0a1eSYoshinobu Inoue 
23791ec0a1eSYoshinobu Inoue 	u_quad_t    	mf6c_pkt_cnt;		/* pkt count for src-grp     */
23891ec0a1eSYoshinobu Inoue 	u_quad_t    	mf6c_byte_cnt;		/* byte count for src-grp    */
23991ec0a1eSYoshinobu Inoue 	u_quad_t    	mf6c_wrong_if;		/* wrong if for src-grp	     */
24091ec0a1eSYoshinobu Inoue 	int	    	mf6c_expire;		/* time to clean entry up    */
24191ec0a1eSYoshinobu Inoue 	struct timeval  mf6c_last_assert;	/* last time I sent an assert*/
24291ec0a1eSYoshinobu Inoue 	struct rtdetq  *mf6c_stall;		/* pkts waiting for route */
24391ec0a1eSYoshinobu Inoue 	struct mf6c    *mf6c_next;		/* hash table linkage */
24491ec0a1eSYoshinobu Inoue };
24591ec0a1eSYoshinobu Inoue 
24691ec0a1eSYoshinobu Inoue #define MF6C_INCOMPLETE_PARENT ((mifi_t)-1)
24791ec0a1eSYoshinobu Inoue 
24891ec0a1eSYoshinobu Inoue /*
24991ec0a1eSYoshinobu Inoue  * Argument structure used for pkt info. while upcall is made
25091ec0a1eSYoshinobu Inoue  */
25191ec0a1eSYoshinobu Inoue #ifndef _NETINET_IP_MROUTE_H_
25291ec0a1eSYoshinobu Inoue struct rtdetq {		/* XXX: rtdetq is also defined in ip_mroute.h */
25391ec0a1eSYoshinobu Inoue     struct mbuf 	*m;		/* A copy of the packet	    	    */
25491ec0a1eSYoshinobu Inoue     struct ifnet	*ifp;		/* Interface pkt came in on 	    */
25591ec0a1eSYoshinobu Inoue #ifdef UPCALL_TIMING
25691ec0a1eSYoshinobu Inoue     struct timeval	t;		/* Timestamp */
25791ec0a1eSYoshinobu Inoue #endif /* UPCALL_TIMING */
25891ec0a1eSYoshinobu Inoue     struct rtdetq	*next;
25991ec0a1eSYoshinobu Inoue };
26091ec0a1eSYoshinobu Inoue #endif /* _NETINET_IP_MROUTE_H_ */
26191ec0a1eSYoshinobu Inoue 
26291ec0a1eSYoshinobu Inoue #define MF6CTBLSIZ	256
26391ec0a1eSYoshinobu Inoue #if (MF6CTBLSIZ & (MF6CTBLSIZ - 1)) == 0	  /* from sys:route.h */
26491ec0a1eSYoshinobu Inoue #define MF6CHASHMOD(h)	((h) & (MF6CTBLSIZ - 1))
26591ec0a1eSYoshinobu Inoue #else
26691ec0a1eSYoshinobu Inoue #define MF6CHASHMOD(h)	((h) % MF6CTBLSIZ)
26791ec0a1eSYoshinobu Inoue #endif
26891ec0a1eSYoshinobu Inoue 
26991ec0a1eSYoshinobu Inoue #define MAX_UPQ6	4		/* max. no of pkts in upcall Q */
27091ec0a1eSYoshinobu Inoue 
27191ec0a1eSYoshinobu Inoue int	ip6_mrouter_set __P((struct socket *so, struct sockopt *sopt));
27291ec0a1eSYoshinobu Inoue int	ip6_mrouter_get __P((struct socket *so, struct sockopt *sopt));
27391ec0a1eSYoshinobu Inoue int	ip6_mrouter_done __P((void));
27491ec0a1eSYoshinobu Inoue int	mrt6_ioctl __P((int, caddr_t));
27591ec0a1eSYoshinobu Inoue #endif /* _KERNEL */
27691ec0a1eSYoshinobu Inoue 
27791ec0a1eSYoshinobu Inoue #endif /* !_NETINET6_IP6_MROUTE_H_ */
278