2 * Copyright (C) 1993-2001 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
7 * Use is subject to license terms.
10 #pragma ident "%Z%%M% %I% %E% SMI"
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
;