• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/contrib/ipfilter/netinet/

Lines Matching defs:hm

779 	hostmap_t *hm;
787 for (hm = softn->ipf_hm_maptable[hv]; hm; hm = hm->hm_hnext)
788 if ((hm->hm_osrcip.s_addr == src.s_addr) &&
789 (hm->hm_odstip.s_addr == dst.s_addr) &&
790 ((np == NULL) || (np == hm->hm_ipnat)) &&
791 ((port == 0) || (port == hm->hm_port))) {
793 hm->hm_ref++;
794 return hm;
802 KMALLOC(hm, hostmap_t *);
803 if (hm) {
804 hm->hm_next = softn->ipf_hm_maplist;
805 hm->hm_pnext = &softn->ipf_hm_maplist;
807 softn->ipf_hm_maplist->hm_pnext = &hm->hm_next;
808 softn->ipf_hm_maplist = hm;
809 hm->hm_hnext = softn->ipf_hm_maptable[hv];
810 hm->hm_phnext = softn->ipf_hm_maptable + hv;
812 softn->ipf_hm_maptable[hv]->hm_phnext = &hm->hm_hnext;
813 softn->ipf_hm_maptable[hv] = hm;
814 hm->hm_ipnat = np;
816 hm->hm_osrcip = src;
817 hm->hm_odstip = dst;
818 hm->hm_nsrcip = map;
819 hm->hm_ndstip.s_addr = 0;
820 hm->hm_ref = 1;
821 hm->hm_port = port;
822 hm->hm_hv = rhv;
823 hm->hm_v = 4;
828 return hm;
846 struct hostmap *hm;
848 hm = *hmp;
851 hm->hm_ref--;
852 if (hm->hm_ref == 0) {
853 ipf_nat_rule_deref(softc, &hm->hm_ipnat);
854 if (hm->hm_hnext)
855 hm->hm_hnext->hm_phnext = hm->hm_phnext;
856 *hm->hm_phnext = hm->hm_hnext;
857 if (hm->hm_next)
858 hm->hm_next->hm_pnext = hm->hm_pnext;
859 *hm->hm_pnext = hm->hm_next;
860 KFREE(hm);
2613 hostmap_t *hm;
2625 hm = NULL;
2652 hm = ipf_nat_hostmap(softn, np, fin->fin_src,
2654 if (hm != NULL)
2655 in.s_addr = hm->hm_nsrcip.s_addr;
2656 } else if ((l == 1) && (hm != NULL)) {
2657 ipf_nat_hostmapdel(softc, &hm);
2661 nat->nat_hm = hm;
2737 (np->in_spnext == 0) && ((l > 0) || (hm == NULL)))
2881 hostmap_t *hm;
2888 hm = NULL;
2913 hm = ipf_nat_hostmap(softn, NULL, fin->fin_src, fin->fin_dst,
2915 if (hm != NULL) {
2916 in.s_addr = ntohl(hm->hm_ndstip.s_addr);
2917 np = hm->hm_ipnat;
2920 ipf_nat_hostmapdel(softc, &hm);
2935 hm = ipf_nat_hostmap(softn, NULL, fin->fin_src,
2937 if (hm != NULL) {
2938 in.s_addr = hm->hm_ndstip.s_addr;
2943 if (hm == NULL || hm->hm_ref == 1) {
2951 if (hm != NULL)
2952 ipf_nat_hostmapdel(softc, &hm);
3094 hostmap_t *hm = NULL;
3260 if ((hm = nat->nat_hm) != NULL)
3261 ipf_nat_hostmapdel(softc, &hm);
6602 hostmap_t *hm, *nexthm = NULL, zerohm;
6618 hm = t->ipt_data;
6619 if (hm == NULL) {
6622 nexthm = hm->hm_next;
6691 if (hm != NULL) {
6693 ipf_nat_hostmapdel(softc, &hm);
8312 hostmap_t *hm, **newtab;
8339 for (hm = softn->ipf_hm_maplist; hm != NULL; hm = hm->hm_next) {
8340 hv = hm->hm_hv % softn->ipf_nat_hostmap_sz;
8341 hm->hm_hnext = softn->ipf_hm_maptable[hv];
8342 hm->hm_phnext = softn->ipf_hm_maptable + hv;
8344 softn->ipf_hm_maptable[hv]->hm_phnext = &hm->hm_hnext;
8345 softn->ipf_hm_maptable[hv] = hm;