require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NETINET_IPSP_H_)) {
    eval 'sub _NETINET_IPSP_H_ () {1;}' unless defined(&_NETINET_IPSP_H_);
    require 'sys/types.ph';
    require 'sys/queue.ph';
    require 'sys/timeout.ph';
    require 'netinet/in.ph';
    eval 'sub MD5HMAC96_KEYSIZE () {16;}' unless defined(&MD5HMAC96_KEYSIZE);
    eval 'sub SHA1HMAC96_KEYSIZE () {20;}' unless defined(&SHA1HMAC96_KEYSIZE);
    eval 'sub RIPEMD160HMAC96_KEYSIZE () {20;}' unless defined(&RIPEMD160HMAC96_KEYSIZE);
    eval 'sub SHA2_256HMAC96_KEYSIZE () {32;}' unless defined(&SHA2_256HMAC96_KEYSIZE);
    eval 'sub SHA2_384HMAC96_KEYSIZE () {48;}' unless defined(&SHA2_384HMAC96_KEYSIZE);
    eval 'sub SHA2_512HMAC96_KEYSIZE () {64;}' unless defined(&SHA2_512HMAC96_KEYSIZE);
    eval 'sub AH_HMAC_HASHLEN () {12;}' unless defined(&AH_HMAC_HASHLEN);
    eval 'sub AH_HMAC_RPLENGTH () {4;}' unless defined(&AH_HMAC_RPLENGTH);
    eval 'sub AH_HMAC_INITIAL_RPL () {1;}' unless defined(&AH_HMAC_INITIAL_RPL);
    eval 'sub AH_MD5_ALEN () {16;}' unless defined(&AH_MD5_ALEN);
    eval 'sub AH_SHA1_ALEN () {20;}' unless defined(&AH_SHA1_ALEN);
    eval 'sub AH_RMD160_ALEN () {20;}' unless defined(&AH_RMD160_ALEN);
    eval 'sub AH_SHA2_256_ALEN () {32;}' unless defined(&AH_SHA2_256_ALEN);
    eval 'sub AH_SHA2_384_ALEN () {48;}' unless defined(&AH_SHA2_384_ALEN);
    eval 'sub AH_SHA2_512_ALEN () {64;}' unless defined(&AH_SHA2_512_ALEN);
    eval 'sub AH_ALEN_MAX () {64;}' unless defined(&AH_ALEN_MAX);
    eval 'sub SPI_LOCAL_USE () {0;}' unless defined(&SPI_LOCAL_USE);
    eval 'sub SPI_RESERVED_MIN () {1;}' unless defined(&SPI_RESERVED_MIN);
    eval 'sub SPI_RESERVED_MAX () {255;}' unless defined(&SPI_RESERVED_MAX);
    eval 'sub CPI_RESERVED_MIN () {1;}' unless defined(&CPI_RESERVED_MIN);
    eval 'sub CPI_RESERVED_MAX () {255;}' unless defined(&CPI_RESERVED_MAX);
    eval 'sub CPI_PRIVATE_MIN () {61440;}' unless defined(&CPI_PRIVATE_MIN);
    eval 'sub CPI_PRIVATE_MAX () {65535;}' unless defined(&CPI_PRIVATE_MAX);
    eval 'sub IPSEC_DEFAULT_EMBRYONIC_SA_TIMEOUT () {60;}' unless defined(&IPSEC_DEFAULT_EMBRYONIC_SA_TIMEOUT);
    eval 'sub IPSEC_DEFAULT_PFS () {1;}' unless defined(&IPSEC_DEFAULT_PFS);
    eval 'sub IPSEC_DEFAULT_SOFT_ALLOCATIONS () {0;}' unless defined(&IPSEC_DEFAULT_SOFT_ALLOCATIONS);
    eval 'sub IPSEC_DEFAULT_EXP_ALLOCATIONS () {0;}' unless defined(&IPSEC_DEFAULT_EXP_ALLOCATIONS);
    eval 'sub IPSEC_DEFAULT_SOFT_BYTES () {0;}' unless defined(&IPSEC_DEFAULT_SOFT_BYTES);
    eval 'sub IPSEC_DEFAULT_EXP_BYTES () {0;}' unless defined(&IPSEC_DEFAULT_EXP_BYTES);
    eval 'sub IPSEC_DEFAULT_SOFT_TIMEOUT () {80000;}' unless defined(&IPSEC_DEFAULT_SOFT_TIMEOUT);
    eval 'sub IPSEC_DEFAULT_EXP_TIMEOUT () {86400;}' unless defined(&IPSEC_DEFAULT_EXP_TIMEOUT);
    eval 'sub IPSEC_DEFAULT_SOFT_FIRST_USE () {3600;}' unless defined(&IPSEC_DEFAULT_SOFT_FIRST_USE);
    eval 'sub IPSEC_DEFAULT_EXP_FIRST_USE () {7200;}' unless defined(&IPSEC_DEFAULT_EXP_FIRST_USE);
    eval 'sub IPSEC_DEFAULT_DEF_ENC () {"aes";}' unless defined(&IPSEC_DEFAULT_DEF_ENC);
    eval 'sub IPSEC_DEFAULT_DEF_AUTH () {"hmac-sha1";}' unless defined(&IPSEC_DEFAULT_DEF_AUTH);
    eval 'sub IPSEC_DEFAULT_EXPIRE_ACQUIRE () {30;}' unless defined(&IPSEC_DEFAULT_EXPIRE_ACQUIRE);
    eval 'sub IPSEC_DEFAULT_DEF_COMP () {"deflate";}' unless defined(&IPSEC_DEFAULT_DEF_COMP);
    eval 'sub IPSP_DIRECTION_IN () {0x1;}' unless defined(&IPSP_DIRECTION_IN);
    eval 'sub IPSP_DIRECTION_OUT () {0x2;}' unless defined(&IPSP_DIRECTION_OUT);
    eval 'sub sen_data () { ($Sen->{Data});}' unless defined(&sen_data);
    eval 'sub sen_ip_src () { ($Sen->{Sip4}->{Src});}' unless defined(&sen_ip_src);
    eval 'sub sen_ip_dst () { ($Sen->{Sip4}->{Dst});}' unless defined(&sen_ip_dst);
    eval 'sub sen_proto () { ($Sen->{Sip4}->{Proto});}' unless defined(&sen_proto);
    eval 'sub sen_sport () { ($Sen->{Sip4}->{Sport});}' unless defined(&sen_sport);
    eval 'sub sen_dport () { ($Sen->{Sip4}->{Dport});}' unless defined(&sen_dport);
    eval 'sub sen_direction () { ($Sen->{Sip4}->{Direction});}' unless defined(&sen_direction);
    eval 'sub sen_ip6_src () { ($Sen->{Sip6}->{Src});}' unless defined(&sen_ip6_src);
    eval 'sub sen_ip6_dst () { ($Sen->{Sip6}->{Dst});}' unless defined(&sen_ip6_dst);
    eval 'sub sen_ip6_proto () { ($Sen->{Sip6}->{Proto});}' unless defined(&sen_ip6_proto);
    eval 'sub sen_ip6_sport () { ($Sen->{Sip6}->{Sport});}' unless defined(&sen_ip6_sport);
    eval 'sub sen_ip6_dport () { ($Sen->{Sip6}->{Dport});}' unless defined(&sen_ip6_dport);
    eval 'sub sen_ip6_direction () { ($Sen->{Sip6}->{Direction});}' unless defined(&sen_ip6_direction);
    eval 'sub sen_ipsp () { ($Sen->{PolicyHead});}' unless defined(&sen_ipsp);
    eval 'sub SENT_IP4 () {0x1;}' unless defined(&SENT_IP4);
    eval 'sub SENT_IPSP () {0x2;}' unless defined(&SENT_IPSP);
    eval 'sub SENT_IP6 () {0x4;}' unless defined(&SENT_IP6);
    eval 'sub SENT_LEN () {$sizeof{\'struct sockaddr_encap\'};}' unless defined(&SENT_LEN);
    eval 'sub IPSP_POLICY_NONE () {0x;}' unless defined(&IPSP_POLICY_NONE);
    eval 'sub IPSP_POLICY_SOCKET () {0x1;}' unless defined(&IPSP_POLICY_SOCKET);
    eval 'sub IPSP_POLICY_STATIC () {0x2;}' unless defined(&IPSP_POLICY_STATIC);
    eval 'sub IPSP_IPSEC_USE () {0;}' unless defined(&IPSP_IPSEC_USE);
    eval 'sub IPSP_IPSEC_ACQUIRE () {1;}' unless defined(&IPSP_IPSEC_ACQUIRE);
    eval 'sub IPSP_IPSEC_REQUIRE () {2;}' unless defined(&IPSP_IPSEC_REQUIRE);
    eval 'sub IPSP_PERMIT () {3;}' unless defined(&IPSP_PERMIT);
    eval 'sub IPSP_DENY () {4;}' unless defined(&IPSP_DENY);
    eval 'sub IPSP_IPSEC_DONTACQ () {5;}' unless defined(&IPSP_IPSEC_DONTACQ);
    eval 'sub NOTIFY_SOFT_EXPIRE () {0;}' unless defined(&NOTIFY_SOFT_EXPIRE);
    eval 'sub NOTIFY_HARD_EXPIRE () {1;}' unless defined(&NOTIFY_HARD_EXPIRE);
    eval 'sub NOTIFY_REQUEST_SA () {2;}' unless defined(&NOTIFY_REQUEST_SA);
    eval 'sub NOTIFY_SATYPE_CONF () {1;}' unless defined(&NOTIFY_SATYPE_CONF);
    eval 'sub NOTIFY_SATYPE_AUTH () {2;}' unless defined(&NOTIFY_SATYPE_AUTH);
    eval 'sub NOTIFY_SATYPE_TUNNEL () {4;}' unless defined(&NOTIFY_SATYPE_TUNNEL);
    eval 'sub NOTIFY_SATYPE_COMP () {5;}' unless defined(&NOTIFY_SATYPE_COMP);
    eval 'sub IPSP_AUTH_NONE () {0;}' unless defined(&IPSP_AUTH_NONE);
    eval 'sub IPSP_AUTH_PASSPHRASE () {1;}' unless defined(&IPSP_AUTH_PASSPHRASE);
    eval 'sub IPSP_AUTH_RSA () {2;}' unless defined(&IPSP_AUTH_RSA);
    eval 'sub IPSP_CRED_NONE () {0;}' unless defined(&IPSP_CRED_NONE);
    eval 'sub IPSP_CRED_KEYNOTE () {1;}' unless defined(&IPSP_CRED_KEYNOTE);
    eval 'sub IPSP_CRED_X509 () {2;}' unless defined(&IPSP_CRED_X509);
    eval 'sub IPSP_IDENTITY_NONE () {0;}' unless defined(&IPSP_IDENTITY_NONE);
    eval 'sub IPSP_IDENTITY_PREFIX () {1;}' unless defined(&IPSP_IDENTITY_PREFIX);
    eval 'sub IPSP_IDENTITY_FQDN () {2;}' unless defined(&IPSP_IDENTITY_FQDN);
    eval 'sub IPSP_IDENTITY_USERFQDN () {3;}' unless defined(&IPSP_IDENTITY_USERFQDN);
    eval 'sub IPSP_IDENTITY_CONNECTION () {4;}' unless defined(&IPSP_IDENTITY_CONNECTION);
    eval 'sub TDBF_UNIQUE () {0x1;}' unless defined(&TDBF_UNIQUE);
    eval 'sub TDBF_TIMER () {0x2;}' unless defined(&TDBF_TIMER);
    eval 'sub TDBF_BYTES () {0x4;}' unless defined(&TDBF_BYTES);
    eval 'sub TDBF_ALLOCATIONS () {0x8;}' unless defined(&TDBF_ALLOCATIONS);
    eval 'sub TDBF_INVALID () {0x10;}' unless defined(&TDBF_INVALID);
    eval 'sub TDBF_FIRSTUSE () {0x20;}' unless defined(&TDBF_FIRSTUSE);
    eval 'sub TDBF_HALFIV () {0x40;}' unless defined(&TDBF_HALFIV);
    eval 'sub TDBF_SOFT_TIMER () {0x80;}' unless defined(&TDBF_SOFT_TIMER);
    eval 'sub TDBF_SOFT_BYTES () {0x100;}' unless defined(&TDBF_SOFT_BYTES);
    eval 'sub TDBF_SOFT_ALLOCATIONS () {0x200;}' unless defined(&TDBF_SOFT_ALLOCATIONS);
    eval 'sub TDBF_SOFT_FIRSTUSE () {0x400;}' unless defined(&TDBF_SOFT_FIRSTUSE);
    eval 'sub TDBF_PFS () {0x800;}' unless defined(&TDBF_PFS);
    eval 'sub TDBF_TUNNELING () {0x1000;}' unless defined(&TDBF_TUNNELING);
    eval 'sub TDBF_NOREPLAY () {0x2000;}' unless defined(&TDBF_NOREPLAY);
    eval 'sub TDBF_RANDOMPADDING () {0x4000;}' unless defined(&TDBF_RANDOMPADDING);
    eval 'sub TDBF_SKIPCRYPTO () {0x8000;}' unless defined(&TDBF_SKIPCRYPTO);
    eval 'sub TDBF_USEDTUNNEL () {0x10000;}' unless defined(&TDBF_USEDTUNNEL);
    eval 'sub TDBF_UDPENCAP () {0x20000;}' unless defined(&TDBF_UDPENCAP);
    eval 'sub XF_IP4 () {1;}' unless defined(&XF_IP4);
    eval 'sub XF_AH () {2;}' unless defined(&XF_AH);
    eval 'sub XF_ESP () {3;}' unless defined(&XF_ESP);
    eval 'sub XF_TCPSIGNATURE () {5;}' unless defined(&XF_TCPSIGNATURE);
    eval 'sub XF_IPCOMP () {6;}' unless defined(&XF_IPCOMP);
    eval 'sub XFT_AUTH () {0x1;}' unless defined(&XFT_AUTH);
    eval 'sub XFT_CONF () {0x100;}' unless defined(&XFT_CONF);
    eval 'sub XFT_COMP () {0x1000;}' unless defined(&XFT_COMP);
    eval 'sub IPSEC_ZEROES_SIZE () {256;}' unless defined(&IPSEC_ZEROES_SIZE);
    if(defined(&_KERNEL)) {
	eval 'sub spltdb () { &splsoftnet;}' unless defined(&spltdb);
	eval 'sub TDB_ATTRIB {
	    my($x) = @_;
    	    eval q(((($x)-> &tdb_encalgxform ?  &NOTIFY_SATYPE_CONF : 0) | (($x)-> &tdb_authalgxform ?  &NOTIFY_SATYPE_AUTH : 0) | (($x)-> &tdb_compalgxform ?  &NOTIFY_SATYPE_COMP : 0)));
	}' unless defined(&TDB_ATTRIB);
	eval 'sub SPI_CHAIN_ATTRIB {
	    my($have, $TDB_DIR, $TDBP) = @_;
    	    eval q( &do { \'int\'  &s =  &spltdb(); \'struct tdb\' * &tmptdb = ($TDBP); ($have) = 0;  &while ( &tmptdb  &&  ($tmptdb->{tdb_xform})) {  &if ( &tmptdb ==  &NULL ||  ($tmptdb->{tdb_flags}) &  &TDBF_INVALID)  &break; ($have) |=  &TDB_ATTRIB( &tmptdb);  &tmptdb =  ($tmptdb->{TDB_DIR}); }  &splx( &s); }  &while (0));
	}' unless defined(&SPI_CHAIN_ATTRIB);
	if(defined(&INET)) {
	}
	if(defined(&INET6)) {
	}
	if(defined(&INET)) {
	}
	if(defined(&INET6)) {
	}
	if(defined(&INET)) {
	}
	if(defined(&INET6)) {
	}
	if(defined(&INET)) {
	}
	if(defined(&INET6)) {
	}
    }
}
1;
