Lines Matching refs:lle
144 static void in_lltable_destroy_lle_unlocked(struct llentry *lle);
145 static void in_lltable_destroy_lle(struct llentry *lle);
148 const struct sockaddr *smask, uint16_t flags, struct llentry *lle);
149 static void in_lltable_free_entry(struct lltable *llt, struct llentry *lle);
152 static uint32_t in_lltable_hash(const struct llentry *lle, uint32_t hsize);
153 static void in_lltable_fill_sa_entry(const struct llentry *lle, struct sockaddr *sa);
155 static void in_lltable_delete_entry(struct lltable *llt, struct llentry *lle);
158 static int in_lltable_dump_entry(struct lltable *llt, struct llentry *lle, struct sysctl_req *wr);
2381 in_lltable_destroy_lle_unlocked(struct llentry *lle) in in_lltable_destroy_lle_unlocked() argument
2383 LLE_LOCK_DESTROY(lle); in in_lltable_destroy_lle_unlocked()
2384 LLE_REQ_DESTROY(lle); in in_lltable_destroy_lle_unlocked()
2385 kfree_type(struct in_llentry, lle); in in_lltable_destroy_lle_unlocked()
2393 in_lltable_destroy_lle(struct llentry *lle) in in_lltable_destroy_lle() argument
2395 LLE_WUNLOCK(lle); in in_lltable_destroy_lle()
2396 in_lltable_destroy_lle_unlocked(lle); in in_lltable_destroy_lle()
2403 struct in_llentry *lle; in in_lltable_new() local
2405 lle = kalloc_type(struct in_llentry, Z_NOWAIT | Z_ZERO); in in_lltable_new()
2406 if (lle == NULL) { /* NB: caller generates msg */ in in_lltable_new()
2414 lle->base.la_expire = net_uptime(); /* mark expired */ in in_lltable_new()
2415 lle->base.r_l3addr.addr4 = addr4; in in_lltable_new()
2416 lle->base.lle_refcnt = 1; in in_lltable_new()
2417 lle->base.lle_free = in_lltable_destroy_lle; in in_lltable_new()
2419 LLE_LOCK_INIT(&lle->base); in in_lltable_new()
2420 LLE_REQ_INIT(&lle->base); in in_lltable_new()
2423 return &lle->base; in in_lltable_new()
2431 const struct sockaddr *smask, uint16_t flags, struct llentry *lle) in in_lltable_match_prefix() argument
2437 lle_addr.s_addr = ntohl(lle->r_l3addr.addr4.s_addr); in in_lltable_match_prefix()
2443 if (lle->la_flags & LLE_IFADDR) { in in_lltable_match_prefix()
2458 if ((flags & LLE_STATIC) || !(lle->la_flags & LLE_STATIC)) { in in_lltable_match_prefix()
2466 in_lltable_free_entry(struct lltable *llt, struct llentry *lle) in in_lltable_free_entry() argument
2471 LLE_WLOCK_ASSERT(lle); in in_lltable_free_entry()
2475 if ((lle->la_flags & LLE_LINKED) != 0) { in in_lltable_free_entry()
2478 lltable_unlink_entry(llt, lle); in in_lltable_free_entry()
2483 if (callout_stop(&lle->lle_timer) > 0) { in in_lltable_free_entry()
2484 LLE_REMREF(lle); in in_lltable_free_entry()
2488 pkts_dropped = llentry_free(lle); in in_lltable_free_entry()
2523 in_lltable_hash(const struct llentry *lle, uint32_t hsize) in in_lltable_hash() argument
2525 return in_lltable_hash_dst(lle->r_l3addr.addr4, hsize); in in_lltable_hash()
2530 in_lltable_fill_sa_entry(const struct llentry *lle, struct sockaddr *sa) in in_lltable_fill_sa_entry() argument
2538 sin->sin_addr = lle->r_l3addr.addr4; in in_lltable_fill_sa_entry()
2544 struct llentry *lle; in in_lltable_find_dst() local
2550 LIST_FOREACH(lle, lleh, lle_next) { in in_lltable_find_dst()
2551 if (lle->la_flags & LLE_DELETED) { in in_lltable_find_dst()
2554 if (lle->r_l3addr.addr4.s_addr == dst.s_addr) { in in_lltable_find_dst()
2559 return lle; in in_lltable_find_dst()
2563 in_lltable_delete_entry(struct lltable *llt, struct llentry *lle) in in_lltable_delete_entry() argument
2566 lle->la_flags |= LLE_DELETED; in in_lltable_delete_entry()
2569 log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); in in_lltable_delete_entry()
2571 llentry_free(lle); in in_lltable_delete_entry()
2579 struct llentry *lle; in in_lltable_alloc() local
2594 lle = in_lltable_new(sin->sin_addr, flags); in in_lltable_alloc()
2595 if (lle == NULL) { in in_lltable_alloc()
2599 lle->la_flags = flags & ~LLE_CREATE; in in_lltable_alloc()
2601 lle->r_flags |= RLLE_VALID; in in_lltable_alloc()
2604 lltable_set_entry_addr(ifp, lle, LLADDR(SDL(ifp->if_lladdr->ifa_addr))); in in_lltable_alloc()
2605 lle->la_flags |= LLE_STATIC; in in_lltable_alloc()
2606 lle->r_flags |= (RLLE_VALID | RLLE_IFADDR); in in_lltable_alloc()
2608 return lle; in in_lltable_alloc()
2619 struct llentry *lle; in in_lltable_lookup() local
2625 lle = in_lltable_find_dst(llt, sin->sin_addr); in in_lltable_lookup()
2627 if (lle == NULL) { in in_lltable_lookup()
2636 return lle; in in_lltable_lookup()
2640 LLE_WLOCK(lle); in in_lltable_lookup()
2642 LLE_RLOCK(lle); in in_lltable_lookup()
2645 return lle; in in_lltable_lookup()
2649 in_lltable_dump_entry(struct lltable *llt, struct llentry *lle, in in_lltable_dump_entry() argument
2664 if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) { in in_lltable_dump_entry()
2668 lltable_fill_sa_entry(lle, (struct sockaddr *)&arpc.sin); in in_lltable_dump_entry()
2682 if (lle->la_flags & LLE_PUB) { in in_lltable_dump_entry()
2691 if ((lle->la_flags & LLE_VALID) == LLE_VALID) { in in_lltable_dump_entry()
2693 bcopy(&lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); in in_lltable_dump_entry()
2700 lle->la_flags & LLE_STATIC ? 0 : (int32_t)lle->la_expire; in in_lltable_dump_entry()
2702 if (lle->la_flags & LLE_STATIC) { in in_lltable_dump_entry()
2705 if (lle->la_flags & LLE_IFADDR) { in in_lltable_dump_entry()