ip_multi.h revision 3448:aaf16568054b
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25/* Copyright (c) 1990 Mentat Inc. */
26
27#ifndef	_INET_IP_MULTI_H
28#define	_INET_IP_MULTI_H
29
30#pragma ident	"%Z%%M%	%I%	%E% SMI"
31
32#ifdef	__cplusplus
33extern "C" {
34#endif
35
36#if defined(_KERNEL)
37
38#define	INFINITY	0xffffffffU
39/*
40 * Enum used to pass ilg status to ip_addmulti() and friends. There
41 * are three possibilities: the group is being joined from within ip,
42 * in which case there is no associated ilg; the group is being joined
43 * from an upper layer with an associated ilg that's been newly created
44 * by this join; or the upper layer is changing its group membership
45 * state (the ilg existed before this call).
46 */
47typedef enum {
48	ILGSTAT_NONE,
49	ILGSTAT_NEW,
50	ILGSTAT_CHANGE
51} ilg_stat_t;
52
53/*
54 * Extern functions
55 */
56extern	mblk_t		*igmp_input(queue_t *, mblk_t *, ill_t *);
57extern	void		igmp_joingroup(ilm_t *);
58extern	void		igmp_leavegroup(ilm_t *);
59extern	void		igmp_slowtimo(void *);
60extern	void		igmp_timeout_handler(void *);
61extern	void		igmp_timeout_start(int);
62extern	void		igmp_statechange(ilm_t *, mcast_record_t, slist_t *);
63
64extern	void		mld_joingroup(ilm_t *);
65extern	void		mld_leavegroup(ilm_t *);
66extern	void		mld_statechange(ilm_t *, mcast_record_t, slist_t *);
67extern	void		mld_slowtimo(void *);
68
69extern	void		ilg_delete_all(conn_t *connp);
70extern	ilg_t		*ilg_lookup_ill_v6(conn_t *, const in6_addr_t *,
71    ill_t *);
72extern	ilg_t		*ilg_lookup_ill_withsrc(conn_t *, ipaddr_t, ipaddr_t,
73    ill_t *);
74extern	ilg_t		*ilg_lookup_ill_withsrc_v6(conn_t *, const in6_addr_t *,
75    const in6_addr_t *, ill_t *);
76
77extern void		ill_leave_multicast(ill_t *);
78extern void		ill_recover_multicast(ill_t *);
79
80extern	void		ilm_free(ipif_t *);
81extern	ilm_t		*ilm_lookup_ill_withsrc(ill_t *, ipaddr_t, ipaddr_t);
82extern	ilm_t		*ilm_lookup_ill_withsrc_v6(ill_t *, const in6_addr_t *,
83    const in6_addr_t *);
84extern	ilm_t		*ilm_lookup_ill(ill_t *, ipaddr_t, zoneid_t);
85extern	ilm_t		*ilm_lookup_ill_v6(ill_t *, const in6_addr_t *,
86    zoneid_t);
87extern	ilm_t		*ilm_lookup_ill_index_v6(ill_t *, const in6_addr_t *,
88    int, zoneid_t);
89extern	ilm_t		*ilm_lookup_ipif(ipif_t *, ipaddr_t);
90
91extern int		ilm_numentries_v6(ill_t *, const in6_addr_t *);
92extern int		ilm_walk_ipif(ipif_t *);
93extern int		ilm_walk_ill(ill_t *);
94extern void		ilm_walker_cleanup(ill_t *);
95extern int		ip_ll_send_disabmulti_req(ill_t *, const in6_addr_t *);
96extern int		ip_ll_send_enabmulti_req(ill_t *, const in6_addr_t *);
97
98extern	int		ip_addmulti(ipaddr_t, ipif_t *, ilg_stat_t,
99    mcast_record_t, slist_t *);
100extern	int		ip_addmulti_v6(const in6_addr_t *, ill_t *, int,
101    zoneid_t, ilg_stat_t, mcast_record_t, slist_t *);
102extern	int		ip_delmulti(ipaddr_t, ipif_t *, boolean_t, boolean_t);
103extern	int		ip_delmulti_v6(const in6_addr_t *, ill_t *, int,
104    zoneid_t, boolean_t, boolean_t);
105extern	int		ip_join_allmulti(ipif_t *);
106extern	int		ip_leave_allmulti(ipif_t *);
107extern	void		ip_multicast_loopback(queue_t *, ill_t *, mblk_t *,
108    int, zoneid_t);
109extern	int		ip_mforward(ill_t *, ipha_t *, mblk_t *);
110extern	void		ip_mroute_decap(queue_t *, mblk_t *, ill_t *);
111extern	int		ip_mroute_mrt(mblk_t *, ip_stack_t *);
112extern	int		ip_mroute_stats(mblk_t *, ip_stack_t *);
113extern	int		ip_mroute_vif(mblk_t *, ip_stack_t *);
114extern	int		ip_mrouter_done(mblk_t *, ip_stack_t *);
115extern	int		ip_mrouter_get(int, queue_t *, uchar_t *);
116extern	int		ip_mrouter_set(int, queue_t *, int, uchar_t *, int,
117    mblk_t *);
118extern	void		ip_mrouter_stack_init(ip_stack_t *);
119extern	void		ip_mrouter_stack_destroy(ip_stack_t *);
120
121extern	int		ip_opt_add_group(conn_t *, boolean_t, ipaddr_t,
122    ipaddr_t, uint_t *, mcast_record_t, ipaddr_t, mblk_t *first_mp);
123extern	int		ip_opt_delete_group(conn_t *, boolean_t, ipaddr_t,
124    ipaddr_t, uint_t *, mcast_record_t, ipaddr_t, mblk_t *first_mp);
125extern	int		ip_opt_add_group_v6(conn_t *, boolean_t,
126    const in6_addr_t *, int, mcast_record_t, const in6_addr_t *, mblk_t *);
127extern	int		ip_opt_delete_group_v6(conn_t *, boolean_t,
128    const in6_addr_t *, int, mcast_record_t, const in6_addr_t *, mblk_t *);
129
130extern	int		ip_sioctl_msfilter(ipif_t *, sin_t *, queue_t *,
131    mblk_t *, ip_ioctl_cmd_t *, void *);
132extern	int		ip_extract_msfilter(queue_t *, mblk_t *, ipif_t **,
133    ipsq_func_t);
134extern	int		ip_copyin_msfilter(queue_t *, mblk_t *);
135
136extern	void		ip_wput_ctl(queue_t *, mblk_t *);
137
138extern  int	mrt_ioctl(ipif_t *ipif, sin_t *sin, queue_t *q, mblk_t *mp,
139    ip_ioctl_cmd_t *ipip, void *if_req);
140
141extern	int		pim_input(queue_t *, mblk_t *, ill_t *);
142extern	void		reset_conn_ipif(ipif_t *);
143extern	void		reset_conn_ill(ill_t *);
144extern	void		reset_mrt_ill(ill_t *);
145extern	void		reset_mrt_vif_ipif(ipif_t *);
146extern	void		igmp_start_timers(unsigned, ip_stack_t *);
147extern	void		mld_start_timers(unsigned, ip_stack_t *);
148/*
149 * Extern variables
150 */
151
152#endif /* _KERNEL */
153
154#ifdef	__cplusplus
155}
156#endif
157
158#endif	/* _INET_IP_MULTI_H */
159