Lines Matching refs:hm

420 	hostmap_t *hm;  local
427 for (hm = ifs->ifs_maptable[hv]; hm; hm = hm->hm_next)
428 if ((hm->hm_srcip.s_addr == src.s_addr) &&
429 (hm->hm_dstip.s_addr == dst.s_addr) &&
430 ((np == NULL) || (np == hm->hm_ipnat)) &&
431 ((port == 0) || (port == hm->hm_port))) {
432 hm->hm_ref++;
433 return hm;
439 KMALLOC(hm, hostmap_t *);
440 if (hm) {
441 hm->hm_hnext = ifs->ifs_ipf_hm_maplist;
442 hm->hm_phnext = &ifs->ifs_ipf_hm_maplist;
444 ifs->ifs_ipf_hm_maplist->hm_phnext = &hm->hm_hnext;
445 ifs->ifs_ipf_hm_maplist = hm;
447 hm->hm_next = ifs->ifs_maptable[hv];
448 hm->hm_pnext = ifs->ifs_maptable + hv;
450 ifs->ifs_maptable[hv]->hm_pnext = &hm->hm_next;
451 ifs->ifs_maptable[hv] = hm;
452 hm->hm_ipnat = np;
453 hm->hm_srcip = src;
454 hm->hm_dstip = dst;
455 hm->hm_mapip = map;
456 hm->hm_ref = 1;
457 hm->hm_port = port;
458 hm->hm_v = 4;
460 return hm;
476 struct hostmap *hm; local
478 hm = *hmp;
481 hm->hm_ref--;
482 if (hm->hm_ref == 0) {
483 if (hm->hm_next)
484 hm->hm_next->hm_pnext = hm->hm_pnext;
485 *hm->hm_pnext = hm->hm_next;
486 if (hm->hm_hnext)
487 hm->hm_hnext->hm_phnext = hm->hm_phnext;
488 *hm->hm_phnext = hm->hm_hnext;
489 KFREE(hm);
2097 hostmap_t *hm; local
2110 hm = NULL;
2131 hm = nat_hostmap(np, fin->fin_src, fin->fin_dst,
2133 if (hm != NULL)
2134 in.s_addr = hm->hm_mapip.s_addr;
2135 } else if ((l == 1) && (hm != NULL)) {
2136 fr_hostmapdel(&hm);
2140 nat->nat_hm = hm;
2202 (np->in_pnext == 0) && ((l > 0) || (hm == NULL)))
2346 hostmap_t *hm; local
2354 hm = NULL;
2370 hm = nat_hostmap(NULL, fin->fin_src, fin->fin_dst, in,
2372 if (hm != NULL) {
2373 in.s_addr = ntohl(hm->hm_mapip.s_addr);
2374 np = hm->hm_ipnat;
2390 hm = nat_hostmap(np, fin->fin_src, fin->fin_dst,
2392 if (hm != NULL) {
2393 in.s_addr = hm->hm_mapip.s_addr;
2398 if (hm == NULL || hm->hm_ref == 1) {
2527 hostmap_t *hm = NULL; local
2669 if ((hm = nat->nat_hm) != NULL)
2670 fr_hostmapdel(&hm);
5492 hostmap_t *hm, *nexthm = NULL, zerohm; local
5509 hm = t->ipt_data;
5510 if (hm == NULL) {
5513 nexthm = hm->hm_next;
5611 if (hm != NULL) {
5613 fr_hostmapdel(&hm);
5622 hm = nexthm;