Lines Matching refs:ipe

215 	iphtent_t *ipe;  local
219 while ((ipe = iph->iph_table[i]) != NULL)
220 if (fr_delhtent(iph, ipe, ifs) != 0)
246 void fr_derefhtent(ipe) in fr_derefhtent() argument
247 iphtent_t *ipe; in fr_derefhtent()
249 ipe->ipe_ref--;
250 if (ipe->ipe_ref == 0) {
251 KFREE(ipe);
301 iphtent_t *ipe; local
305 KMALLOC(ipe, iphtent_t *);
306 if (ipe == NULL)
309 bcopy((char *)ipeo, (char *)ipe, sizeof(*ipe));
311 if (ipe->ipe_family == AF_INET6) {
312 bits = count6bits((u_32_t *)ipe->ipe_mask.in6_addr8);
313 hv = IPE_HASH_FN(sum4((uint32_t *)ipe->ipe_addr.in6_addr8),
314 sum4((uint32_t *)ipe->ipe_mask.in6_addr8),
318 if (ipe->ipe_family == AF_INET)
320 ipe->ipe_addr.in4_addr &= ipe->ipe_mask.in4_addr;
321 ipe->ipe_addr.in4_addr = ntohl(ipe->ipe_addr.in4_addr);
322 bits = count4bits(ipe->ipe_mask.in4_addr);
323 ipe->ipe_mask.in4_addr = ntohl(ipe->ipe_mask.in4_addr);
325 hv = IPE_HASH_FN(ipe->ipe_addr.in4_addr, ipe->ipe_mask.in4_addr,
330 ipe->ipe_ref = 1;
331 ipe->ipe_next = iph->iph_table[hv];
332 ipe->ipe_pnext = iph->iph_table + hv;
335 iph->iph_table[hv]->ipe_pnext = &ipe->ipe_next;
336 iph->iph_table[hv] = ipe;
338 ipe->ipe_snext = iph->iph_list;
339 ipe->ipe_psnext = &iph->iph_list;
340 if (ipe->ipe_next != NULL)
341 ipe->ipe_next->ipe_psnext = &ipe->ipe_snext;
342 iph->iph_list = ipe;
345 if (ipe->ipe_family == AF_INET6) {
366 ipe->ipe_ptr = fr_addgroup(ipe->ipe_group, NULL,
372 ipe->ipe_ptr = NULL;
373 ipe->ipe_value = 0;
386 int fr_delhtent(iph, ipe, ifs) in fr_delhtent() argument
388 iphtent_t *ipe;
391 if (ipe->ipe_ref != 1)
395 *ipe->ipe_pnext = ipe->ipe_next;
396 if (ipe->ipe_next != NULL)
397 ipe->ipe_next->ipe_pnext = ipe->ipe_pnext;
402 if (ipe->ipe_group != NULL)
403 fr_delgroup(ipe->ipe_group, IPL_LOGIPF,
408 ipe->ipe_ptr = NULL;
409 ipe->ipe_value = 0;
413 KFREE(ipe);
429 iphtent_t *ipe; local
445 ipe = fr_iphmfind6(iph, &addr->in6);
449 ipe = fr_iphmfind(iph, &addr->in4);
451 ipe = NULL;
452 if (ipe != NULL)
453 rval = ipe->ipe_ptr;
480 iphtent_t *ipe; local
499 ipe = fr_iphmfind6(iph, &addr->in6);
503 ipe = fr_iphmfind(iph, &addr->in4);
505 ipe = NULL;
506 if (ipe != NULL) {
507 ipe->ipe_hits++;
508 ipe->ipe_bytes += fin->fin_plen;
524 iphtent_t *ipe; local
532 for (ipe = iph->iph_table[hv]; (ipe != NULL); ipe = ipe->ipe_next) {
533 if (ipe->ipe_mask.in4_addr != msk ||
534 ipe->ipe_addr.in4_addr != ips) {
540 if ((ipe == NULL) && (hmsk != 0)) {
552 return ipe;
563 iphtent_t *ipe; local
584 for (ipe = iph->iph_table[hv]; (ipe != NULL); ipe = ipe->ipe_next) {
585 if (bcmp((void *)&ipe->ipe_mask.in6, (void *)msk, 16) ||
586 bcmp((void *)&ipe->ipe_addr.in6, (void *)ips, 16))
591 if ((ipe == NULL) && ((hmsk[0] != 0) ||
608 return ipe;