xref: /titanic_51/usr/src/uts/common/inet/ip_if.h (revision a69116193464f859a8b27a2db19ad330ce163a55)
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
545916cd2Sjpk  * Common Development and Distribution License (the "License").
645916cd2Sjpk  * 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 /*
22550b6e40SSowmini Varadhan  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
23550b6e40SSowmini Varadhan  * Copyright (c) 1990 Mentat Inc.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_INET_IP_IF_H
277c478bd9Sstevel@tonic-gate #define	_INET_IP_IF_H
287c478bd9Sstevel@tonic-gate 
2945916cd2Sjpk #include <net/route.h>
3045916cd2Sjpk 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #define	PREFIX_INFINITY	0xffffffffUL
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #define	IP_LOOPBACK_MTU	(8*1024)
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
407c478bd9Sstevel@tonic-gate /*
417c478bd9Sstevel@tonic-gate  * Interface flags actually represent the state/properties of 3 different
427c478bd9Sstevel@tonic-gate  * abstractions of interfaces in IP. Interface flags are set using
437c478bd9Sstevel@tonic-gate  * SIOCS[L]IFFLAGS ioctl. The three abstractions are :
447c478bd9Sstevel@tonic-gate  *
457c478bd9Sstevel@tonic-gate  * 1) Physical interface (phyint) : There is one phyint allocated common
467c478bd9Sstevel@tonic-gate  *    to both IPv4 and IPv6 physical interface instance.
477c478bd9Sstevel@tonic-gate  *
487c478bd9Sstevel@tonic-gate  * 2) Physical interface instance (ill) : This encompasses all the state
497c478bd9Sstevel@tonic-gate  *    that is common across all IP addresses assigned to a physical
507c478bd9Sstevel@tonic-gate  *    interface but different between the IPv4 and IPv6 instance.
517c478bd9Sstevel@tonic-gate  *
527c478bd9Sstevel@tonic-gate  * 3) Logical interface (ipif) : This has state about a single IP address.
537c478bd9Sstevel@tonic-gate  *
547c478bd9Sstevel@tonic-gate  * Values for the various states are derived from the same name space
557c478bd9Sstevel@tonic-gate  * as applications querying the state using SIOCGIFFLAGS/SIOCGLIFFLAGS
567c478bd9Sstevel@tonic-gate  * see only one state returned in lifr_flags which is a union of all
577c478bd9Sstevel@tonic-gate  * the above states/properties. Thus deriving the values from the common
587c478bd9Sstevel@tonic-gate  * name space makes implementation easier. All these values are stored in
597c478bd9Sstevel@tonic-gate  * uint64_t and any other structure/code using these flags should use
607c478bd9Sstevel@tonic-gate  * uint64_ts.
617c478bd9Sstevel@tonic-gate  *
627c478bd9Sstevel@tonic-gate  * As we maintain the interface flags in 3 different flags namely
637c478bd9Sstevel@tonic-gate  * phyint_flags, ill_flags, ipif_flags we define the following flag values
647c478bd9Sstevel@tonic-gate  * to be used within the kernel to reduce potential errors. The ones
657c478bd9Sstevel@tonic-gate  * starting with PHYI_ are supposed to be used with phyint_flags, the ones
667c478bd9Sstevel@tonic-gate  * starting with ILLF_ are supposed to be used with ill_flags and the ones
677c478bd9Sstevel@tonic-gate  * starting with IPIF_ are supposed to be used with ipif_flags. If you see
687c478bd9Sstevel@tonic-gate  * any code with a mismatch i.e phyint_flags & IPIF_UP - it is wrong. Only
697c478bd9Sstevel@tonic-gate  * PHYI_XXX can be used with phyint_flags.
707c478bd9Sstevel@tonic-gate  *
717c478bd9Sstevel@tonic-gate  * NOTE : For EVERY FLAG in if.h, there should be a corresponding value
727c478bd9Sstevel@tonic-gate  * defined HERE and this is the one that should be USED within IP. We
737c478bd9Sstevel@tonic-gate  * use IFF_ flags within IP only when we examine lifr_flags.
747c478bd9Sstevel@tonic-gate  */
757c478bd9Sstevel@tonic-gate #define	IFF_PHYINT_FLAGS	(IFF_LOOPBACK|IFF_RUNNING|IFF_PROMISC| \
767c478bd9Sstevel@tonic-gate     IFF_ALLMULTI|IFF_INTELLIGENT|IFF_MULTI_BCAST|IFF_FAILED|IFF_STANDBY| \
77550b6e40SSowmini Varadhan     IFF_INACTIVE|IFF_OFFLINE|IFF_VIRTUAL|IFF_IPMP|IFF_L3PROTECT)
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate #define	IFF_PHYINTINST_FLAGS	(IFF_DEBUG|IFF_NOTRAILERS|IFF_NOARP| \
807c478bd9Sstevel@tonic-gate     IFF_MULTICAST|IFF_ROUTER|IFF_NONUD|IFF_NORTEXCH|IFF_IPV4|IFF_IPV6| \
816e91bba0SGirish Moodalbail     IFF_COS_ENABLED|IFF_FIXEDMTU|IFF_VRRP|IFF_NOACCEPT|IFF_NOLINKLOCAL)
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate #define	IFF_LOGINT_FLAGS	(IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT| \
847c478bd9Sstevel@tonic-gate     IFF_UNNUMBERED|IFF_DHCPRUNNING|IFF_PRIVATE|IFF_NOXMIT|IFF_NOLOCAL| \
855c0b7edeSseb     IFF_DEPRECATED|IFF_ADDRCONF|IFF_ANYCAST|IFF_NOFAILOVER| \
86bd670b35SErik Nordmark     IFF_PREFERRED|IFF_TEMPORARY|IFF_DUPLICATE)
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate #define	PHYI_LOOPBACK		IFF_LOOPBACK	/* is a loopback net */
897c478bd9Sstevel@tonic-gate #define	PHYI_RUNNING		IFF_RUNNING	/* resources allocated */
907c478bd9Sstevel@tonic-gate #define	PHYI_PROMISC		IFF_PROMISC	/* receive all packets */
917c478bd9Sstevel@tonic-gate #define	PHYI_ALLMULTI		IFF_ALLMULTI	/* receive all multi packets */
927c478bd9Sstevel@tonic-gate #define	PHYI_INTELLIGENT	IFF_INTELLIGENT	/* protocol code on board */
937c478bd9Sstevel@tonic-gate #define	PHYI_MULTI_BCAST	IFF_MULTI_BCAST	/* multicast using broadcast */
947c478bd9Sstevel@tonic-gate #define	PHYI_FAILED		IFF_FAILED	/* NIC has failed */
957c478bd9Sstevel@tonic-gate #define	PHYI_STANDBY		IFF_STANDBY	/* Standby NIC  */
967c478bd9Sstevel@tonic-gate #define	PHYI_INACTIVE		IFF_INACTIVE	/* Standby active or not ? */
977c478bd9Sstevel@tonic-gate #define	PHYI_OFFLINE		IFF_OFFLINE	/* NIC has been offlined */
987c478bd9Sstevel@tonic-gate #define	PHYI_VIRTUAL		IFF_VIRTUAL	/* Will not send or recv pkts */
99e11c3f44Smeem #define	PHYI_IPMP		IFF_IPMP	/* IPMP meta-interface */
100550b6e40SSowmini Varadhan #define	PHYI_L3PROTECT		IFF_L3PROTECT	/* Layer-3 protected */
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #define	ILLF_DEBUG		IFF_DEBUG	/* turn on debugging */
1037c478bd9Sstevel@tonic-gate #define	ILLF_NOTRAILERS		IFF_NOTRAILERS	/* avoid use of trailers */
1047c478bd9Sstevel@tonic-gate #define	ILLF_NOARP		IFF_NOARP	/* no ARP for this interface */
1057c478bd9Sstevel@tonic-gate #define	ILLF_MULTICAST		IFF_MULTICAST	/* supports multicast */
1067c478bd9Sstevel@tonic-gate #define	ILLF_ROUTER		IFF_ROUTER	/* router on this interface */
1077c478bd9Sstevel@tonic-gate #define	ILLF_NONUD		IFF_NONUD	/* No NUD on this interface */
1087c478bd9Sstevel@tonic-gate #define	ILLF_NORTEXCH		IFF_NORTEXCH	/* No routing info exchange */
1097c478bd9Sstevel@tonic-gate #define	ILLF_IPV4		IFF_IPV4	/* IPv4 interface */
1107c478bd9Sstevel@tonic-gate #define	ILLF_IPV6		IFF_IPV6	/* IPv6 interface */
1117c478bd9Sstevel@tonic-gate #define	ILLF_COS_ENABLED	IFF_COS_ENABLED	/* Is CoS marking supported */
112bd670b35SErik Nordmark #define	ILLF_FIXEDMTU		IFF_FIXEDMTU	/* set with SIOCSLIFMTU */
1131cb875aeSCathy Zhou #define	ILLF_VRRP		IFF_VRRP	/* managed by VRRP */
1141cb875aeSCathy Zhou #define	ILLF_NOACCEPT		IFF_NOACCEPT	/* accept only ND messagees */
1156e91bba0SGirish Moodalbail #define	ILLF_NOLINKLOCAL	IFF_NOLINKLOCAL	/* No default linklocal */
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate #define	IPIF_UP			IFF_UP		/* interface is up */
1187c478bd9Sstevel@tonic-gate #define	IPIF_BROADCAST		IFF_BROADCAST	/* broadcast address valid */
1197c478bd9Sstevel@tonic-gate #define	IPIF_POINTOPOINT	IFF_POINTOPOINT	/* point-to-point link */
1207c478bd9Sstevel@tonic-gate #define	IPIF_UNNUMBERED		IFF_UNNUMBERED	/* non-unique address */
1217c478bd9Sstevel@tonic-gate #define	IPIF_DHCPRUNNING	IFF_DHCPRUNNING	/* DHCP controlled interface */
1227c478bd9Sstevel@tonic-gate #define	IPIF_PRIVATE		IFF_PRIVATE	/* do not advertise */
1237c478bd9Sstevel@tonic-gate #define	IPIF_NOXMIT		IFF_NOXMIT	/* Do not transmit packets */
1247c478bd9Sstevel@tonic-gate #define	IPIF_NOLOCAL		IFF_NOLOCAL	/* Just on-link subnet */
1257c478bd9Sstevel@tonic-gate #define	IPIF_DEPRECATED		IFF_DEPRECATED	/* address deprecated */
1267c478bd9Sstevel@tonic-gate #define	IPIF_ADDRCONF		IFF_ADDRCONF	/* stateless addrconf */
1277c478bd9Sstevel@tonic-gate #define	IPIF_ANYCAST		IFF_ANYCAST	/* Anycast address */
1287c478bd9Sstevel@tonic-gate #define	IPIF_NOFAILOVER		IFF_NOFAILOVER	/* No failover on NIC failure */
1297c478bd9Sstevel@tonic-gate #define	IPIF_PREFERRED		IFF_PREFERRED	/* Prefer as source address */
1307c478bd9Sstevel@tonic-gate #define	IPIF_TEMPORARY		IFF_TEMPORARY	/* RFC3041 */
13169bb4bb4Scarlsonj #define	IPIF_DUPLICATE		IFF_DUPLICATE	/* address is in use */
1327c478bd9Sstevel@tonic-gate 
133da14cebeSEric Cheng #ifdef DEBUG
134da14cebeSEric Cheng #define	ILL_MAC_PERIM_HELD(ill)	ill_mac_perim_held(ill)
135da14cebeSEric Cheng #else
136da14cebeSEric Cheng #define	ILL_MAC_PERIM_HELD(ill)
137da14cebeSEric Cheng #endif
138da14cebeSEric Cheng 
139bd670b35SErik Nordmark /*
140bd670b35SErik Nordmark  * match flags for ipif_lookup_addr_common* functions
141bd670b35SErik Nordmark  */
142bd670b35SErik Nordmark #define	IPIF_MATCH_ILLGRP	0x00000001
143bd670b35SErik Nordmark #define	IPIF_MATCH_NONDUP	0x00000002
144bd670b35SErik Nordmark 
14569bb4bb4Scarlsonj /* for ipif_resolver_up */
14669bb4bb4Scarlsonj enum ip_resolver_action {
14769bb4bb4Scarlsonj 	Res_act_initial,		/* initial address establishment */
148e11c3f44Smeem 	Res_act_rebind,			/* IPMP address rebind (new hwaddr) */
149e11c3f44Smeem 	Res_act_defend,			/* address defense */
150e11c3f44Smeem 	Res_act_none			/* do nothing */
15169bb4bb4Scarlsonj };
15269bb4bb4Scarlsonj 
153bd670b35SErik Nordmark extern	int	ill_add_ires(ill_t *);
154bd670b35SErik Nordmark extern	void	ill_delete_ires(ill_t *);
155e11c3f44Smeem extern	void	ill_dlpi_done(ill_t *, t_uscalar_t);
156bd670b35SErik Nordmark extern	boolean_t ill_dlpi_pending(ill_t *, t_uscalar_t);
157bd670b35SErik Nordmark extern	void	ill_dlpi_dispatch(ill_t *, mblk_t *);
1587c478bd9Sstevel@tonic-gate extern	void	ill_dlpi_send(ill_t *, mblk_t *);
1598df01f76Smeem extern	void	ill_dlpi_send_deferred(ill_t *);
160bd670b35SErik Nordmark extern	void	ill_dlpi_queue(ill_t *, mblk_t *);
161bd670b35SErik Nordmark extern	void	ill_dlpi_send_queued(ill_t *);
162bd670b35SErik Nordmark extern	void	ill_mcast_queue(ill_t *, mblk_t *);
163bd670b35SErik Nordmark extern	void	ill_mcast_send_queued(ill_t *);
164bd670b35SErik Nordmark extern	void	ill_mcast_timer_start(ip_stack_t *);
165da14cebeSEric Cheng extern	void	ill_capability_done(ill_t *);
1668df01f76Smeem 
1677c478bd9Sstevel@tonic-gate extern	mblk_t	*ill_dlur_gen(uchar_t *, uint_t, t_uscalar_t, t_scalar_t);
168f4b3ec61Sdh155122 /* NOTE: Keep unmodified ill_lookup_on_ifindex for ipp for now */
169bd670b35SErik Nordmark extern  ill_t	*ill_lookup_on_ifindex_global_instance(uint_t, boolean_t);
170bd670b35SErik Nordmark extern  ill_t	*ill_lookup_on_ifindex(uint_t, boolean_t, ip_stack_t *);
171bd670b35SErik Nordmark extern  ill_t	*ill_lookup_on_ifindex_zoneid(uint_t, zoneid_t, boolean_t,
172f4b3ec61Sdh155122     ip_stack_t *);
173bd670b35SErik Nordmark extern	ill_t	*ill_lookup_on_name(char *, boolean_t,
174bd670b35SErik Nordmark     boolean_t, boolean_t *, ip_stack_t *);
175b1b66e09SErik Nordmark extern boolean_t ip_xmit_ifindex_valid(uint_t, zoneid_t, boolean_t,
176b1b66e09SErik Nordmark     ip_stack_t *);
177f4b3ec61Sdh155122 extern uint_t	ill_get_next_ifindex(uint_t, boolean_t, ip_stack_t *);
178f4b3ec61Sdh155122 extern uint_t	ill_get_ifindex_by_name(char *, ip_stack_t *);
179bd670b35SErik Nordmark extern uint_t	ill_get_upper_ifindex(const ill_t *);
1807c478bd9Sstevel@tonic-gate extern	void	ill_delete(ill_t *);
1817c478bd9Sstevel@tonic-gate extern	void	ill_delete_tail(ill_t *);
1827c478bd9Sstevel@tonic-gate extern	int	ill_dl_phys(ill_t *, ipif_t *, mblk_t *, queue_t *);
183bd670b35SErik Nordmark extern	int	ill_dls_info(struct sockaddr_dl *, const ill_t *);
1847c478bd9Sstevel@tonic-gate extern	void	ill_fastpath_ack(ill_t *, mblk_t *);
1857c478bd9Sstevel@tonic-gate extern	int	ill_fastpath_probe(ill_t *, mblk_t *);
1868df01f76Smeem extern	int	ill_forward_set(ill_t *, boolean_t);
1877c478bd9Sstevel@tonic-gate extern	void	ill_frag_prune(ill_t *, uint_t);
1887c478bd9Sstevel@tonic-gate extern	void	ill_frag_free_pkts(ill_t *, ipfb_t *, ipf_t *, int);
1897c478bd9Sstevel@tonic-gate extern	time_t	ill_frag_timeout(ill_t *, time_t);
1907c478bd9Sstevel@tonic-gate extern	int	ill_init(queue_t *, ill_t *);
19169bb4bb4Scarlsonj extern	void	ill_restart_dad(ill_t *, boolean_t);
1922b24ab6bSSebastien Roy extern	void	ill_setdefaulttoken(ill_t *);
1932b24ab6bSSebastien Roy extern	void	ill_setdesttoken(ill_t *);
194bd670b35SErik Nordmark extern	void	ill_set_inputfn(ill_t *);
195bd670b35SErik Nordmark extern	void	ill_set_inputfn_all(ip_stack_t *);
196b051ecf6Smeem extern	int	ill_set_phys_addr(ill_t *, mblk_t *);
197550b6e40SSowmini Varadhan extern	void	ill_set_allowed_ips(ill_t *, mblk_t *);
1985d460eafSCathy Zhou extern	int	ill_replumb(ill_t *, mblk_t *);
199b051ecf6Smeem extern	void	ill_set_ndmp(ill_t *, mblk_t *, uint_t, uint_t);
2007c478bd9Sstevel@tonic-gate 
201968d2fd1Ssowmini extern	boolean_t ill_is_freeable(ill_t *ill);
2027c478bd9Sstevel@tonic-gate extern	void	ill_refhold(ill_t *);
2037c478bd9Sstevel@tonic-gate extern	void	ill_refhold_locked(ill_t *);
204bd670b35SErik Nordmark extern	boolean_t ill_check_and_refhold(ill_t *);
2057c478bd9Sstevel@tonic-gate extern	void	ill_refrele(ill_t *);
2067c478bd9Sstevel@tonic-gate extern	boolean_t ill_waiter_inc(ill_t *);
2077c478bd9Sstevel@tonic-gate extern	void	ill_waiter_dcr(ill_t *);
2087c478bd9Sstevel@tonic-gate extern	void	ill_trace_ref(ill_t *);
2097c478bd9Sstevel@tonic-gate extern	void	ill_untrace_ref(ill_t *);
210bd670b35SErik Nordmark extern	void	ill_downi(ire_t *, char *);
211bd670b35SErik Nordmark extern	void	ill_downi_if_clone(ire_t *, char *);
2127c478bd9Sstevel@tonic-gate extern	boolean_t ill_down_start(queue_t *, mblk_t *);
213bd670b35SErik Nordmark extern	ill_t	*ill_lookup_group_v4(ipaddr_t, zoneid_t,
214bd670b35SErik Nordmark     ip_stack_t *, boolean_t *, ipaddr_t *);
215f4b3ec61Sdh155122 extern	ill_t	*ill_lookup_group_v6(const in6_addr_t *, zoneid_t,
216bd670b35SErik Nordmark     ip_stack_t *, boolean_t *, in6_addr_t *);
217da14cebeSEric Cheng 
2187c478bd9Sstevel@tonic-gate extern	void	ill_capability_ack(ill_t *, mblk_t *);
2197c478bd9Sstevel@tonic-gate extern	void	ill_capability_probe(ill_t *);
220da14cebeSEric Cheng extern	void	ill_capability_reset(ill_t *, boolean_t);
221da14cebeSEric Cheng extern	void	ill_taskq_dispatch(ip_stack_t *);
222da14cebeSEric Cheng 
223bd670b35SErik Nordmark extern	void	ill_get_name(const ill_t *, char *, int);
224bd670b35SErik Nordmark extern	void	ill_group_cleanup(ill_t *);
2257c478bd9Sstevel@tonic-gate extern	int	ill_up_ipifs(ill_t *, queue_t *, mblk_t *);
226bd670b35SErik Nordmark extern	void	ip_update_source_selection(ip_stack_t *);
227e11c3f44Smeem extern uint_t	ill_appaddr_cnt(const ill_t *);
228e11c3f44Smeem extern uint_t	ill_ptpaddr_cnt(const ill_t *);
229bd670b35SErik Nordmark extern uint_t   ill_admupaddr_cnt(const ill_t *);
230bd670b35SErik Nordmark 
231bd670b35SErik Nordmark extern	ill_t	*ill_lookup_multicast(ip_stack_t *, zoneid_t, boolean_t);
232bd670b35SErik Nordmark extern void	ill_save_ire(ill_t *, ire_t *);
233bd670b35SErik Nordmark extern void	ill_remove_saved_ire(ill_t *, ire_t *);
234bd670b35SErik Nordmark extern int	ill_recover_saved_ire(ill_t *);
2357c478bd9Sstevel@tonic-gate 
2369bea6098Smeem extern	void	ip_interface_cleanup(ip_stack_t *);
23798e93c29Smeem extern	void	ipif_get_name(const ipif_t *, char *, int);
238f4b3ec61Sdh155122 extern	ipif_t	*ipif_getby_indexes(uint_t, uint_t, boolean_t, ip_stack_t *);
239f4b3ec61Sdh155122 extern	void	ipif_init(ip_stack_t *);
240bd670b35SErik Nordmark extern	ipif_t	*ipif_lookup_addr(ipaddr_t, ill_t *, zoneid_t, ip_stack_t *);
241bd670b35SErik Nordmark extern	ipif_t	*ipif_lookup_addr_exact(ipaddr_t, ill_t *, ip_stack_t *);
242bd670b35SErik Nordmark extern	ipif_t	*ipif_lookup_addr_nondup(ipaddr_t, ill_t *, zoneid_t,
243bd670b35SErik Nordmark     ip_stack_t *);
2447c478bd9Sstevel@tonic-gate extern	ipif_t	*ipif_lookup_addr_v6(const in6_addr_t *, ill_t *, zoneid_t,
2450f1702c5SYu Xiangning     ip_stack_t *);
246e11c3f44Smeem extern	ipif_t	*ipif_lookup_addr_exact_v6(const in6_addr_t *, ill_t *,
247e11c3f44Smeem     ip_stack_t *);
248bd670b35SErik Nordmark extern	ipif_t	*ipif_lookup_addr_nondup_v6(const in6_addr_t *, ill_t *,
249bd670b35SErik Nordmark     zoneid_t, ip_stack_t *);
250f4b3ec61Sdh155122 extern	zoneid_t ipif_lookup_addr_zoneid(ipaddr_t, ill_t *, ip_stack_t *);
251f4b3ec61Sdh155122 extern	zoneid_t ipif_lookup_addr_zoneid_v6(const in6_addr_t *, ill_t *,
252f4b3ec61Sdh155122     ip_stack_t *);
253bd670b35SErik Nordmark extern  ipif_t	*ipif_lookup_interface(ipaddr_t, ipaddr_t, ip_stack_t *);
2547c478bd9Sstevel@tonic-gate extern	ipif_t	*ipif_lookup_remote(ill_t *, ipaddr_t, zoneid_t);
255bd670b35SErik Nordmark extern boolean_t ipif_lookup_testaddr_v6(ill_t *, const in6_addr_t *,
256bd670b35SErik Nordmark     ipif_t **);
257bd670b35SErik Nordmark extern boolean_t ipif_lookup_testaddr_v4(ill_t *, const in_addr_t *,
258bd670b35SErik Nordmark     ipif_t **);
259bd670b35SErik Nordmark extern	ipif_t	*ipif_select_source_v4(ill_t *, ipaddr_t, zoneid_t, boolean_t,
260bd670b35SErik Nordmark     boolean_t *);
261bd670b35SErik Nordmark extern	boolean_t ipif_zone_avail(uint_t, boolean_t, zoneid_t, ip_stack_t *);
262bd670b35SErik Nordmark extern	ipif_t	*ipif_good_addr(ill_t *, zoneid_t);
263bd670b35SErik Nordmark extern	int	ip_select_source_v4(ill_t *, ipaddr_t, ipaddr_t, ipaddr_t,
264bd670b35SErik Nordmark     zoneid_t, ip_stack_t *, ipaddr_t *, uint32_t *, uint64_t *);
2657c478bd9Sstevel@tonic-gate extern	void	ipif_refhold(ipif_t *);
2667c478bd9Sstevel@tonic-gate extern	void	ipif_refhold_locked(ipif_t *);
2677c478bd9Sstevel@tonic-gate extern	void	ipif_refrele(ipif_t *);
2687c478bd9Sstevel@tonic-gate extern	void	ipif_all_down_tail(ipsq_t *, queue_t *, mblk_t *, void *);
26969bb4bb4Scarlsonj extern	int	ipif_resolver_up(ipif_t *, enum ip_resolver_action);
2707c478bd9Sstevel@tonic-gate extern	int	ipif_down(ipif_t *, queue_t *, mblk_t *);
271bd670b35SErik Nordmark extern	int	ipif_down_tail(ipif_t *);
272e11c3f44Smeem extern	void	ipif_multicast_down(ipif_t *);
2737c478bd9Sstevel@tonic-gate extern	void	ipif_multicast_up(ipif_t *);
2747c478bd9Sstevel@tonic-gate extern	void	ipif_ndp_down(ipif_t *);
275e11c3f44Smeem extern	int	ipif_ndp_up(ipif_t *, boolean_t);
2767c478bd9Sstevel@tonic-gate extern	int	ipif_up_done(ipif_t *);
2777c478bd9Sstevel@tonic-gate extern	int	ipif_up_done_v6(ipif_t *);
278b127ac41SPhilip Kirk extern	void	ipif_up_notify(ipif_t *);
279e11c3f44Smeem extern	ipif_t	*ipif_select_source_v6(ill_t *, const in6_addr_t *, boolean_t,
280bd670b35SErik Nordmark     uint32_t, zoneid_t, boolean_t, boolean_t *);
281bd670b35SErik Nordmark extern	int	ip_select_source_v6(ill_t *, const in6_addr_t *,
282bd670b35SErik Nordmark     const in6_addr_t *, zoneid_t, ip_stack_t *, uint_t, uint32_t, in6_addr_t *,
283bd670b35SErik Nordmark     uint32_t *, uint64_t *);
2847c478bd9Sstevel@tonic-gate extern	boolean_t	ipif_cant_setlinklocal(ipif_t *);
2852b24ab6bSSebastien Roy extern	void	ipif_setlinklocal(ipif_t *);
2862b24ab6bSSebastien Roy extern	void	ipif_setdestlinklocal(ipif_t *);
287bd670b35SErik Nordmark extern	ipif_t	*ipif_lookup_on_ifindex(uint_t, boolean_t, zoneid_t,
288bd670b35SErik Nordmark     ip_stack_t *);
2897c478bd9Sstevel@tonic-gate extern	ipif_t	*ipif_get_next_ipif(ipif_t *curr, ill_t *ill);
2907c478bd9Sstevel@tonic-gate extern	void	ipif_ill_refrele_tail(ill_t *ill);
291bd670b35SErik Nordmark extern	void	ipif_nce_down(ipif_t *ipif);
292bd670b35SErik Nordmark extern	int	ipif_arp_down(ipif_t *ipif);
29369bb4bb4Scarlsonj extern	void	ipif_mask_reply(ipif_t *);
294e11c3f44Smeem extern	int 	ipif_up(ipif_t *, queue_t *, mblk_t *);
29544b099c4SSowmini Varadhan extern	ill_t	*ill_lookup_usesrc(ill_t *);
2967c478bd9Sstevel@tonic-gate 
297b051ecf6Smeem extern	void	ipsq_current_start(ipsq_t *, ipif_t *, int);
298b051ecf6Smeem extern	void	ipsq_current_finish(ipsq_t *);
2997c478bd9Sstevel@tonic-gate extern	void	ipsq_enq(ipsq_t *, queue_t *, mblk_t *, ipsq_func_t, int,
3007c478bd9Sstevel@tonic-gate     ill_t *);
301da14cebeSEric Cheng extern	boolean_t ipsq_enter(ill_t *, boolean_t, int);
3027c478bd9Sstevel@tonic-gate extern	ipsq_t	*ipsq_try_enter(ipif_t *, ill_t *, queue_t *, mblk_t *,
3037c478bd9Sstevel@tonic-gate     ipsq_func_t, int, boolean_t);
304328c7d1fSmeem extern	void	ipsq_exit(ipsq_t *);
305da14cebeSEric Cheng extern	boolean_t ill_mac_perim_held(ill_t *);
3067c478bd9Sstevel@tonic-gate extern mblk_t	*ipsq_pending_mp_get(ipsq_t *, conn_t **);
3077c478bd9Sstevel@tonic-gate extern boolean_t ipsq_pending_mp_add(conn_t *, ipif_t *, queue_t *,
3087c478bd9Sstevel@tonic-gate     mblk_t *, int);
3098df01f76Smeem extern	void	qwriter_ip(ill_t *, queue_t *, mblk_t *, ipsq_func_t, int,
3108df01f76Smeem     boolean_t);
3117c478bd9Sstevel@tonic-gate 
31298e93c29Smeem typedef	int	ip_extract_func_t(queue_t *, mblk_t *, const ip_ioctl_cmd_t *,
313bd670b35SErik Nordmark     cmd_info_t *);
31498e93c29Smeem 
31598e93c29Smeem extern	ip_extract_func_t ip_extract_arpreq, ip_extract_lifreq;
31698e93c29Smeem 
31798e93c29Smeem extern	int	ip_addr_availability_check(ipif_t *);
3187c478bd9Sstevel@tonic-gate extern	void	ip_ll_subnet_defaults(ill_t *, mblk_t *);
3191cb875aeSCathy Zhou extern	void	ill_capability_send(ill_t *, mblk_t *);
32045916cd2Sjpk 
3217c478bd9Sstevel@tonic-gate extern	int	ip_rt_add(ipaddr_t, ipaddr_t, ipaddr_t, ipaddr_t, int,
322bd670b35SErik Nordmark     ill_t *, ire_t **, boolean_t, struct rtsa_s *, ip_stack_t *, zoneid_t);
3237c478bd9Sstevel@tonic-gate extern	int	ip_rt_add_v6(const in6_addr_t *, const in6_addr_t *,
324bd670b35SErik Nordmark     const in6_addr_t *, const in6_addr_t *, int, ill_t *, ire_t **,
325bd670b35SErik Nordmark     struct rtsa_s *, ip_stack_t *, zoneid_t);
3267c478bd9Sstevel@tonic-gate extern	int	ip_rt_delete(ipaddr_t, ipaddr_t, ipaddr_t, uint_t, int,
327bd670b35SErik Nordmark     ill_t *, boolean_t, ip_stack_t *, zoneid_t);
3287c478bd9Sstevel@tonic-gate extern	int	ip_rt_delete_v6(const in6_addr_t *, const in6_addr_t *,
329bd670b35SErik Nordmark     const in6_addr_t *, uint_t, int, ill_t *, ip_stack_t *, zoneid_t);
3307c478bd9Sstevel@tonic-gate extern int ip_siocdelndp_v6(ipif_t *, sin_t *, queue_t *, mblk_t *,
3317c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3327c478bd9Sstevel@tonic-gate extern int ip_siocqueryndp_v6(ipif_t *, sin_t *, queue_t *, mblk_t *,
3337c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3347c478bd9Sstevel@tonic-gate extern int ip_siocsetndp_v6(ipif_t *, sin_t *, queue_t *, mblk_t *,
3357c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3367c478bd9Sstevel@tonic-gate 
3377c478bd9Sstevel@tonic-gate extern int ip_siocaddrt(ipif_t *, sin_t *, queue_t *, mblk_t *,
3387c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3397c478bd9Sstevel@tonic-gate extern int ip_siocdelrt(ipif_t *, sin_t *, queue_t *, mblk_t *,
3407c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3417c478bd9Sstevel@tonic-gate 
3426e91bba0SGirish Moodalbail extern int ip_sioctl_prefix(ipif_t *, sin_t *, queue_t *, mblk_t *,
3436e91bba0SGirish Moodalbail     ip_ioctl_cmd_t *, void *);
3446e91bba0SGirish Moodalbail extern int ip_sioctl_prefix_restart(ipif_t *, sin_t *, queue_t *, mblk_t *,
3456e91bba0SGirish Moodalbail     ip_ioctl_cmd_t *, void *);
3466e91bba0SGirish Moodalbail 
3477c478bd9Sstevel@tonic-gate extern int ip_sioctl_addr(ipif_t *, sin_t *, queue_t *, mblk_t *,
3487c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3497c478bd9Sstevel@tonic-gate extern int ip_sioctl_addr_restart(ipif_t *, sin_t *, queue_t *, mblk_t *,
3507c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3517c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_addr(ipif_t *, sin_t *, queue_t *, mblk_t *,
3527c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3537c478bd9Sstevel@tonic-gate 
3547c478bd9Sstevel@tonic-gate extern int ip_sioctl_dstaddr(ipif_t *, sin_t *, queue_t *, mblk_t *,
3557c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3567c478bd9Sstevel@tonic-gate extern int ip_sioctl_dstaddr_restart(ipif_t *, sin_t *, queue_t *, mblk_t *,
3577c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3587c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_dstaddr(ipif_t *, sin_t *, queue_t *, mblk_t *,
3597c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3607c478bd9Sstevel@tonic-gate 
3617c478bd9Sstevel@tonic-gate extern int ip_sioctl_flags(ipif_t *, sin_t *, queue_t *, mblk_t *,
3627c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3637c478bd9Sstevel@tonic-gate extern int ip_sioctl_flags_restart(ipif_t *, sin_t *, queue_t *, mblk_t *,
3647c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3657c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_flags(ipif_t *, sin_t *, queue_t *, mblk_t *,
3667c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3677c478bd9Sstevel@tonic-gate 
3687c478bd9Sstevel@tonic-gate extern int ip_sioctl_mtu(ipif_t *, sin_t *, queue_t *, mblk_t *,
3697c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3707c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_mtu(ipif_t *, sin_t *, queue_t *, mblk_t *,
3717c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3727c478bd9Sstevel@tonic-gate 
3737c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_ifconf(ipif_t *, sin_t *, queue_t *, mblk_t *,
3747c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3757c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_lifconf(ipif_t *, sin_t *, queue_t *, mblk_t *,
3767c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3777c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_ifnum(ipif_t *, sin_t *, queue_t *, mblk_t *,
3787c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3797c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_lifnum(ipif_t *, sin_t *, queue_t *, mblk_t *,
3807c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3817c478bd9Sstevel@tonic-gate 
3827c478bd9Sstevel@tonic-gate extern int ip_sioctl_token(ipif_t *, sin_t *, queue_t *, mblk_t *,
3837c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3847c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_token(ipif_t *, sin_t *, queue_t *, mblk_t *,
3857c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3867c478bd9Sstevel@tonic-gate 
3877c478bd9Sstevel@tonic-gate extern int if_unitsel(ipif_t *, sin_t *, queue_t *, mblk_t *,
3887c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3897c478bd9Sstevel@tonic-gate extern int if_unitsel_restart(ipif_t *, sin_t *, queue_t *, mblk_t *,
3907c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3917c478bd9Sstevel@tonic-gate 
3927c478bd9Sstevel@tonic-gate extern int ip_sioctl_sifname(ipif_t *, sin_t *, queue_t *, mblk_t *,
3937c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3947c478bd9Sstevel@tonic-gate 
3957c478bd9Sstevel@tonic-gate extern int ip_sioctl_slifname(ipif_t *, sin_t *, queue_t *, mblk_t *,
3967c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
3977c478bd9Sstevel@tonic-gate extern int ip_sioctl_slifname_restart(ipif_t *, sin_t *, queue_t *,
3987c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
3997c478bd9Sstevel@tonic-gate 
4007c478bd9Sstevel@tonic-gate extern int ip_sioctl_slifindex(ipif_t *, sin_t *, queue_t *, mblk_t *,
4017c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4027c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_lifindex(ipif_t *, sin_t *, queue_t *, mblk_t *,
4037c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4047c478bd9Sstevel@tonic-gate 
4057c478bd9Sstevel@tonic-gate extern int ip_sioctl_brdaddr(ipif_t *, sin_t *, queue_t *, mblk_t *,
4067c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4077c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_brdaddr(ipif_t *, sin_t *, queue_t *, mblk_t *,
4087c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4097c478bd9Sstevel@tonic-gate 
4107c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_muxid(ipif_t *, sin_t *, queue_t *, mblk_t *,
4117c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4127c478bd9Sstevel@tonic-gate extern int ip_sioctl_muxid(ipif_t *, sin_t *, queue_t *, mblk_t *,
4137c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4147c478bd9Sstevel@tonic-gate 
4157c478bd9Sstevel@tonic-gate extern int ip_sioctl_netmask(ipif_t *, sin_t *, queue_t *, mblk_t *,
4167c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4177c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_netmask(ipif_t *, sin_t *, queue_t *, mblk_t *,
4187c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4197c478bd9Sstevel@tonic-gate extern int ip_sioctl_netmask_restart(ipif_t *, sin_t *, queue_t *, mblk_t *,
4207c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4217c478bd9Sstevel@tonic-gate 
4227c478bd9Sstevel@tonic-gate extern int ip_sioctl_subnet(ipif_t *, sin_t *, queue_t *, mblk_t *,
4237c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4247c478bd9Sstevel@tonic-gate extern int ip_sioctl_subnet_restart(ipif_t *, sin_t *, queue_t *, mblk_t *,
4257c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4267c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_subnet(ipif_t *, sin_t *, queue_t *, mblk_t *,
4277c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4287c478bd9Sstevel@tonic-gate 
4297c478bd9Sstevel@tonic-gate extern int ip_sioctl_lnkinfo(ipif_t *, sin_t *, queue_t *, mblk_t *,
4307c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4317c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_lnkinfo(ipif_t *, sin_t *, queue_t *, mblk_t *,
4327c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4337c478bd9Sstevel@tonic-gate 
4347c478bd9Sstevel@tonic-gate extern int ip_sioctl_metric(ipif_t *, sin_t *, queue_t *, mblk_t *,
4357c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4367c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_metric(ipif_t *, sin_t *, queue_t *, mblk_t *,
4377c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4387c478bd9Sstevel@tonic-gate 
4397c478bd9Sstevel@tonic-gate extern int ip_sioctl_arp(ipif_t *, sin_t *, queue_t *, mblk_t *,
4407c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4417c478bd9Sstevel@tonic-gate 
4427c478bd9Sstevel@tonic-gate extern int ip_sioctl_addif(ipif_t *, sin_t *, queue_t *, mblk_t *,
4437c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4447c478bd9Sstevel@tonic-gate extern int ip_sioctl_removeif(ipif_t *, sin_t *, queue_t *, mblk_t *,
4457c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4467c478bd9Sstevel@tonic-gate extern int ip_sioctl_removeif_restart(ipif_t *, sin_t *, queue_t *, mblk_t *,
4477c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4487c478bd9Sstevel@tonic-gate 
4497c478bd9Sstevel@tonic-gate extern int ip_sioctl_tonlink(ipif_t *, sin_t *, queue_t *, mblk_t *,
4507c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4517c478bd9Sstevel@tonic-gate extern int ip_sioctl_tmysite(ipif_t *, sin_t *, queue_t *, mblk_t *,
4527c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4537c478bd9Sstevel@tonic-gate extern int ip_sioctl_tmyaddr(ipif_t *, sin_t *, queue_t *, mblk_t *,
4547c478bd9Sstevel@tonic-gate     ip_ioctl_cmd_t *, void *);
4557c478bd9Sstevel@tonic-gate 
456e11c3f44Smeem extern int ip_sioctl_get_binding(ipif_t *, sin_t *, queue_t *,
457e11c3f44Smeem     mblk_t *, ip_ioctl_cmd_t *, void *);
4587c478bd9Sstevel@tonic-gate extern int ip_sioctl_groupname(ipif_t *, sin_t *, queue_t *,
4597c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
4607c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_groupname(ipif_t *, sin_t *, queue_t *,
4617c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
462e11c3f44Smeem extern int ip_sioctl_groupinfo(ipif_t *, sin_t *, queue_t *,
4637c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
4647c478bd9Sstevel@tonic-gate 
4657c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_lifzone(ipif_t *, sin_t *, queue_t *,
4667c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
4677c478bd9Sstevel@tonic-gate extern int ip_sioctl_slifzone(ipif_t *, sin_t *, queue_t *,
4687c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
4697c478bd9Sstevel@tonic-gate extern int ip_sioctl_slifzone_restart(ipif_t *, sin_t *, queue_t *,
4707c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
4717c478bd9Sstevel@tonic-gate 
4727c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_lifusesrc(ipif_t *, sin_t *, queue_t *,
4737c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
4747c478bd9Sstevel@tonic-gate extern int ip_sioctl_slifusesrc(ipif_t *, sin_t *, queue_t *,
4757c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
4767c478bd9Sstevel@tonic-gate extern int ip_sioctl_get_lifsrcof(ipif_t *, sin_t *, queue_t *,
4777c478bd9Sstevel@tonic-gate     mblk_t *, ip_ioctl_cmd_t *, void *);
4787c478bd9Sstevel@tonic-gate 
4796e91bba0SGirish Moodalbail extern int ip_sioctl_get_dadstate(ipif_t *, sin_t *, queue_t *, mblk_t *,
4806e91bba0SGirish Moodalbail     ip_ioctl_cmd_t *, void *);
4816e91bba0SGirish Moodalbail 
482*a6911619SDarren Reed extern int ip_sioctl_get_ifhwaddr(ipif_t *, sin_t *, queue_t *, mblk_t *,
483*a6911619SDarren Reed     ip_ioctl_cmd_t *, void *);
484*a6911619SDarren Reed extern int ip_sioctl_get_lifhwaddr(ipif_t *, sin_t *, queue_t *, mblk_t *,
485*a6911619SDarren Reed     ip_ioctl_cmd_t *, void *);
486*a6911619SDarren Reed 
4877c478bd9Sstevel@tonic-gate extern	void	ip_sioctl_copyin_resume(ipsq_t *, queue_t *, mblk_t *, void *);
4887c478bd9Sstevel@tonic-gate extern	void	ip_sioctl_copyin_setup(queue_t *, mblk_t *);
4897c478bd9Sstevel@tonic-gate extern	ip_ioctl_cmd_t *ip_sioctl_lookup(int);
490bd670b35SErik Nordmark extern void	ipif_delete_ires_v4(ipif_t *);
491bd670b35SErik Nordmark extern void	ipif_delete_ires_v6(ipif_t *);
492bd670b35SErik Nordmark extern int	ipif_arp_up(ipif_t *, enum ip_resolver_action, boolean_t);
493bd670b35SErik Nordmark extern void	ipif_dup_recovery(void *);
494bd670b35SErik Nordmark extern void	ipif_do_recovery(ipif_t *);
4957c478bd9Sstevel@tonic-gate 
496fd006805Snordmark /*
497fd006805Snordmark  * Notes on reference tracing on ill, ipif, ire, nce data structures:
498fd006805Snordmark  *
499fd006805Snordmark  * The current model of references on an ipif or ill is purely based on threads
500fd006805Snordmark  * acquiring a reference by doing a lookup on the ill or ipif or by calling a
501fd006805Snordmark  * refhold function on the ill or ipif. In particular any data structure that
502fd006805Snordmark  * points to an ipif or ill does not explicitly contribute to a reference on the
503fd006805Snordmark  * ill or ipif. More details may be seen in the block comment above ipif_down().
504fd006805Snordmark  * Thus in the quiescent state an ill or ipif has a refcnt of zero. Similarly
505fd006805Snordmark  * when a thread exits, there can't be any references on the ipif or ill due to
506fd006805Snordmark  * the exiting thread.
507fd006805Snordmark  *
508fd006805Snordmark  * As a debugging aid, the refhold and refrele functions call into tracing
509fd006805Snordmark  * functions that record the stack trace of the caller and the references
5106a8288c7Scarlsonj  * acquired or released by the calling thread, hashed by the structure address
5116a8288c7Scarlsonj  * in thread-specific-data (TSD).  On thread exit, ip_thread_exit destroys the
5126a8288c7Scarlsonj  * hash, and the destructor for the hash entries (th_trace_free) verifies that
5136a8288c7Scarlsonj  * there are no outstanding references to the ipif or ill from the exiting
5146a8288c7Scarlsonj  * thread.
515fd006805Snordmark  *
516fd006805Snordmark  * In the case of ires and nces, the model is slightly different. Typically each
517fd006805Snordmark  * ire pointing to an nce contributes to the nce_refcnt. Similarly a conn_t
518fd006805Snordmark  * pointing to an ire also contributes to the ire_refcnt. Excluding the above
519fd006805Snordmark  * special cases, the tracing behavior is similar to the tracing on ipif / ill.
520fd006805Snordmark  * Traces are neither recorded nor verified in the exception cases, and the code
521fd006805Snordmark  * is careful to use the right refhold and refrele functions. On thread exit
522fd006805Snordmark  * ire_thread_exit, nce_thread_exit does the verification that are no
523fd006805Snordmark  * outstanding references on the ire / nce from the exiting thread.
524fd006805Snordmark  *
5256a8288c7Scarlsonj  * The reference verification is driven from the TSD destructor which calls
5266a8288c7Scarlsonj  * into IP's verification function ip_thread_exit. This debugging aid may be
5276a8288c7Scarlsonj  * helpful in tracing missing refrele's on a debug kernel. On a non-debug
5286a8288c7Scarlsonj  * kernel, these missing refrele's are noticeable only when an interface is
5296a8288c7Scarlsonj  * being unplumbed, and the unplumb hangs, long after the missing refrele. On a
5306a8288c7Scarlsonj  * debug kernel, the traces (th_trace_t) which contain the stack backtraces can
5316a8288c7Scarlsonj  * be examined on a crash dump to locate the missing refrele.
532fd006805Snordmark  */
533fd006805Snordmark 
5347c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
5357c478bd9Sstevel@tonic-gate 
5367c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
5377c478bd9Sstevel@tonic-gate }
5387c478bd9Sstevel@tonic-gate #endif
5397c478bd9Sstevel@tonic-gate 
5407c478bd9Sstevel@tonic-gate #endif	/* _INET_IP_IF_H */
541