xref: /titanic_51/usr/src/uts/common/inet/ip_multi.h (revision bd670b35a010421b6e1a5536c34453a827007c81)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
56226e9d9Sethindra  * Common Development and Distribution License (the "License").
66226e9d9Sethindra  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22e11c3f44Smeem  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate /* Copyright (c) 1990 Mentat Inc. */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_INET_IP_MULTI_H
287c478bd9Sstevel@tonic-gate #define	_INET_IP_MULTI_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
317c478bd9Sstevel@tonic-gate extern "C" {
327c478bd9Sstevel@tonic-gate #endif
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #if defined(_KERNEL)
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #define	INFINITY	0xffffffffU
377c478bd9Sstevel@tonic-gate /*
387c478bd9Sstevel@tonic-gate  * Enum used to pass ilg status to ip_addmulti() and friends. There
397c478bd9Sstevel@tonic-gate  * are three possibilities: the group is being joined from within ip,
407c478bd9Sstevel@tonic-gate  * in which case there is no associated ilg; the group is being joined
417c478bd9Sstevel@tonic-gate  * from an upper layer with an associated ilg that's been newly created
427c478bd9Sstevel@tonic-gate  * by this join; or the upper layer is changing its group membership
437c478bd9Sstevel@tonic-gate  * state (the ilg existed before this call).
447c478bd9Sstevel@tonic-gate  */
457c478bd9Sstevel@tonic-gate typedef enum {
467c478bd9Sstevel@tonic-gate 	ILGSTAT_NONE,
477c478bd9Sstevel@tonic-gate 	ILGSTAT_NEW,
487c478bd9Sstevel@tonic-gate 	ILGSTAT_CHANGE
497c478bd9Sstevel@tonic-gate } ilg_stat_t;
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate /*
527c478bd9Sstevel@tonic-gate  * Extern functions
537c478bd9Sstevel@tonic-gate  */
54*bd670b35SErik Nordmark extern	mblk_t		*igmp_input(mblk_t *, ip_recv_attr_t *);
557c478bd9Sstevel@tonic-gate extern	void		igmp_joingroup(ilm_t *);
567c478bd9Sstevel@tonic-gate extern	void		igmp_leavegroup(ilm_t *);
577c478bd9Sstevel@tonic-gate extern	void		igmp_slowtimo(void *);
587c478bd9Sstevel@tonic-gate extern	void		igmp_timeout_handler(void *);
597c478bd9Sstevel@tonic-gate extern	void		igmp_statechange(ilm_t *, mcast_record_t, slist_t *);
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate extern	void		mld_joingroup(ilm_t *);
627c478bd9Sstevel@tonic-gate extern	void		mld_leavegroup(ilm_t *);
637c478bd9Sstevel@tonic-gate extern	void		mld_statechange(ilm_t *, mcast_record_t, slist_t *);
647c478bd9Sstevel@tonic-gate extern	void		mld_slowtimo(void *);
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate extern	void		ilg_delete_all(conn_t *connp);
67*bd670b35SErik Nordmark extern	boolean_t	conn_hasmembers_ill_withsrc_v4(conn_t *, ipaddr_t,
68*bd670b35SErik Nordmark     ipaddr_t, ill_t *);
69*bd670b35SErik Nordmark extern	boolean_t	conn_hasmembers_ill_withsrc_v6(conn_t *,
70*bd670b35SErik Nordmark     const in6_addr_t *, const in6_addr_t *, ill_t *);
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate extern void		ill_leave_multicast(ill_t *);
737c478bd9Sstevel@tonic-gate extern void		ill_recover_multicast(ill_t *);
74*bd670b35SErik Nordmark extern void		ip_dlur_to_mhi(ill_t *, mblk_t *,
75*bd670b35SErik Nordmark     struct mac_header_info_s *);
767c478bd9Sstevel@tonic-gate 
77*bd670b35SErik Nordmark /* These make up the data path interface used by ip_output and ip_input */
78*bd670b35SErik Nordmark extern boolean_t	ill_hasmembers_v4(ill_t *, ipaddr_t);
79*bd670b35SErik Nordmark extern boolean_t	ill_hasmembers_v6(ill_t *, const in6_addr_t *);
80*bd670b35SErik Nordmark extern boolean_t	ill_hasmembers_otherzones_v4(ill_t *, ipaddr_t,
81*bd670b35SErik Nordmark     zoneid_t);
82*bd670b35SErik Nordmark extern boolean_t	ill_hasmembers_otherzones_v6(ill_t *,
83*bd670b35SErik Nordmark     const in6_addr_t *, zoneid_t);
84*bd670b35SErik Nordmark extern zoneid_t		ill_hasmembers_nextzone_v4(ill_t *, ipaddr_t, zoneid_t);
85*bd670b35SErik Nordmark extern zoneid_t		ill_hasmembers_nextzone_v6(ill_t *, const in6_addr_t *,
86*bd670b35SErik Nordmark     zoneid_t);
877c478bd9Sstevel@tonic-gate 
88*bd670b35SErik Nordmark extern	ilm_t		*ip_addmulti(const in6_addr_t *, ill_t *, zoneid_t,
89*bd670b35SErik Nordmark     int *);
90*bd670b35SErik Nordmark extern	int		ip_delmulti(ilm_t *);
91*bd670b35SErik Nordmark extern	int		ip_mforward(mblk_t *, ip_recv_attr_t *);
92*bd670b35SErik Nordmark extern	void		ip_mroute_decap(mblk_t *, ip_recv_attr_t *);
93b127ac41SPhilip Kirk extern	int		ill_join_allmulti(ill_t *);
94b127ac41SPhilip Kirk extern	void		ill_leave_allmulti(ill_t *);
95b127ac41SPhilip Kirk extern	int		ip_join_allmulti(uint_t, boolean_t, ip_stack_t *);
96b127ac41SPhilip Kirk extern	int		ip_leave_allmulti(uint_t, boolean_t, ip_stack_t *);
97b127ac41SPhilip Kirk extern	void		ip_purge_allmulti(ill_t *);
98f4b3ec61Sdh155122 extern	int		ip_mroute_mrt(mblk_t *, ip_stack_t *);
99f4b3ec61Sdh155122 extern	int		ip_mroute_stats(mblk_t *, ip_stack_t *);
100f4b3ec61Sdh155122 extern	int		ip_mroute_vif(mblk_t *, ip_stack_t *);
101*bd670b35SErik Nordmark extern	int		ip_mrouter_done(ip_stack_t *);
102*bd670b35SErik Nordmark extern	int		ip_mrouter_get(int, conn_t *, uchar_t *);
103*bd670b35SErik Nordmark extern	int		ip_mrouter_set(int, conn_t *, int, uchar_t *, int);
104f4b3ec61Sdh155122 extern	void		ip_mrouter_stack_init(ip_stack_t *);
105f4b3ec61Sdh155122 extern	void		ip_mrouter_stack_destroy(ip_stack_t *);
1067c478bd9Sstevel@tonic-gate 
107*bd670b35SErik Nordmark extern	int		ip_opt_add_group(conn_t *, boolean_t,
108*bd670b35SErik Nordmark     const in6_addr_t *, ipaddr_t, uint_t, mcast_record_t, const in6_addr_t *);
109*bd670b35SErik Nordmark extern	int		ip_opt_delete_group(conn_t *, boolean_t,
110*bd670b35SErik Nordmark     const in6_addr_t *, ipaddr_t, uint_t, mcast_record_t, const in6_addr_t *);
1117c478bd9Sstevel@tonic-gate 
11298e93c29Smeem extern  int		mrt_ioctl(ipif_t *, sin_t *, queue_t *, mblk_t *,
11398e93c29Smeem     ip_ioctl_cmd_t *, void *);
1147c478bd9Sstevel@tonic-gate extern	int		ip_sioctl_msfilter(ipif_t *, sin_t *, queue_t *,
1157c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
1167c478bd9Sstevel@tonic-gate extern	int		ip_copyin_msfilter(queue_t *, mblk_t *);
1177c478bd9Sstevel@tonic-gate 
118*bd670b35SErik Nordmark extern	mblk_t		*pim_input(mblk_t *, ip_recv_attr_t *);
119*bd670b35SErik Nordmark extern	void		update_conn_ill(ill_t *, ip_stack_t *);
1207c478bd9Sstevel@tonic-gate extern	void		reset_mrt_ill(ill_t *);
1217c478bd9Sstevel@tonic-gate extern	void		reset_mrt_vif_ipif(ipif_t *);
122*bd670b35SErik Nordmark extern	void		igmp_start_timers(unsigned, ip_stack_t *);
123*bd670b35SErik Nordmark extern	void		mld_start_timers(unsigned, ip_stack_t *);
124a7acbe81Ssowmini extern	void		ilm_inactive(ilm_t *);
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1297c478bd9Sstevel@tonic-gate }
1307c478bd9Sstevel@tonic-gate #endif
1317c478bd9Sstevel@tonic-gate 
1327c478bd9Sstevel@tonic-gate #endif	/* _INET_IP_MULTI_H */
133