ip_multi.h revision 4972:b6da5df14183
133965Sjdp/*
289857Sobrien * CDDL HEADER START
333965Sjdp *
433965Sjdp * The contents of this file are subject to the terms of the
533965Sjdp * Common Development and Distribution License (the "License").
633965Sjdp * You may not use this file except in compliance with the License.
733965Sjdp *
833965Sjdp * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
933965Sjdp * or http://www.opensolaris.org/os/licensing.
1033965Sjdp * See the License for the specific language governing permissions
1133965Sjdp * and limitations under the License.
1233965Sjdp *
1333965Sjdp * When distributing Covered Code, include this CDDL HEADER in each
1433965Sjdp * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1533965Sjdp * If applicable, add the following below this CDDL HEADER, with the
1633965Sjdp * fields enclosed by brackets "[]" replaced with your own identifying
1733965Sjdp * information: Portions Copyright [yyyy] [name of copyright owner]
1833965Sjdp *
1933965Sjdp * CDDL HEADER END
2089857Sobrien */
2133965Sjdp/*
2233965Sjdp * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23104834Sobrien * Use is subject to license terms.
2433965Sjdp */
25104834Sobrien/* Copyright (c) 1990 Mentat Inc. */
26104834Sobrien
27104834Sobrien#ifndef	_INET_IP_MULTI_H
28104834Sobrien#define	_INET_IP_MULTI_H
29104834Sobrien
30104834Sobrien#pragma ident	"%Z%%M%	%I%	%E% SMI"
31104834Sobrien
32104834Sobrien#ifdef	__cplusplus
33104834Sobrienextern "C" {
34104834Sobrien#endif
35104834Sobrien
36104834Sobrien#if defined(_KERNEL)
37104834Sobrien
38104834Sobrien#define	INFINITY	0xffffffffU
39104834Sobrien/*
40104834Sobrien * Enum used to pass ilg status to ip_addmulti() and friends. There
41104834Sobrien * are three possibilities: the group is being joined from within ip,
42104834Sobrien * in which case there is no associated ilg; the group is being joined
43104834Sobrien * from an upper layer with an associated ilg that's been newly created
44104834Sobrien * by this join; or the upper layer is changing its group membership
45104834Sobrien * state (the ilg existed before this call).
46104834Sobrien */
47104834Sobrientypedef enum {
48104834Sobrien	ILGSTAT_NONE,
49104834Sobrien	ILGSTAT_NEW,
50104834Sobrien	ILGSTAT_CHANGE
51104834Sobrien} ilg_stat_t;
52104834Sobrien
53104834Sobrien/*
54104834Sobrien * Extern functions
55104834Sobrien */
56104834Sobrienextern	mblk_t		*igmp_input(queue_t *, mblk_t *, ill_t *);
57104834Sobrienextern	void		igmp_joingroup(ilm_t *);
5889857Sobrienextern	void		igmp_leavegroup(ilm_t *);
5989857Sobrienextern	void		igmp_slowtimo(void *);
6089857Sobrienextern	void		igmp_timeout_handler(void *);
6189857Sobrienextern	void		igmp_statechange(ilm_t *, mcast_record_t, slist_t *);
6289857Sobrien
6389857Sobrienextern	void		mld_joingroup(ilm_t *);
6433965Sjdpextern	void		mld_leavegroup(ilm_t *);
6589857Sobrienextern	void		mld_statechange(ilm_t *, mcast_record_t, slist_t *);
6689857Sobrienextern	void		mld_slowtimo(void *);
6789857Sobrien
6889857Sobrienextern	void		ilg_delete_all(conn_t *connp);
6989857Sobrienextern	ilg_t		*ilg_lookup_ill_v6(conn_t *, const in6_addr_t *,
7089857Sobrien    ill_t *);
7189857Sobrienextern	ilg_t		*ilg_lookup_ill_withsrc(conn_t *, ipaddr_t, ipaddr_t,
7289857Sobrien    ill_t *);
7389857Sobrienextern	ilg_t		*ilg_lookup_ill_withsrc_v6(conn_t *, const in6_addr_t *,
7489857Sobrien    const in6_addr_t *, ill_t *);
7589857Sobrien
7689857Sobrienextern void		ill_leave_multicast(ill_t *);
7789857Sobrienextern void		ill_recover_multicast(ill_t *);
7889857Sobrien
7989857Sobrienextern	void		ilm_free(ipif_t *);
8089857Sobrienextern	ilm_t		*ilm_lookup_ill(ill_t *, ipaddr_t, zoneid_t);
8189857Sobrienextern	ilm_t		*ilm_lookup_ill_v6(ill_t *, const in6_addr_t *,
8289857Sobrien    zoneid_t);
8389857Sobrienextern	ilm_t		*ilm_lookup_ill_index_v6(ill_t *, const in6_addr_t *,
8489857Sobrien    int, zoneid_t);
8589857Sobrienextern	ilm_t		*ilm_lookup_ipif(ipif_t *, ipaddr_t);
8689857Sobrien
8789857Sobrienextern int		ilm_numentries_v6(ill_t *, const in6_addr_t *);
8889857Sobrienextern int		ilm_walk_ipif(ipif_t *);
8989857Sobrienextern int		ilm_walk_ill(ill_t *);
9089857Sobrienextern void		ilm_walker_cleanup(ill_t *);
9189857Sobrienextern int		ip_ll_send_disabmulti_req(ill_t *, const in6_addr_t *);
9289857Sobrienextern int		ip_ll_send_enabmulti_req(ill_t *, const in6_addr_t *);
9389857Sobrien
9489857Sobrienextern	int		ip_addmulti(ipaddr_t, ipif_t *, ilg_stat_t,
9589857Sobrien    mcast_record_t, slist_t *);
9689857Sobrienextern	int		ip_addmulti_v6(const in6_addr_t *, ill_t *, int,
9789857Sobrien    zoneid_t, ilg_stat_t, mcast_record_t, slist_t *);
9889857Sobrienextern	int		ip_delmulti(ipaddr_t, ipif_t *, boolean_t, boolean_t);
9989857Sobrienextern	int		ip_delmulti_v6(const in6_addr_t *, ill_t *, int,
10089857Sobrien    zoneid_t, boolean_t, boolean_t);
10189857Sobrienextern	int		ip_join_allmulti(ipif_t *);
10289857Sobrienextern	int		ip_leave_allmulti(ipif_t *);
10389857Sobrienextern	void		ip_multicast_loopback(queue_t *, ill_t *, mblk_t *,
10489857Sobrien    int, zoneid_t);
10589857Sobrienextern	int		ip_mforward(ill_t *, ipha_t *, mblk_t *);
10689857Sobrienextern	void		ip_mroute_decap(queue_t *, mblk_t *, ill_t *);
10789857Sobrienextern	int		ip_mroute_mrt(mblk_t *, ip_stack_t *);
10889857Sobrienextern	int		ip_mroute_stats(mblk_t *, ip_stack_t *);
10989857Sobrienextern	int		ip_mroute_vif(mblk_t *, ip_stack_t *);
11089857Sobrienextern	int		ip_mrouter_done(mblk_t *, ip_stack_t *);
11189857Sobrienextern	int		ip_mrouter_get(int, queue_t *, uchar_t *);
11289857Sobrienextern	int		ip_mrouter_set(int, queue_t *, int, uchar_t *, int,
11389857Sobrien    mblk_t *);
11489857Sobrienextern	void		ip_mrouter_stack_init(ip_stack_t *);
11589857Sobrienextern	void		ip_mrouter_stack_destroy(ip_stack_t *);
11689857Sobrien
11789857Sobrienextern	int		ip_opt_add_group(conn_t *, boolean_t, ipaddr_t,
11889857Sobrien    ipaddr_t, uint_t *, mcast_record_t, ipaddr_t, mblk_t *);
11989857Sobrienextern	int		ip_opt_delete_group(conn_t *, boolean_t, ipaddr_t,
12089857Sobrien    ipaddr_t, uint_t *, mcast_record_t, ipaddr_t, mblk_t *);
12189857Sobrienextern	int		ip_opt_add_group_v6(conn_t *, boolean_t,
12289857Sobrien    const in6_addr_t *, int, mcast_record_t, const in6_addr_t *, mblk_t *);
12389857Sobrienextern	int		ip_opt_delete_group_v6(conn_t *, boolean_t,
12489857Sobrien    const in6_addr_t *, int, mcast_record_t, const in6_addr_t *, mblk_t *);
12589857Sobrien
12689857Sobrienextern  int		mrt_ioctl(ipif_t *, sin_t *, queue_t *, mblk_t *,
12789857Sobrien    ip_ioctl_cmd_t *, void *);
12889857Sobrienextern	int		ip_sioctl_msfilter(ipif_t *, sin_t *, queue_t *,
12989857Sobrien    mblk_t *, ip_ioctl_cmd_t *, void *);
13089857Sobrienextern	int		ip_extract_msfilter(queue_t *, mblk_t *,
13189857Sobrien    const ip_ioctl_cmd_t *, cmd_info_t *, ipsq_func_t);
13289857Sobrienextern	int		ip_copyin_msfilter(queue_t *, mblk_t *);
13389857Sobrien
13489857Sobrienextern	void		ip_wput_ctl(queue_t *, mblk_t *);
13589857Sobrien
13689857Sobrienextern	int		pim_input(queue_t *, mblk_t *, ill_t *);
13789857Sobrienextern	void		reset_conn_ipif(ipif_t *);
138104834Sobrienextern	void		reset_conn_ill(ill_t *);
139104834Sobrienextern	void		reset_mrt_ill(ill_t *);
14089857Sobrienextern	void		reset_mrt_vif_ipif(ipif_t *);
141104834Sobrienextern	void		igmp_start_timers(unsigned, ip_stack_t *);
142104834Sobrienextern	void		mld_start_timers(unsigned, ip_stack_t *);
143104834Sobrien
14489857Sobrien#endif /* _KERNEL */
145104834Sobrien
146104834Sobrien#ifdef	__cplusplus
147104834Sobrien}
148104834Sobrien#endif
149104834Sobrien
150104834Sobrien#endif	/* _INET_IP_MULTI_H */
151104834Sobrien