4 * Copyright (C) 2003 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
9 static const char rcsid
[] = "@(#)Id: nat_setgroupmap.c,v 1.1.4.1 2006/06/16 17:21:07 darrenr Exp";
14 void nat_setgroupmap(n
)
17 if (n
->in_outmsk
== n
->in_inmsk
)
19 else if (n
->in_flags
& IPN_AUTOPORTMAP
) {
20 n
->in_ippip
= ~ntohl(n
->in_inmsk
);
21 if (n
->in_outmsk
!= 0xffffffff)
22 n
->in_ippip
/= (~ntohl(n
->in_outmsk
) + 1);
26 n
->in_ppip
= USABLE_PORTS
/ n
->in_ippip
;
28 n
->in_space
= USABLE_PORTS
* ~ntohl(n
->in_outmsk
);
30 if (!(n
->in_ppip
= n
->in_pmin
))
32 n
->in_ippip
= USABLE_PORTS
/ n
->in_ppip
;