xref: /illumos-gate/usr/src/uts/common/inet/ip_ndp.h (revision bbf21555)
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 /*
22e11c3f44Smeem  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
266dc3349eSDan McDonald /*
276dc3349eSDan McDonald  * Copyright 2019 Joyent, Inc.
286dc3349eSDan McDonald  */
296dc3349eSDan McDonald 
307c478bd9Sstevel@tonic-gate #ifndef	_INET_IP_NDP_H
317c478bd9Sstevel@tonic-gate #define	_INET_IP_NDP_H
327c478bd9Sstevel@tonic-gate 
3369bb4bb4Scarlsonj #include <sys/mutex.h>
3469bb4bb4Scarlsonj #include <sys/stream.h>
3569bb4bb4Scarlsonj #include <netinet/in.h>
3669bb4bb4Scarlsonj #include <netinet/icmp6.h>
3769bb4bb4Scarlsonj #include <inet/ip.h>
384b7cbb46SSowmini Varadhan #include <inet/ip2mac.h>
3969bb4bb4Scarlsonj 
407c478bd9Sstevel@tonic-gate /*
417c478bd9Sstevel@tonic-gate  * Internal definitions for the kernel implementation of the IPv6
42bd670b35SErik Nordmark  * Neighbor Discovery Protocol (NDP) and Address Resolution Protocol (ARP).
437c478bd9Sstevel@tonic-gate  */
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
467c478bd9Sstevel@tonic-gate extern "C" {
477c478bd9Sstevel@tonic-gate #endif
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate #ifdef _KERNEL
50c793af95Ssangeeta #define	NCE_TABLE_SIZE	256
514b7cbb46SSowmini Varadhan /*
524b7cbb46SSowmini Varadhan  * callbacks set up with ip2mac interface, waiting for result
534b7cbb46SSowmini Varadhan  * of neighbor resolution.
544b7cbb46SSowmini Varadhan  */
55bd670b35SErik Nordmark typedef struct ncec_cb_s {
56bd670b35SErik Nordmark 	list_node_t		ncec_cb_node;	/* next entry in list */
57bd670b35SErik Nordmark 	void			*ncec_cb_id;
58bd670b35SErik Nordmark 	uint32_t		ncec_cb_flags;
59bd670b35SErik Nordmark 	ip2mac_callback_t	*ncec_cb_func;
60bd670b35SErik Nordmark 	void			*ncec_cb_arg;
61bd670b35SErik Nordmark } ncec_cb_t;
624b7cbb46SSowmini Varadhan 
634b7cbb46SSowmini Varadhan #define	NCE_CB_DISPATCHED	0x00000001
644b7cbb46SSowmini Varadhan 
654b7cbb46SSowmini Varadhan /*
66bd670b35SErik Nordmark  * Core information tracking Neighbor Reachability is tracked in the
67bd670b35SErik Nordmark  * ncec_s/ncec_t. The information contained in the ncec_t does not contain
68bd670b35SErik Nordmark  * any link-specific details other than the pointer to the ill_t itself.
69bd670b35SErik Nordmark  * The link-specific information is tracked in the nce_t structure.
704b7cbb46SSowmini Varadhan  */
71bd670b35SErik Nordmark struct ncec_s {
72bd670b35SErik Nordmark 	struct	ncec_s	*ncec_next;	/* Hash chain next pointer */
73bd670b35SErik Nordmark 	struct	ncec_s	**ncec_ptpn;	/* Pointer to previous next */
748a06b3d6SToomas Soome 	struct	ill_s	*ncec_ill;	/* Associated ill */
75bd670b35SErik Nordmark 	uint16_t	ncec_flags;	/* See below */
76bd670b35SErik Nordmark 	uint16_t	ncec_state;	/* See reachability states in if.h */
77bd670b35SErik Nordmark 	int16_t		ncec_pcnt;	/* Probe counter */
78bd670b35SErik Nordmark 	uint16_t	ncec_rcnt;	/* Retransmit counter */
79bd670b35SErik Nordmark 	in6_addr_t	ncec_addr;	/* address of the nighbor */
80bd670b35SErik Nordmark 	uchar_t		*ncec_lladdr;
81bd670b35SErik Nordmark 	mblk_t		*ncec_qd_mp;	/* Head outgoing queued packets */
82bd670b35SErik Nordmark 	uint64_t	ncec_last;	/* Time last reachable in msec */
83bd670b35SErik Nordmark 	uint32_t	ncec_refcnt;	/* ncec active usage count */
84bd670b35SErik Nordmark 	kmutex_t	ncec_lock;	/* See comments on top for what */
857c478bd9Sstevel@tonic-gate 					/* this field protects */
86bd670b35SErik Nordmark 	int		ncec_unsolicit_count; /* Unsolicited Adv count */
87bd670b35SErik Nordmark 	timeout_id_t	ncec_timeout_id;
88bd670b35SErik Nordmark 	uchar_t		ncec_ipversion;	/* IPv4(ARP)/IPv6(NDP) version */
89bd670b35SErik Nordmark 	uint_t		ncec_defense_count;	/* number of NDP conflicts */
906dc3349eSDan McDonald 	clock_t		ncec_last_time_defended; /* defended last (ticks) */
91bd670b35SErik Nordmark 	uint64_t	ncec_init_time; /* time when it was set to ND_INITIAL */
92bd670b35SErik Nordmark 	boolean_t	ncec_trace_disable;	/* True when alloc fails */
93bd670b35SErik Nordmark 	/*
94bd670b35SErik Nordmark 	 * interval to keep track of DAD probes.
95bd670b35SErik Nordmark 	 */
96bd670b35SErik Nordmark 	clock_t		ncec_xmit_interval;
97bd670b35SErik Nordmark 	ip_stack_t	*ncec_ipst;	/* Does not have a netstack_hold */
98bd670b35SErik Nordmark 	list_t		ncec_cb;	/* callbacks waiting for resolution */
99bd670b35SErik Nordmark 	uint_t		ncec_cb_walker_cnt;
100bd670b35SErik Nordmark 	uint_t		ncec_nprobes;
101bd670b35SErik Nordmark 	uint_t		ncec_lladdr_length;
102bd670b35SErik Nordmark };
103bd670b35SErik Nordmark 
104bd670b35SErik Nordmark /*
105bd670b35SErik Nordmark  * The nce_t list hangs off the ill_s and tracks information that depends
106bd670b35SErik Nordmark  * on the underlying physical link. Thus when the ill goes down,
107bd670b35SErik Nordmark  * the nce_t list has to be flushed. This is  done as part of ill_delete()
108bd670b35SErik Nordmark  *
109bd670b35SErik Nordmark  * When the fastpath ack comes back in ill_fastpath_ack we call
110bd670b35SErik Nordmark  * nce_fastpath_update to update the nce_t. We never actually
111bd670b35SErik Nordmark  * flush the fastpath list, which is kept as an index into the
112bd670b35SErik Nordmark  * ncec_t structures.
113bd670b35SErik Nordmark  *
114bd670b35SErik Nordmark  * when we ndp_delete, we remove the nce entries pointing
115bd670b35SErik Nordmark  * at the dying ncec from the ill_fastpath_list chain.
116bd670b35SErik Nordmark  *
117bd670b35SErik Nordmark  */
118bd670b35SErik Nordmark struct nce_s	{
119bd670b35SErik Nordmark 	list_node_t	nce_node;
120bd670b35SErik Nordmark 	ill_t		*nce_ill;
121bd670b35SErik Nordmark 	boolean_t	nce_is_condemned;
122bd670b35SErik Nordmark 	in6_addr_t	nce_addr;
123bd670b35SErik Nordmark 	/*
124bd670b35SErik Nordmark 	 * link-layer specific fields below
125bd670b35SErik Nordmark 	 */
126bd670b35SErik Nordmark 	mblk_t		*nce_dlur_mp;	/* DL_UNITDATA_REQ mp */
127bd670b35SErik Nordmark 	mblk_t		*nce_fp_mp;	/* fast path mp */
128bd670b35SErik Nordmark 	struct ncec_s	*nce_common;
129bd670b35SErik Nordmark 	kmutex_t	nce_lock;
130bd670b35SErik Nordmark 	uint32_t	nce_refcnt;
1313efde6d0SSowmini Varadhan 	uint_t		nce_ipif_cnt;	/* number of ipifs with the nce_addr */
1323efde6d0SSowmini Varadhan 					/* as their local address */
133bd670b35SErik Nordmark };
1347c478bd9Sstevel@tonic-gate 
135c793af95Ssangeeta /*
136c793af95Ssangeeta  * The ndp_g_t structure contains protocol specific information needed
137c793af95Ssangeeta  * to synchronize and manage neighbor cache entries for IPv4 and IPv6.
138f4b3ec61Sdh  * There are 2 such structures, ips_ndp4 and ips_ndp6.
139f4b3ec61Sdh  * ips_ndp6 contains the data structures needed for IPv6 Neighbor Discovery.
140bd670b35SErik Nordmark  * ips_ndp4 contains the data structures for IPv4 ARP.
141c793af95Ssangeeta  *
142c793af95Ssangeeta  * Locking notes:
143c793af95Ssangeeta  * ndp_g_lock protects neighbor cache tables access and
144bd670b35SErik Nordmark  * insertion/removal of cache entries into/from these tables. The ncec_lock
145bd670b35SErik Nordmark  * and nce_lock protect fields in the ncec_t and nce_t structures.
146bd670b35SErik Nordmark  * Should there be a need to obtain nce[c]_lock and ndp_g_lock, ndp_g_lock is
147c793af95Ssangeeta  * acquired first.
148c793af95Ssangeeta  */
149c793af95Ssangeeta typedef	struct ndp_g_s {
150c793af95Ssangeeta 	kmutex_t	ndp_g_lock;	/* Lock protecting  cache hash table */
151bd670b35SErik Nordmark 	ncec_t		*nce_hash_tbl[NCE_TABLE_SIZE];
152c793af95Ssangeeta 	int		ndp_g_walker; /* # of active thread walking hash list */
153c793af95Ssangeeta 	boolean_t	ndp_g_walker_cleanup; /* true implies defer deletion. */
154c793af95Ssangeeta } ndp_g_t;
155c793af95Ssangeeta 
156bd670b35SErik Nordmark /* ncec_flags  */
157bd670b35SErik Nordmark #define	NCE_F_MYADDR		0x1	/* ipif exists for the ncec_addr */
158bd670b35SErik Nordmark #define	NCE_F_UNVERIFIED	0x2	/* DAD in progress. */
1597c478bd9Sstevel@tonic-gate #define	NCE_F_ISROUTER		0x4
160bd670b35SErik Nordmark #define	NCE_F_FAST		0x8
161bd670b35SErik Nordmark 
162bd670b35SErik Nordmark /*
163bd670b35SErik Nordmark  * NCE_F_NONUD is used to disable IPv6 Neighbor Unreachability Detection or
164*bbf21555SRichard Lowe  * IPv4 aging and maps to the ATF_PERM flag for arp(8)
165bd670b35SErik Nordmark  */
1667c478bd9Sstevel@tonic-gate #define	NCE_F_NONUD		0x10
167bd670b35SErik Nordmark 
1687c478bd9Sstevel@tonic-gate #define	NCE_F_ANYCAST		0x20
1697c478bd9Sstevel@tonic-gate #define	NCE_F_CONDEMNED		0x40
1707c478bd9Sstevel@tonic-gate #define	NCE_F_UNSOL_ADV		0x80
171516bda92Ssowmini #define	NCE_F_BCAST		0x100
172bd670b35SErik Nordmark #define	NCE_F_MCAST		0x200
173bd670b35SErik Nordmark 
174bd670b35SErik Nordmark /*
175bd670b35SErik Nordmark  * NCE_F_PUBLISH is set for all ARP/ND entries that we announce. This
176bd670b35SErik Nordmark  * includes locally configured addresses as well as those that we proxy for.
177bd670b35SErik Nordmark  */
178bd670b35SErik Nordmark #define	NCE_F_PUBLISH		0x400
179bd670b35SErik Nordmark 
180bd670b35SErik Nordmark /*
181bd670b35SErik Nordmark  * NCE_F_AUTHORITY is set for any address that we have authoritatitve
182bd670b35SErik Nordmark  * information for. This includes locally configured addresses as well
183bd670b35SErik Nordmark  * as statically configured arp entries that are set up using the "permanent"
184*bbf21555SRichard Lowe  * option described in arp(8). The NCE_F_AUTHORITY asserts that we would
185bd670b35SErik Nordmark  * reject any updates for that nce's (host, link-layer-address) information
186bd670b35SErik Nordmark  */
187bd670b35SErik Nordmark #define	NCE_F_AUTHORITY		0x800
1887c478bd9Sstevel@tonic-gate 
189bd670b35SErik Nordmark #define	NCE_F_DELAYED		0x1000 /* rescheduled on dad_defend_rate */
190bd670b35SErik Nordmark #define	NCE_F_STATIC		0x2000
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate /* State REACHABLE, STALE, DELAY or PROBE */
193bd670b35SErik Nordmark #define	NCE_ISREACHABLE(ncec)			\
194bd670b35SErik Nordmark 	(((((ncec)->ncec_state) >= ND_REACHABLE) &&	\
195bd670b35SErik Nordmark 	((ncec)->ncec_state) <= ND_PROBE))
196bd670b35SErik Nordmark 
197bd670b35SErik Nordmark #define	NCE_ISCONDEMNED(ncec)	((ncec)->ncec_flags & NCE_F_CONDEMNED)
1987c478bd9Sstevel@tonic-gate 
1997c478bd9Sstevel@tonic-gate /* NDP flags set in SOL/ADV requests */
2007c478bd9Sstevel@tonic-gate #define	NDP_UNICAST		0x1
2017c478bd9Sstevel@tonic-gate #define	NDP_ISROUTER		0x2
2027c478bd9Sstevel@tonic-gate #define	NDP_SOLICITED		0x4
2037c478bd9Sstevel@tonic-gate #define	NDP_ORIDE		0x8
20469bb4bb4Scarlsonj #define	NDP_PROBE		0x10
2057c478bd9Sstevel@tonic-gate 
2067c478bd9Sstevel@tonic-gate /* Number of packets queued in NDP for a neighbor */
2077c478bd9Sstevel@tonic-gate #define	ND_MAX_Q		4
2087c478bd9Sstevel@tonic-gate 
20969bb4bb4Scarlsonj /*
210bd670b35SErik Nordmark  * Structure for nce_update_hw_changed;
21169bb4bb4Scarlsonj  */
21269bb4bb4Scarlsonj typedef struct {
21369bb4bb4Scarlsonj 	ipaddr_t hwm_addr;	/* IPv4 address */
214bd670b35SErik Nordmark 	uint_t	hwm_hwlen;	/* Length of hardware address (may be 0) */
21569bb4bb4Scarlsonj 	uchar_t *hwm_hwaddr;	/* Pointer to new hardware address, if any */
216bd670b35SErik Nordmark 	int	hwm_flags;
21769bb4bb4Scarlsonj } nce_hw_map_t;
21869bb4bb4Scarlsonj 
2197c478bd9Sstevel@tonic-gate /* When SAP is greater than zero address appears before SAP */
2207c478bd9Sstevel@tonic-gate #define	NCE_LL_ADDR_OFFSET(ill)	(((ill)->ill_sap_length) < 0 ? \
2217c478bd9Sstevel@tonic-gate 	(sizeof (dl_unitdata_req_t)) : \
2227c478bd9Sstevel@tonic-gate 	((sizeof (dl_unitdata_req_t)) + (ABS((ill)->ill_sap_length))))
2237c478bd9Sstevel@tonic-gate 
2247c478bd9Sstevel@tonic-gate #define	NCE_LL_SAP_OFFSET(ill) (((ill)->ill_sap_length) < 0 ? \
2257c478bd9Sstevel@tonic-gate 	((sizeof (dl_unitdata_req_t)) + ((ill)->ill_phys_addr_length)) : \
2267c478bd9Sstevel@tonic-gate 	(sizeof (dl_unitdata_req_t)))
2277c478bd9Sstevel@tonic-gate 
228bd670b35SErik Nordmark #define	NCE_MYADDR(ncec)	(((ncec)->ncec_flags & NCE_F_MYADDR) != 0)
229bd670b35SErik Nordmark 
230bd670b35SErik Nordmark /*
231bd670b35SErik Nordmark  * NCE_PUBLISH() identifies the addresses that we are publishing. This
232bd670b35SErik Nordmark  * includes locally configured address (NCE_MYADDR()) as well as those that
233bd670b35SErik Nordmark  * we are proxying.
234bd670b35SErik Nordmark  */
235bd670b35SErik Nordmark #define	NCE_PUBLISH(ncec) ((ncec->ncec_flags & NCE_F_PUBLISH) != 0)
236bd670b35SErik Nordmark 
2377c478bd9Sstevel@tonic-gate #ifdef _BIG_ENDIAN
2387c478bd9Sstevel@tonic-gate #define	NCE_LL_SAP_COPY(ill, mp) \
2397c478bd9Sstevel@tonic-gate 	{ \
2407c478bd9Sstevel@tonic-gate 	size_t abs_sap_len = ABS((ill)->ill_sap_length); \
2417c478bd9Sstevel@tonic-gate 	if (abs_sap_len > 0) { \
2427c478bd9Sstevel@tonic-gate 		ASSERT(abs_sap_len <= sizeof (uint32_t)); \
2437c478bd9Sstevel@tonic-gate 		ASSERT((mp)->b_rptr + NCE_LL_SAP_OFFSET(ill) + \
2447c478bd9Sstevel@tonic-gate 		    abs_sap_len <= ((mp)->b_wptr)); \
2457c478bd9Sstevel@tonic-gate 		bcopy((uint8_t *)&(ill)->ill_sap + sizeof (ill->ill_sap) - \
2467c478bd9Sstevel@tonic-gate 		    abs_sap_len, \
2477c478bd9Sstevel@tonic-gate 		    ((mp)->b_rptr + NCE_LL_SAP_OFFSET(ill)), \
2487c478bd9Sstevel@tonic-gate 		    abs_sap_len); \
2497c478bd9Sstevel@tonic-gate 	} \
2507c478bd9Sstevel@tonic-gate 	}
2517c478bd9Sstevel@tonic-gate #else
2527c478bd9Sstevel@tonic-gate #define	NCE_LL_SAP_COPY(ill, mp) \
2537c478bd9Sstevel@tonic-gate 	{ \
2547c478bd9Sstevel@tonic-gate 	size_t abs_sap_len = ABS((ill)->ill_sap_length); \
2557c478bd9Sstevel@tonic-gate 	if (abs_sap_len > 0) { \
2567c478bd9Sstevel@tonic-gate 		uint32_t abs_sap_len = ABS((ill)->ill_sap_length); \
2577c478bd9Sstevel@tonic-gate 		ASSERT(abs_sap_len <= sizeof (uint32_t)); \
2587c478bd9Sstevel@tonic-gate 		ASSERT((mp)->b_rptr + NCE_LL_SAP_OFFSET(ill) + \
2597c478bd9Sstevel@tonic-gate 		    abs_sap_len <= ((mp)->b_wptr)); \
2607c478bd9Sstevel@tonic-gate 		bcopy(&((ill)->ill_sap), \
2617c478bd9Sstevel@tonic-gate 		((mp)->b_rptr + NCE_LL_SAP_OFFSET(ill)), \
2627c478bd9Sstevel@tonic-gate 		abs_sap_len); \
2637c478bd9Sstevel@tonic-gate 	} \
2647c478bd9Sstevel@tonic-gate 	}
2657c478bd9Sstevel@tonic-gate #endif
2667c478bd9Sstevel@tonic-gate 
2677c478bd9Sstevel@tonic-gate /*
2687c478bd9Sstevel@tonic-gate  * Exclusive-or the 6 bytes that are likely to contain the MAC
2697c478bd9Sstevel@tonic-gate  * address. Assumes table_size does not exceed 256.
2707c478bd9Sstevel@tonic-gate  * Assumes EUI-64 format for good hashing.
2717c478bd9Sstevel@tonic-gate  */
2727c478bd9Sstevel@tonic-gate #define	NCE_ADDR_HASH_V6(addr, table_size)				\
2737c478bd9Sstevel@tonic-gate 	(((addr).s6_addr8[8] ^ (addr).s6_addr8[9] ^			\
2747c478bd9Sstevel@tonic-gate 	(addr).s6_addr8[10] ^ (addr).s6_addr8[13] ^			\
2757c478bd9Sstevel@tonic-gate 	(addr).s6_addr8[14] ^ (addr).s6_addr8[15]) % (table_size))
2767c478bd9Sstevel@tonic-gate 
277f4b3ec61Sdh /* NDP Cache Entry Hash Table */
278f4b3ec61Sdh #define	NCE_TABLE_SIZE	256
279f4b3ec61Sdh 
2808a06b3d6SToomas Soome typedef void (*ncec_walk_cb_t)(ncec_t *, void *);
2818a06b3d6SToomas Soome 
282bd670b35SErik Nordmark extern	void	ip_nce_reclaim(void *);
283bd670b35SErik Nordmark extern	void	ncec_delete(ncec_t *);
2848a06b3d6SToomas Soome extern	void	ncec_delete_per_ill(ncec_t *, void *);
285bd670b35SErik Nordmark extern	void	nce_fastpath_update(ill_t *, mblk_t  *);
2867c478bd9Sstevel@tonic-gate extern	nd_opt_hdr_t *ndp_get_option(nd_opt_hdr_t *, int, int);
287bd670b35SErik Nordmark extern	void	ncec_inactive(ncec_t *);
288bd670b35SErik Nordmark extern	void	ndp_input(mblk_t *, ip_recv_attr_t *);
289bd670b35SErik Nordmark extern	ncec_t	*ncec_lookup_illgrp_v6(ill_t *, const in6_addr_t *);
290bd670b35SErik Nordmark extern	ncec_t	*ncec_lookup_illgrp_v4(ill_t *, const in_addr_t *);
291bd670b35SErik Nordmark extern	nce_t	*nce_lookup_v4(ill_t *, const in_addr_t *);
292bd670b35SErik Nordmark extern	nce_t	*nce_lookup_v6(ill_t *, const in6_addr_t *);
293bd670b35SErik Nordmark extern	void	nce_make_unreachable(ncec_t *);
294bd670b35SErik Nordmark extern	mblk_t	*ndp_mcastreq(ill_t *, const in6_addr_t *, uint32_t, uint32_t,
2957c478bd9Sstevel@tonic-gate     mblk_t *);
296bd670b35SErik Nordmark extern  nce_t	*ndp_nce_init(ill_t *, const in6_addr_t *, int);
297bd670b35SErik Nordmark extern  void	nce_process(ncec_t *, uchar_t *, uint32_t, boolean_t);
2987c478bd9Sstevel@tonic-gate extern	int	ndp_query(ill_t *, lif_nd_req_t *);
2997c478bd9Sstevel@tonic-gate extern	int	ndp_sioc_update(ill_t *, lif_nd_req_t *);
3007c478bd9Sstevel@tonic-gate extern	boolean_t	ndp_verify_optlen(nd_opt_hdr_t *, int);
301bd670b35SErik Nordmark extern	void	nce_timer(void *);
3028a06b3d6SToomas Soome extern	void	ncec_walk(ill_t *, ncec_walk_cb_t, void *, ip_stack_t *);
3038a06b3d6SToomas Soome extern	void	ncec_walk_common(ndp_g_t *, ill_t *, ncec_walk_cb_t,
304c793af95Ssangeeta     void *, boolean_t);
305bd670b35SErik Nordmark extern	boolean_t	nce_restart_dad(ncec_t *);
306bd670b35SErik Nordmark extern	void	ndp_resolv_failed(ncec_t *);
307bd670b35SErik Nordmark extern	void	arp_resolv_failed(ncec_t *);
308bd670b35SErik Nordmark extern	void	nce_fastpath_list_delete(ill_t *, ncec_t *, list_t *);
309bd670b35SErik Nordmark extern	void	nce_queue_mp(ncec_t *, mblk_t *, boolean_t);
310bd670b35SErik Nordmark extern	void	nce_update_hw_changed(ncec_t *, void *);
311bd670b35SErik Nordmark extern	int	nce_lookup_then_add_v6(ill_t *, uchar_t *, uint_t,
312bd670b35SErik Nordmark     const in6_addr_t *, uint16_t, uint16_t, nce_t **);
313bd670b35SErik Nordmark extern	int	nce_lookup_then_add_v4(ill_t *, uchar_t *, uint_t,
314bd670b35SErik Nordmark     const in_addr_t *, uint16_t, uint16_t, nce_t **);
315bd670b35SErik Nordmark extern boolean_t nce_cmp_ll_addr(const ncec_t *, const uchar_t *, uint32_t);
316bd670b35SErik Nordmark extern void	nce_update(ncec_t *, uint16_t, uchar_t *);
317bd670b35SErik Nordmark extern nce_t   *nce_lookup_mapping(ill_t *, const in6_addr_t *);
318bd670b35SErik Nordmark 
319bd670b35SErik Nordmark extern void	nce_restart_timer(ncec_t *, uint_t);
320bd670b35SErik Nordmark extern void	ncec_refrele(ncec_t *);
321bd670b35SErik Nordmark extern void	ncec_refhold(ncec_t *);
322bd670b35SErik Nordmark extern void	ncec_refrele_notr(ncec_t *);
323bd670b35SErik Nordmark extern void	ncec_refhold_notr(ncec_t *);
324bd670b35SErik Nordmark extern void	nce_resolv_ok(ncec_t *);
325bd670b35SErik Nordmark extern uint32_t	ndp_solicit(ncec_t *, in6_addr_t, ill_t *);
326bd670b35SErik Nordmark extern boolean_t ip_nce_conflict(mblk_t *, ip_recv_attr_t *, ncec_t *);
327bd670b35SErik Nordmark extern boolean_t ndp_announce(ncec_t *);
328bd670b35SErik Nordmark extern void	ip_nce_lookup_and_update(ipaddr_t *, ipif_t *, ip_stack_t *,
329bd670b35SErik Nordmark     uchar_t *, int, int);
330bd670b35SErik Nordmark extern void	nce_refrele(nce_t *);
331bd670b35SErik Nordmark extern void	nce_refhold(nce_t *);
332bd670b35SErik Nordmark extern void	nce_delete(nce_t *);
333bd670b35SErik Nordmark extern void	nce_flush(ill_t *, boolean_t);
334bd670b35SErik Nordmark extern void	nce_walk(ill_t *, pfi_t, void *);
335bd670b35SErik Nordmark extern void	ip_ndp_resolve(struct ncec_s *);
336bd670b35SErik Nordmark extern void	ip_addr_recover(ipsq_t *, queue_t *, mblk_t *, void *);
337c793af95Ssangeeta 
3386a8288c7Scarlsonj #ifdef DEBUG
339bd670b35SErik Nordmark extern	void	nce_trace_ref(ncec_t *);
340bd670b35SErik Nordmark extern	void	nce_untrace_ref(ncec_t *);
3417c478bd9Sstevel@tonic-gate #endif
3427c478bd9Sstevel@tonic-gate 
3437c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
3447c478bd9Sstevel@tonic-gate 
3457c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3467c478bd9Sstevel@tonic-gate }
3477c478bd9Sstevel@tonic-gate #endif
3487c478bd9Sstevel@tonic-gate 
3497c478bd9Sstevel@tonic-gate #endif	/* _INET_IP_NDP_H */
350