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);
2358 in_lltable_destroy_lle_unlocked(struct llentry *lle) in in_lltable_destroy_lle_unlocked() argument
2360 LLE_LOCK_DESTROY(lle); in in_lltable_destroy_lle_unlocked()
2361 LLE_REQ_DESTROY(lle); in in_lltable_destroy_lle_unlocked()
2362 struct in_llentry *in_lle = (struct in_llentry *)lle; in in_lltable_destroy_lle_unlocked()
2371 in_lltable_destroy_lle(struct llentry *lle) in in_lltable_destroy_lle() argument
2373 LLE_WUNLOCK(lle); in in_lltable_destroy_lle()
2374 in_lltable_destroy_lle_unlocked(lle); in in_lltable_destroy_lle()
2381 struct in_llentry *lle; in in_lltable_new() local
2383 lle = kalloc_type(struct in_llentry, Z_NOWAIT | Z_ZERO); in in_lltable_new()
2384 if (lle == NULL) { /* NB: caller generates msg */ in in_lltable_new()
2392 lle->base.la_expire = net_uptime(); /* mark expired */ in in_lltable_new()
2393 lle->base.r_l3addr.addr4 = addr4; in in_lltable_new()
2394 lle->base.lle_refcnt = 1; in in_lltable_new()
2395 lle->base.lle_free = in_lltable_destroy_lle; in in_lltable_new()
2397 LLE_LOCK_INIT(&lle->base); in in_lltable_new()
2398 LLE_REQ_INIT(&lle->base); in in_lltable_new()
2401 return &lle->base; in in_lltable_new()
2409 const struct sockaddr *smask, uint16_t flags, struct llentry *lle) in in_lltable_match_prefix() argument
2415 lle_addr.s_addr = ntohl(lle->r_l3addr.addr4.s_addr); in in_lltable_match_prefix()
2421 if (lle->la_flags & LLE_IFADDR) { in in_lltable_match_prefix()
2436 if ((flags & LLE_STATIC) || !(lle->la_flags & LLE_STATIC)) { in in_lltable_match_prefix()
2444 in_lltable_free_entry(struct lltable *llt, struct llentry *lle) in in_lltable_free_entry() argument
2449 LLE_WLOCK_ASSERT(lle); in in_lltable_free_entry()
2453 if ((lle->la_flags & LLE_LINKED) != 0) { in in_lltable_free_entry()
2456 lltable_unlink_entry(llt, lle); in in_lltable_free_entry()
2461 if (callout_stop(&lle->lle_timer) > 0) { in in_lltable_free_entry()
2462 LLE_REMREF(lle); in in_lltable_free_entry()
2466 pkts_dropped = llentry_free(lle); in in_lltable_free_entry()
2501 in_lltable_hash(const struct llentry *lle, uint32_t hsize) in in_lltable_hash() argument
2503 return in_lltable_hash_dst(lle->r_l3addr.addr4, hsize); in in_lltable_hash()
2508 in_lltable_fill_sa_entry(const struct llentry *lle, struct sockaddr *sa) in in_lltable_fill_sa_entry() argument
2516 sin->sin_addr = lle->r_l3addr.addr4; in in_lltable_fill_sa_entry()
2522 struct llentry *lle; in in_lltable_find_dst() local
2528 LIST_FOREACH(lle, lleh, lle_next) { in in_lltable_find_dst()
2529 if (lle->la_flags & LLE_DELETED) { in in_lltable_find_dst()
2532 if (lle->r_l3addr.addr4.s_addr == dst.s_addr) { in in_lltable_find_dst()
2537 return lle; in in_lltable_find_dst()
2541 in_lltable_delete_entry(struct lltable *llt, struct llentry *lle) in in_lltable_delete_entry() argument
2544 lle->la_flags |= LLE_DELETED; in in_lltable_delete_entry()
2547 log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); in in_lltable_delete_entry()
2549 llentry_free(lle); in in_lltable_delete_entry()
2557 struct llentry *lle; in in_lltable_alloc() local
2572 lle = in_lltable_new(sin->sin_addr, flags); in in_lltable_alloc()
2573 if (lle == NULL) { in in_lltable_alloc()
2577 lle->la_flags = flags & ~LLE_CREATE; in in_lltable_alloc()
2579 lle->r_flags |= RLLE_VALID; in in_lltable_alloc()
2582 lltable_set_entry_addr(ifp, lle, LLADDR(SDL(ifp->if_lladdr->ifa_addr))); in in_lltable_alloc()
2583 lle->la_flags |= LLE_STATIC; in in_lltable_alloc()
2584 lle->r_flags |= (RLLE_VALID | RLLE_IFADDR); in in_lltable_alloc()
2586 return lle; in in_lltable_alloc()
2597 struct llentry *lle; in in_lltable_lookup() local
2603 lle = in_lltable_find_dst(llt, sin->sin_addr); in in_lltable_lookup()
2605 if (lle == NULL) { in in_lltable_lookup()
2614 return lle; in in_lltable_lookup()
2618 LLE_WLOCK(lle); in in_lltable_lookup()
2620 LLE_RLOCK(lle); in in_lltable_lookup()
2623 return lle; in in_lltable_lookup()
2627 in_lltable_dump_entry(struct lltable *llt, struct llentry *lle, in in_lltable_dump_entry() argument
2642 if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) { in in_lltable_dump_entry()
2646 lltable_fill_sa_entry(lle, (struct sockaddr *)&arpc.sin); in in_lltable_dump_entry()
2660 if (lle->la_flags & LLE_PUB) { in in_lltable_dump_entry()
2669 if ((lle->la_flags & LLE_VALID) == LLE_VALID) { in in_lltable_dump_entry()
2671 bcopy(&lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); in in_lltable_dump_entry()
2678 lle->la_flags & LLE_STATIC ? 0 : (int32_t)lle->la_expire; in in_lltable_dump_entry()
2680 if (lle->la_flags & LLE_STATIC) { in in_lltable_dump_entry()
2683 if (lle->la_flags & LLE_IFADDR) { in in_lltable_dump_entry()