Lines Matching defs:ncec

41 ncec_cb_dispatch(ncec_t *ncec)
46 mutex_enter(&ncec->ncec_lock);
47 if (list_is_empty(&ncec->ncec_cb)) {
48 mutex_exit(&ncec->ncec_lock);
51 ncec_ip2mac_response(&ip2m, ncec);
52 ncec_cb_refhold_locked(ncec);
61 ncec_cb = list_head(&ncec->ncec_cb);
62 for (; ncec_cb != NULL; ncec_cb = list_next(&ncec->ncec_cb, ncec_cb)) {
66 mutex_exit(&ncec->ncec_lock);
68 mutex_enter(&ncec->ncec_lock);
70 ncec_cb_refrele(ncec);
71 mutex_exit(&ncec->ncec_lock);
78 ncec_ip2mac_response(ip2mac_t *ip2m, ncec_t *ncec)
80 boolean_t isv6 = (ncec->ncec_ipversion == IPV6_VERSION);
85 ASSERT(MUTEX_HELD(&ncec->ncec_lock));
87 if (NCE_ISREACHABLE(ncec) && !NCE_ISCONDEMNED(ncec))
94 sin6->sin6_addr = ncec->ncec_addr;
98 IN6_V4MAPPED_TO_INADDR(&ncec->ncec_addr, &sin->sin_addr);
103 sdl->sdl_type = ncec->ncec_ill->ill_type;
109 sdl->sdl_alen = ncec->ncec_ill->ill_phys_addr_length;
110 if (ncec->ncec_lladdr != NULL)
111 bcopy(ncec->ncec_lladdr, LLADDR(sdl), sdl->sdl_alen);
116 ncec_cb_refhold_locked(ncec_t *ncec)
118 ASSERT(MUTEX_HELD(&ncec->ncec_lock));
119 ncec->ncec_cb_walker_cnt++;
123 ncec_cb_refrele(ncec_t *ncec)
127 ASSERT(MUTEX_HELD(&ncec->ncec_lock));
128 if (--ncec->ncec_cb_walker_cnt == 0) {
129 for (ncec_cb = list_head(&ncec->ncec_cb); ncec_cb != NULL;
132 ncec_cb_next = list_next(&ncec->ncec_cb, ncec_cb);
135 list_remove(&ncec->ncec_cb, ncec_cb);
146 ncec_add_cb(ncec_t *ncec, ip2mac_callback_t *cb, void *cbarg)
151 ASSERT(MUTEX_HELD(&ncec->ncec_lock));
159 * clear mismatches, only look in the callback list of ncec's
162 nce_cb->ncec_cb_id = ncec; /* no refs! just an address */
163 list_insert_tail(&ncec->ncec_cb, nce_cb);
164 ip2mid = ncec; /* this is the id to be used in ip2mac_cancel */
180 ncec_t *ncec;
240 ncec = nce->nce_common;
241 delta = TICK_TO_MSEC(ddi_get_lbolt64()) - ncec->ncec_last;
242 mutex_enter(&ncec->ncec_lock);
243 if (NCE_ISREACHABLE(ncec) &&
245 ncec_ip2mac_response(ip2m, ncec);
250 mutex_exit(&ncec->ncec_lock);
258 ncec = nce->nce_common;
259 delta = TICK_TO_MSEC(ddi_get_lbolt64()) - ncec->ncec_last;
260 mutex_enter(&ncec->ncec_lock);
261 if (NCE_ISCONDEMNED(ncec)) {
264 if (NCE_ISREACHABLE(ncec)) {
265 if (NCE_MYADDR(ncec) ||
267 ncec_ip2mac_response(ip2m, ncec);
269 mutex_exit(&ncec->ncec_lock);
286 ncec->ncec_rcnt = ill->ill_xmit_count;
287 ncec->ncec_state = ND_PROBE;
289 } else if (ncec->ncec_state == ND_INITIAL) {
291 ncec->ncec_state = ND_INCOMPLETE;
297 if (ncec->ncec_rcnt > 0) {
299 * Still resolving this ncec, so we can queue the
300 * callback information in ncec->ncec_cb
302 ip2mid = ncec_add_cb(ncec, cb, cbarg);
311 mutex_exit(&ncec->ncec_lock);
314 * if NCE_ISREACHABLE(ncec) but very old, or if it is ND_INITIAL,
318 ip_ndp_resolve(ncec);
335 * callback invoked for each active ncec. If the ip2mac_id_t corresponds
336 * to an active nce_cb_t in the ncec's callback list, we want to remove
340 ip2mac_cancel_callback(ncec_t *ncec, void *arg)
346 if (ip2m_nce_cb->ncec_cb_id != ncec)
349 mutex_enter(&ncec->ncec_lock);
350 if (list_is_empty(&ncec->ncec_cb)) {
351 mutex_exit(&ncec->ncec_lock);
362 ncec_cb = list_head(&ncec->ncec_cb);
363 for (; ncec_cb != NULL; ncec_cb = list_next(&ncec->ncec_cb, ncec_cb)) {
370 if (ncec->ncec_cb_walker_cnt == 0) {
371 list_remove(&ncec->ncec_cb, ncec_cb);
377 mutex_exit(&ncec->ncec_lock);