Home | History | Annotate | Download | only in netinet

Lines Matching defs:hm

769 	hostmap_t *hm;
777 for (hm = softn->ipf_hm_maptable[hv]; hm; hm = hm->hm_hnext)
778 if ((hm->hm_osrcip.s_addr == src.s_addr) &&
779 (hm->hm_odstip.s_addr == dst.s_addr) &&
780 ((np == NULL) || (np == hm->hm_ipnat)) &&
781 ((port == 0) || (port == hm->hm_port))) {
783 hm->hm_ref++;
784 return hm;
792 KMALLOC(hm, hostmap_t *);
793 if (hm) {
794 hm->hm_next = softn->ipf_hm_maplist;
795 hm->hm_pnext = &softn->ipf_hm_maplist;
797 softn->ipf_hm_maplist->hm_pnext = &hm->hm_next;
798 softn->ipf_hm_maplist = hm;
799 hm->hm_hnext = softn->ipf_hm_maptable[hv];
800 hm->hm_phnext = softn->ipf_hm_maptable + hv;
802 softn->ipf_hm_maptable[hv]->hm_phnext = &hm->hm_hnext;
803 softn->ipf_hm_maptable[hv] = hm;
804 hm->hm_ipnat = np;
806 hm->hm_osrcip = src;
807 hm->hm_odstip = dst;
808 hm->hm_nsrcip = map;
809 hm->hm_ndstip.s_addr = 0;
810 hm->hm_ref = 1;
811 hm->hm_port = port;
812 hm->hm_hv = rhv;
813 hm->hm_v = 4;
818 return hm;
834 struct hostmap *hm;
836 hm = *hmp;
839 hm->hm_ref--;
840 if (hm->hm_ref == 0) {
841 ipf_nat_rule_deref(softc, &hm->hm_ipnat);
842 if (hm->hm_hnext)
843 hm->hm_hnext->hm_phnext = hm->hm_phnext;
844 *hm->hm_phnext = hm->hm_hnext;
845 if (hm->hm_next)
846 hm->hm_next->hm_pnext = hm->hm_pnext;
847 *hm->hm_pnext = hm->hm_next;
848 KFREE(hm);
2595 hostmap_t *hm;
2607 hm = NULL;
2634 hm = ipf_nat_hostmap(softn, np, fin->fin_src,
2636 if (hm != NULL)
2637 in.s_addr = hm->hm_nsrcip.s_addr;
2638 } else if ((l == 1) && (hm != NULL)) {
2639 ipf_nat_hostmapdel(softc, &hm);
2643 nat->nat_hm = hm;
2715 (np->in_spnext == 0) && ((l > 0) || (hm == NULL)))
2857 hostmap_t *hm;
2864 hm = NULL;
2889 hm = ipf_nat_hostmap(softn, NULL, fin->fin_src, fin->fin_dst,
2891 if (hm != NULL) {
2892 in.s_addr = ntohl(hm->hm_ndstip.s_addr);
2893 np = hm->hm_ipnat;
2896 ipf_nat_hostmapdel(softc, &hm);
2911 hm = ipf_nat_hostmap(softn, NULL, fin->fin_src,
2913 if (hm != NULL) {
2914 in.s_addr = hm->hm_ndstip.s_addr;
2919 if (hm == NULL || hm->hm_ref == 1) {
2927 if (hm != NULL)
2928 ipf_nat_hostmapdel(softc, &hm);
3064 hostmap_t *hm = NULL;
3228 if ((hm = nat->nat_hm) != NULL)
3229 ipf_nat_hostmapdel(softc, &hm);
6520 hostmap_t *hm, *nexthm = NULL, zerohm;
6536 hm = t->ipt_data;
6537 if (hm == NULL) {
6540 nexthm = hm->hm_next;
6609 if (hm != NULL) {
6611 ipf_nat_hostmapdel(softc, &hm);
8158 hostmap_t *hm, **newtab;
8185 for (hm = softn->ipf_hm_maplist; hm != NULL; hm = hm->hm_next) {
8186 hv = hm->hm_hv % softn->ipf_nat_hostmap_sz;
8187 hm->hm_hnext = softn->ipf_hm_maptable[hv];
8188 hm->hm_phnext = softn->ipf_hm_maptable + hv;
8190 softn->ipf_hm_maptable[hv]->hm_phnext = &hm->hm_hnext;
8191 softn->ipf_hm_maptable[hv] = hm;