ip_multi.h revision 2843:06f7d1be1c23
1276789Sdim/*
2276789Sdim * CDDL HEADER START
3276789Sdim *
4276789Sdim * The contents of this file are subject to the terms of the
5276789Sdim * Common Development and Distribution License (the "License").
6276789Sdim * You may not use this file except in compliance with the License.
7276789Sdim *
8276789Sdim * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9276789Sdim * or http://www.opensolaris.org/os/licensing.
10276789Sdim * See the License for the specific language governing permissions
11276789Sdim * and limitations under the License.
12276789Sdim *
13276789Sdim * When distributing Covered Code, include this CDDL HEADER in each
14288943Sdim * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15288943Sdim * If applicable, add the following below this CDDL HEADER, with the
16280031Sdim * fields enclosed by brackets "[]" replaced with your own identifying
17276789Sdim * information: Portions Copyright [yyyy] [name of copyright owner]
18276789Sdim *
19276789Sdim * CDDL HEADER END
20276789Sdim */
21276789Sdim/*
22276789Sdim * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23276789Sdim * Use is subject to license terms.
24276789Sdim */
25276789Sdim/* Copyright (c) 1990 Mentat Inc. */
26288943Sdim
27288943Sdim#ifndef	_INET_IP_MULTI_H
28288943Sdim#define	_INET_IP_MULTI_H
29288943Sdim
30288943Sdim#pragma ident	"%Z%%M%	%I%	%E% SMI"
31288943Sdim
32276789Sdim#ifdef	__cplusplus
33288943Sdimextern "C" {
34280031Sdim#endif
35288943Sdim
36288943Sdim#if defined(_KERNEL)
37288943Sdim
38288943Sdim#define	INFINITY	0xffffffffU
39288943Sdim
40288943Sdimextern	uint_t igmp_deferred_next;
41288943Sdimextern	uint_t mld_deferred_next;
42280031Sdimextern	kmutex_t igmp_slowtimeout_lock;
43288943Sdimextern	kmutex_t mld_slowtimeout_lock;
44288943Sdim
45276789Sdim/*
46276789Sdim * Enum used to pass ilg status to ip_addmulti() and friends. There
47288943Sdim * are three possibilities: the group is being joined from within ip,
48288943Sdim * in which case there is no associated ilg; the group is being joined
49288943Sdim * from an upper layer with an associated ilg that's been newly created
50288943Sdim * by this join; or the upper layer is changing its group membership
51288943Sdim * state (the ilg existed before this call).
52276789Sdim */
53288943Sdimtypedef enum {
54288943Sdim	ILGSTAT_NONE,
55288943Sdim	ILGSTAT_NEW,
56288943Sdim	ILGSTAT_CHANGE
57288943Sdim} ilg_stat_t;
58288943Sdim
59288943Sdim/*
60288943Sdim * Extern functions
61288943Sdim */
62288943Sdimextern	mblk_t		*igmp_input(queue_t *, mblk_t *, ill_t *);
63288943Sdimextern	void		igmp_joingroup(ilm_t *);
64288943Sdimextern	void		igmp_leavegroup(ilm_t *);
65288943Sdimextern	void		igmp_slowtimo(void *);
66288943Sdimextern	void		igmp_timeout_handler(void *);
67288943Sdimextern	void		igmp_timeout_start(int);
68288943Sdimextern	void		igmp_statechange(ilm_t *, mcast_record_t, slist_t *);
69288943Sdim
70288943Sdimextern	void		mld_joingroup(ilm_t *);
71288943Sdimextern	void		mld_leavegroup(ilm_t *);
72288943Sdimextern	void		mld_statechange(ilm_t *, mcast_record_t, slist_t *);
73288943Sdimextern	void		mld_slowtimo(void *);
74288943Sdim
75288943Sdimextern	void		ilg_delete_all(conn_t *connp);
76288943Sdimextern	ilg_t		*ilg_lookup_ill_v6(conn_t *, const in6_addr_t *,
77288943Sdim    ill_t *);
78288943Sdimextern	ilg_t		*ilg_lookup_ill_withsrc(conn_t *, ipaddr_t, ipaddr_t,
79    ill_t *);
80extern	ilg_t		*ilg_lookup_ill_withsrc_v6(conn_t *, const in6_addr_t *,
81    const in6_addr_t *, ill_t *);
82
83extern void		ill_leave_multicast(ill_t *);
84extern void		ill_recover_multicast(ill_t *);
85
86extern	void		ilm_free(ipif_t *);
87extern	ilm_t		*ilm_lookup_ill_withsrc(ill_t *, ipaddr_t, ipaddr_t);
88extern	ilm_t		*ilm_lookup_ill_withsrc_v6(ill_t *, const in6_addr_t *,
89    const in6_addr_t *);
90extern	ilm_t		*ilm_lookup_ill(ill_t *, ipaddr_t, zoneid_t);
91extern	ilm_t		*ilm_lookup_ill_v6(ill_t *, const in6_addr_t *,
92    zoneid_t);
93extern	ilm_t		*ilm_lookup_ill_index_v6(ill_t *, const in6_addr_t *,
94    int, zoneid_t);
95extern	ilm_t		*ilm_lookup_ipif(ipif_t *, ipaddr_t);
96
97extern int		ilm_numentries_v6(ill_t *, const in6_addr_t *);
98extern int		ilm_walk_ipif(ipif_t *);
99extern int		ilm_walk_ill(ill_t *);
100extern void		ilm_walker_cleanup(ill_t *);
101extern int		ip_ll_send_disabmulti_req(ill_t *, const in6_addr_t *);
102extern int		ip_ll_send_enabmulti_req(ill_t *, const in6_addr_t *);
103
104extern	int		ip_addmulti(ipaddr_t, ipif_t *, ilg_stat_t,
105    mcast_record_t, slist_t *);
106extern	int		ip_addmulti_v6(const in6_addr_t *, ill_t *, int,
107    zoneid_t, ilg_stat_t, mcast_record_t, slist_t *);
108extern	int		ip_delmulti(ipaddr_t, ipif_t *, boolean_t, boolean_t);
109extern	int		ip_delmulti_v6(const in6_addr_t *, ill_t *, int,
110    zoneid_t, boolean_t, boolean_t);
111extern	int		ip_join_allmulti(ipif_t *);
112extern	int		ip_leave_allmulti(ipif_t *);
113extern	void		ip_multicast_loopback(queue_t *, ill_t *, mblk_t *,
114    int, zoneid_t);
115extern	int		ip_mforward(ill_t *, ipha_t *, mblk_t *);
116extern	void		ip_mroute_decap(queue_t *, mblk_t *);
117extern	int		ip_mroute_mrt(mblk_t *);
118extern	int		ip_mroute_stats(mblk_t *);
119extern	int		ip_mroute_vif(mblk_t *);
120extern	int		ip_mrouter_done(mblk_t *);
121extern	int		ip_mrouter_get(int, queue_t *, uchar_t *);
122extern	int		ip_mrouter_set(int, queue_t *, int, uchar_t *, int,
123    mblk_t *);
124
125
126extern	int		ip_opt_add_group(conn_t *, boolean_t, ipaddr_t,
127    ipaddr_t, uint_t *, mcast_record_t, ipaddr_t, mblk_t *first_mp);
128extern	int		ip_opt_delete_group(conn_t *, boolean_t, ipaddr_t,
129    ipaddr_t, uint_t *, mcast_record_t, ipaddr_t, mblk_t *first_mp);
130extern	int		ip_opt_add_group_v6(conn_t *, boolean_t,
131    const in6_addr_t *, int, mcast_record_t, const in6_addr_t *, mblk_t *);
132extern	int		ip_opt_delete_group_v6(conn_t *, boolean_t,
133    const in6_addr_t *, int, mcast_record_t, const in6_addr_t *, mblk_t *);
134
135extern	int		ip_sioctl_msfilter(ipif_t *, sin_t *, queue_t *,
136    mblk_t *, ip_ioctl_cmd_t *, void *);
137extern	int		ip_extract_msfilter(queue_t *, mblk_t *, ipif_t **,
138    ipsq_func_t);
139extern	int		ip_copyin_msfilter(queue_t *, mblk_t *);
140
141extern	void		ip_wput_ctl(queue_t *, mblk_t *);
142
143extern  int	mrt_ioctl(ipif_t *ipif, sin_t *sin, queue_t *q, mblk_t *mp,
144    ip_ioctl_cmd_t *ipip, void *if_req);
145
146extern	int		pim_input(queue_t *, mblk_t *);
147extern	void		reset_conn_ipif(ipif_t *);
148extern	void		reset_conn_ill(ill_t *);
149extern	void		reset_mrt_ill(ill_t *);
150extern	void		reset_mrt_vif_ipif(ipif_t *);
151extern	void		igmp_start_timers(unsigned);
152extern	void		mld_start_timers(unsigned);
153/*
154 * Extern variables
155 */
156extern  queue_t *ip_g_mrouter;
157
158#endif /* _KERNEL */
159
160#ifdef	__cplusplus
161}
162#endif
163
164#endif	/* _INET_IP_MULTI_H */
165