summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/inet/ip_multi.h
blob: c41ef99e3e724d497f3ba8f3baf7bd5d851b617a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */
/* Copyright (c) 1990 Mentat Inc. */

#ifndef	_INET_IP_MULTI_H
#define	_INET_IP_MULTI_H

#ifdef	__cplusplus
extern "C" {
#endif

#if defined(_KERNEL)

#define	INFINITY	0xffffffffU
/*
 * Enum used to pass ilg status to ip_addmulti() and friends. There
 * are three possibilities: the group is being joined from within ip,
 * in which case there is no associated ilg; the group is being joined
 * from an upper layer with an associated ilg that's been newly created
 * by this join; or the upper layer is changing its group membership
 * state (the ilg existed before this call).
 */
typedef enum {
	ILGSTAT_NONE,
	ILGSTAT_NEW,
	ILGSTAT_CHANGE
} ilg_stat_t;

/*
 * Extern functions
 */
extern	mblk_t		*igmp_input(mblk_t *, ip_recv_attr_t *);
extern	void		igmp_joingroup(ilm_t *);
extern	void		igmp_leavegroup(ilm_t *);
extern	void		igmp_slowtimo(void *);
extern	void		igmp_timeout_handler(void *);
extern	void		igmp_statechange(ilm_t *, mcast_record_t, slist_t *);

extern	void		mld_joingroup(ilm_t *);
extern	void		mld_leavegroup(ilm_t *);
extern	void		mld_statechange(ilm_t *, mcast_record_t, slist_t *);
extern	void		mld_slowtimo(void *);

extern	void		ilg_delete_all(conn_t *connp);
extern	boolean_t	conn_hasmembers_ill_withsrc_v4(conn_t *, ipaddr_t,
    ipaddr_t, ill_t *);
extern	boolean_t	conn_hasmembers_ill_withsrc_v6(conn_t *,
    const in6_addr_t *, const in6_addr_t *, ill_t *);

extern void		ill_leave_multicast(ill_t *);
extern void		ill_recover_multicast(ill_t *);
extern void		ip_dlur_to_mhi(ill_t *, mblk_t *,
    struct mac_header_info_s *);

/* These make up the data path interface used by ip_output and ip_input */
extern boolean_t	ill_hasmembers_v4(ill_t *, ipaddr_t);
extern boolean_t	ill_hasmembers_v6(ill_t *, const in6_addr_t *);
extern boolean_t	ill_hasmembers_otherzones_v4(ill_t *, ipaddr_t,
    zoneid_t);
extern boolean_t	ill_hasmembers_otherzones_v6(ill_t *,
    const in6_addr_t *, zoneid_t);
extern zoneid_t		ill_hasmembers_nextzone_v4(ill_t *, ipaddr_t, zoneid_t);
extern zoneid_t		ill_hasmembers_nextzone_v6(ill_t *, const in6_addr_t *,
    zoneid_t);

extern	ilm_t		*ip_addmulti(const in6_addr_t *, ill_t *, zoneid_t,
    int *);
extern	int		ip_delmulti(ilm_t *);
extern	int		ip_mforward(mblk_t *, ip_recv_attr_t *);
extern	void		ip_mroute_decap(mblk_t *, ip_recv_attr_t *);
extern	int		ill_join_allmulti(ill_t *);
extern	void		ill_leave_allmulti(ill_t *);
extern	int		ip_join_allmulti(uint_t, boolean_t, ip_stack_t *);
extern	int		ip_leave_allmulti(uint_t, boolean_t, ip_stack_t *);
extern	void		ip_purge_allmulti(ill_t *);
extern	int		ip_mroute_mrt(mblk_t *, ip_stack_t *);
extern	int		ip_mroute_stats(mblk_t *, ip_stack_t *);
extern	int		ip_mroute_vif(mblk_t *, ip_stack_t *);
extern	int		ip_mrouter_done(ip_stack_t *);
extern	int		ip_mrouter_get(int, conn_t *, uchar_t *);
extern	int		ip_mrouter_set(int, conn_t *, int, uchar_t *, int);
extern	void		ip_mrouter_stack_init(ip_stack_t *);
extern	void		ip_mrouter_stack_destroy(ip_stack_t *);

extern	int		ip_opt_add_group(conn_t *, boolean_t,
    const in6_addr_t *, ipaddr_t, uint_t, mcast_record_t, const in6_addr_t *);
extern	int		ip_opt_delete_group(conn_t *, boolean_t,
    const in6_addr_t *, ipaddr_t, uint_t, mcast_record_t, const in6_addr_t *);

extern  int		mrt_ioctl(ipif_t *, sin_t *, queue_t *, mblk_t *,
    ip_ioctl_cmd_t *, void *);
extern	int		ip_sioctl_msfilter(ipif_t *, sin_t *, queue_t *,
    mblk_t *, ip_ioctl_cmd_t *, void *);
extern	int		ip_copyin_msfilter(queue_t *, mblk_t *);

extern	mblk_t		*pim_input(mblk_t *, ip_recv_attr_t *);
extern	void		update_conn_ill(ill_t *, ip_stack_t *);
extern	void		reset_mrt_ill(ill_t *);
extern	void		reset_mrt_vif_ipif(ipif_t *);
extern	void		igmp_start_timers(unsigned, ip_stack_t *);
extern	void		mld_start_timers(unsigned, ip_stack_t *);
extern	void		ilm_inactive(ilm_t *);

#endif /* _KERNEL */

#ifdef	__cplusplus
}
#endif

#endif	/* _INET_IP_MULTI_H */