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 2009 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#ifdef	__cplusplus
31extern "C" {
32#endif
33
34#if defined(_KERNEL)
35
36#define	INFINITY	0xffffffffU
37/*
38 * Enum used to pass ilg status to ip_addmulti() and friends. There
39 * are three possibilities: the group is being joined from within ip,
40 * in which case there is no associated ilg; the group is being joined
41 * from an upper layer with an associated ilg that's been newly created
42 * by this join; or the upper layer is changing its group membership
43 * state (the ilg existed before this call).
44 */
45typedef enum {
46	ILGSTAT_NONE,
47	ILGSTAT_NEW,
48	ILGSTAT_CHANGE
49} ilg_stat_t;
50
51/*
52 * Extern functions
53 */
54extern	mblk_t		*igmp_input(mblk_t *, ip_recv_attr_t *);
55extern	void		igmp_joingroup(ilm_t *);
56extern	void		igmp_leavegroup(ilm_t *);
57extern	void		igmp_slowtimo(void *);
58extern	void		igmp_timeout_handler(void *);
59extern	void		igmp_statechange(ilm_t *, mcast_record_t, slist_t *);
60
61extern	void		mld_joingroup(ilm_t *);
62extern	void		mld_leavegroup(ilm_t *);
63extern	void		mld_statechange(ilm_t *, mcast_record_t, slist_t *);
64extern	void		mld_slowtimo(void *);
65
66extern	void		ilg_delete_all(conn_t *connp);
67extern	boolean_t	conn_hasmembers_ill_withsrc_v4(conn_t *, ipaddr_t,
68    ipaddr_t, ill_t *);
69extern	boolean_t	conn_hasmembers_ill_withsrc_v6(conn_t *,
70    const in6_addr_t *, const in6_addr_t *, ill_t *);
71
72extern void		ill_leave_multicast(ill_t *);
73extern void		ill_recover_multicast(ill_t *);
74extern void		ip_dlur_to_mhi(ill_t *, mblk_t *,
75    struct mac_header_info_s *);
76
77/* These make up the data path interface used by ip_output and ip_input */
78extern boolean_t	ill_hasmembers_v4(ill_t *, ipaddr_t);
79extern boolean_t	ill_hasmembers_v6(ill_t *, const in6_addr_t *);
80extern boolean_t	ill_hasmembers_otherzones_v4(ill_t *, ipaddr_t,
81    zoneid_t);
82extern boolean_t	ill_hasmembers_otherzones_v6(ill_t *,
83    const in6_addr_t *, zoneid_t);
84extern zoneid_t		ill_hasmembers_nextzone_v4(ill_t *, ipaddr_t, zoneid_t);
85extern zoneid_t		ill_hasmembers_nextzone_v6(ill_t *, const in6_addr_t *,
86    zoneid_t);
87
88extern	ilm_t		*ip_addmulti(const in6_addr_t *, ill_t *, zoneid_t,
89    int *);
90extern	int		ip_delmulti(ilm_t *);
91extern	int		ip_mforward(mblk_t *, ip_recv_attr_t *);
92extern	void		ip_mroute_decap(mblk_t *, ip_recv_attr_t *);
93extern	int		ill_join_allmulti(ill_t *);
94extern	void		ill_leave_allmulti(ill_t *);
95extern	int		ip_join_allmulti(uint_t, boolean_t, ip_stack_t *);
96extern	int		ip_leave_allmulti(uint_t, boolean_t, ip_stack_t *);
97extern	void		ip_purge_allmulti(ill_t *);
98extern	int		ip_mroute_mrt(mblk_t *, ip_stack_t *);
99extern	int		ip_mroute_stats(mblk_t *, ip_stack_t *);
100extern	int		ip_mroute_vif(mblk_t *, ip_stack_t *);
101extern	int		ip_mrouter_done(ip_stack_t *);
102extern	int		ip_mrouter_get(int, conn_t *, uchar_t *);
103extern	int		ip_mrouter_set(int, conn_t *, int, uchar_t *, int);
104extern	void		ip_mrouter_stack_init(ip_stack_t *);
105extern	void		ip_mrouter_stack_destroy(ip_stack_t *);
106
107extern	int		ip_opt_add_group(conn_t *, boolean_t,
108    const in6_addr_t *, ipaddr_t, uint_t, mcast_record_t, const in6_addr_t *);
109extern	int		ip_opt_delete_group(conn_t *, boolean_t,
110    const in6_addr_t *, ipaddr_t, uint_t, mcast_record_t, const in6_addr_t *);
111
112extern  int		mrt_ioctl(ipif_t *, sin_t *, queue_t *, mblk_t *,
113    ip_ioctl_cmd_t *, void *);
114extern	int		ip_sioctl_msfilter(ipif_t *, sin_t *, queue_t *,
115    mblk_t *, ip_ioctl_cmd_t *, void *);
116extern	int		ip_copyin_msfilter(queue_t *, mblk_t *);
117
118extern	mblk_t		*pim_input(mblk_t *, ip_recv_attr_t *);
119extern	void		update_conn_ill(ill_t *, ip_stack_t *);
120extern	void		reset_mrt_ill(ill_t *);
121extern	void		reset_mrt_vif_ipif(ipif_t *);
122extern	void		igmp_start_timers(unsigned, ip_stack_t *);
123extern	void		mld_start_timers(unsigned, ip_stack_t *);
124extern	void		ilm_inactive(ilm_t *);
125
126#endif /* _KERNEL */
127
128#ifdef	__cplusplus
129}
130#endif
131
132#endif	/* _INET_IP_MULTI_H */
133