require '_h2ph_pre.ph';

unless(defined(&__IP_NAT_H__)) {
    eval 'sub __IP_NAT_H__ () {1;}' unless defined(&__IP_NAT_H__);
    unless(defined(&SOLARIS)) {
	eval 'sub SOLARIS () {(defined( &sun)  && (defined( &__svr4__) || defined( &__SVR4)));}' unless defined(&SOLARIS);
    }
    if(defined( &__STDC__) || defined( &__GNUC__)) {
	eval 'sub SIOCADNAT () { &_IOW(ord(\'r\'), 80, \'struct ipnat\');}' unless defined(&SIOCADNAT);
	eval 'sub SIOCRMNAT () { &_IOW(ord(\'r\'), 81, \'struct ipnat\');}' unless defined(&SIOCRMNAT);
	eval 'sub SIOCGNATS () { &_IOR(ord(\'r\'), 82, \'struct natstat\');}' unless defined(&SIOCGNATS);
	eval 'sub SIOCGNATL () { &_IOWR(ord(\'r\'), 83, \'struct natlookup\');}' unless defined(&SIOCGNATL);
	eval 'sub SIOCGFRST () { &_IOR(ord(\'r\'), 84, \'struct ipfrstat\');}' unless defined(&SIOCGFRST);
	eval 'sub SIOCGIPST () { &_IOR(ord(\'r\'), 85, \'struct ips_stat\');}' unless defined(&SIOCGIPST);
	eval 'sub SIOCFLNAT () { &_IOWR(ord(\'r\'), 86, \'int\');}' unless defined(&SIOCFLNAT);
	eval 'sub SIOCCNATL () { &_IOWR(ord(\'r\'), 87, \'int\');}' unless defined(&SIOCCNATL);
    } else {
	eval 'sub SIOCADNAT () { &_IOW("r", 80, \'struct ipnat\');}' unless defined(&SIOCADNAT);
	eval 'sub SIOCRMNAT () { &_IOW("r", 81, \'struct ipnat\');}' unless defined(&SIOCRMNAT);
	eval 'sub SIOCGNATS () { &_IOR("r", 82, \'struct natstat\');}' unless defined(&SIOCGNATS);
	eval 'sub SIOCGNATL () { &_IOWR("r", 83, \'struct natlookup\');}' unless defined(&SIOCGNATL);
	eval 'sub SIOCGFRST () { &_IOR("r", 84, \'struct ipfrstat\');}' unless defined(&SIOCGFRST);
	eval 'sub SIOCGIPST () { &_IOR("r", 85, \'struct ips_stat\');}' unless defined(&SIOCGIPST);
	eval 'sub SIOCFLNAT () { &_IOWR("r", 86, \'int\');}' unless defined(&SIOCFLNAT);
	eval 'sub SIOCCNATL () { &_IOWR("r", 87, \'int\');}' unless defined(&SIOCCNATL);
    }
    undef(&LARGE_NAT) if defined(&LARGE_NAT);
    eval 'sub NAT_SIZE () {127;}' unless defined(&NAT_SIZE);
    eval 'sub RDR_SIZE () {127;}' unless defined(&RDR_SIZE);
    eval 'sub NAT_TABLE_SZ () {127;}' unless defined(&NAT_TABLE_SZ);
    if(defined(&LARGE_NAT)) {
	undef(&NAT_SIZE) if defined(&NAT_SIZE);
	undef(&RDR_SIZE) if defined(&RDR_SIZE);
	undef(&NAT_TABLE_SZ) if defined(&NAT_TABLE_SZ);
	eval 'sub NAT_SIZE () {2047;}' unless defined(&NAT_SIZE);
	eval 'sub RDR_SIZE () {2047;}' unless defined(&RDR_SIZE);
	eval 'sub NAT_TABLE_SZ () {16383;}' unless defined(&NAT_TABLE_SZ);
    }
    unless(defined(&APR_LABELLEN)) {
	eval 'sub APR_LABELLEN () {16;}' unless defined(&APR_LABELLEN);
    }
    eval 'sub NAT_HW_CKSUM () {0x80000000;}' unless defined(&NAT_HW_CKSUM);
    eval 'sub DEF_NAT_AGE () {1200;}' unless defined(&DEF_NAT_AGE);
    eval 'sub in_pmin () { $in_port[0];}' unless defined(&in_pmin);
    eval 'sub in_pmax () { $in_port[1];}' unless defined(&in_pmax);
    eval 'sub in_nip () { ($in_nextip->{s_addr});}' unless defined(&in_nip);
    eval 'sub in_inip () { ($in_in[0]->{s_addr});}' unless defined(&in_inip);
    eval 'sub in_inmsk () { ($in_in[1]->{s_addr});}' unless defined(&in_inmsk);
    eval 'sub in_outip () { ($in_out[0]->{s_addr});}' unless defined(&in_outip);
    eval 'sub in_outmsk () { ($in_out[1]->{s_addr});}' unless defined(&in_outmsk);
    eval 'sub in_srcip () { ($in_src[0]->{s_addr});}' unless defined(&in_srcip);
    eval 'sub in_srcmsk () { ($in_src[1]->{s_addr});}' unless defined(&in_srcmsk);
    eval 'sub NAT_OUTBOUND () {0;}' unless defined(&NAT_OUTBOUND);
    eval 'sub NAT_INBOUND () {1;}' unless defined(&NAT_INBOUND);
    eval 'sub NAT_MAP () {0x01;}' unless defined(&NAT_MAP);
    eval 'sub NAT_REDIRECT () {0x02;}' unless defined(&NAT_REDIRECT);
    eval 'sub NAT_BIMAP () {( &NAT_MAP| &NAT_REDIRECT);}' unless defined(&NAT_BIMAP);
    eval 'sub NAT_MAPBLK () {0x04;}' unless defined(&NAT_MAPBLK);
    eval 'sub MAPBLK_MINPORT () {1024;}' unless defined(&MAPBLK_MINPORT);
    eval 'sub USABLE_PORTS () {(65536-  &MAPBLK_MINPORT);}' unless defined(&USABLE_PORTS);
    eval 'sub IPN_CMPSIZ () {($sizeof{ &ipnat_t} -  &offsetof( &ipnat_t,  &in_flags));}' unless defined(&IPN_CMPSIZ);
    eval 'sub IPN_ANY () {0x00;}' unless defined(&IPN_ANY);
    eval 'sub IPN_TCP () {0x01;}' unless defined(&IPN_TCP);
    eval 'sub IPN_UDP () {0x02;}' unless defined(&IPN_UDP);
    eval 'sub IPN_TCPUDP () {( &IPN_TCP| &IPN_UDP);}' unless defined(&IPN_TCPUDP);
    eval 'sub IPN_DELETE () {0x04;}' unless defined(&IPN_DELETE);
    eval 'sub IPN_ICMPERR () {0x08;}' unless defined(&IPN_ICMPERR);
    eval 'sub IPN_RF () {( &IPN_TCPUDP| &IPN_DELETE| &IPN_ICMPERR);}' unless defined(&IPN_RF);
    eval 'sub IPN_AUTOPORTMAP () {0x10;}' unless defined(&IPN_AUTOPORTMAP);
    eval 'sub IPN_RANGE () {0x20;}' unless defined(&IPN_RANGE);
    eval 'sub IPN_USERFLAGS () {( &IPN_TCPUDP| &IPN_AUTOPORTMAP| &IPN_RANGE);}' unless defined(&IPN_USERFLAGS);
    eval 'sub NL_NEWMAP () { &NAT_MAP;}' unless defined(&NL_NEWMAP);
    eval 'sub NL_NEWRDR () { &NAT_REDIRECT;}' unless defined(&NL_NEWRDR);
    eval 'sub NL_EXPIRE () {0xffff;}' unless defined(&NL_EXPIRE);
    eval 'sub NAT_HASH_FN {
        local($k,$m) = @_;
	    eval q(((($k) + (($k) >> 12)) % ($m)));
    }' unless defined(&NAT_HASH_FN);
    eval 'sub LONG_SUM {
        local($in) = @_;
	    eval q(((($in) & 0xffff) + (($in) >> 16)));
    }' unless defined(&LONG_SUM);
    eval 'sub CALC_SUMD {
        local($s1, $s2, $sd) = @_;
	    eval q({ ($s1) = (($s1) & 0xffff) + (($s1) >> 16); ($s2) = (($s2) & 0xffff) + (($s2) >> 16); ($s1) = (($s1) & 0xffff) + (($s1) >> 16); ($s2) = (($s2) & 0xffff) + (($s2) >> 16);  &if (($s1) > ($s2)) ($s2)--; ($sd) = ($s2) - ($s1); ($sd) = (($sd) & 0xffff) + (($sd) >> 16); });
    }' unless defined(&CALC_SUMD);
    if(defined( &__NetBSD__) || defined( &__OpenBSD__)) {
    } else {
    }
}
1;
