require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&lib_pcap_pcap_h)) {
    eval 'sub lib_pcap_pcap_h () {1;}' unless defined(&lib_pcap_pcap_h);
    require 'pcap/funcattrs.ph';
    require 'pcap/pcap-inttypes.ph';
    if(defined(&_WIN32)) {
	require 'winsock2.ph';
	require 'io.ph';
    }
 elsif(defined(&MSDOS)) {
	require 'sys/types.ph';
	require 'sys/socket.ph';
    } else {
	require 'sys/types.ph';
	require 'sys/time.ph';
    }
    require 'pcap/socket.ph';
    unless(defined(&PCAP_DONT_INCLUDE_PCAP_BPF_H)) {
	require 'pcap/bpf.ph';
    } else {
	require 'net/bpf.ph';
    }
    require 'stdio.ph';
    if(defined(&__cplusplus)) {
    }
    eval 'sub PCAP_VERSION_MAJOR () {2;}' unless defined(&PCAP_VERSION_MAJOR);
    eval 'sub PCAP_VERSION_MINOR () {4;}' unless defined(&PCAP_VERSION_MINOR);
    eval 'sub PCAP_ERRBUF_SIZE () {256;}' unless defined(&PCAP_ERRBUF_SIZE);
    if((defined(&BPF_RELEASE) ? &BPF_RELEASE : undef) - 0< 199406) {
    }
    eval 'sub LT_FCS_LENGTH_PRESENT {
        my($x) = @_;
	    eval q((($x) & 0x4000000));
    }' unless defined(&LT_FCS_LENGTH_PRESENT);
    eval 'sub LT_FCS_LENGTH {
        my($x) = @_;
	    eval q(((($x) & 0xf0000000) >> 28));
    }' unless defined(&LT_FCS_LENGTH);
    eval 'sub LT_FCS_DATALINK_EXT {
        my($x) = @_;
	    eval q((((($x) & 0xf) << 28) | 0x4000000));
    }' unless defined(&LT_FCS_DATALINK_EXT);
    eval("sub PCAP_D_INOUT () { 0; }") unless defined(&PCAP_D_INOUT);
    eval("sub PCAP_D_IN () { 1; }") unless defined(&PCAP_D_IN);
    eval("sub PCAP_D_OUT () { 2; }") unless defined(&PCAP_D_OUT);
    if(defined(&_WIN32)) {
    }
    if(defined(&MSDOS)) {
    }
    eval 'sub PCAP_IF_LOOPBACK () {0x1;}' unless defined(&PCAP_IF_LOOPBACK);
    eval 'sub PCAP_IF_UP () {0x2;}' unless defined(&PCAP_IF_UP);
    eval 'sub PCAP_IF_RUNNING () {0x4;}' unless defined(&PCAP_IF_RUNNING);
    eval 'sub PCAP_IF_WIRELESS () {0x8;}' unless defined(&PCAP_IF_WIRELESS);
    eval 'sub PCAP_IF_CONNECTION_STATUS () {0x30;}' unless defined(&PCAP_IF_CONNECTION_STATUS);
    eval 'sub PCAP_IF_CONNECTION_STATUS_UNKNOWN () {0x;}' unless defined(&PCAP_IF_CONNECTION_STATUS_UNKNOWN);
    eval 'sub PCAP_IF_CONNECTION_STATUS_CONNECTED () {0x10;}' unless defined(&PCAP_IF_CONNECTION_STATUS_CONNECTED);
    eval 'sub PCAP_IF_CONNECTION_STATUS_DISCONNECTED () {0x20;}' unless defined(&PCAP_IF_CONNECTION_STATUS_DISCONNECTED);
    eval 'sub PCAP_IF_CONNECTION_STATUS_NOT_APPLICABLE () {0x30;}' unless defined(&PCAP_IF_CONNECTION_STATUS_NOT_APPLICABLE);
    eval 'sub PCAP_ERROR () {-1;}' unless defined(&PCAP_ERROR);
    eval 'sub PCAP_ERROR_BREAK () {-2;}' unless defined(&PCAP_ERROR_BREAK);
    eval 'sub PCAP_ERROR_NOT_ACTIVATED () {-3;}' unless defined(&PCAP_ERROR_NOT_ACTIVATED);
    eval 'sub PCAP_ERROR_ACTIVATED () {-4;}' unless defined(&PCAP_ERROR_ACTIVATED);
    eval 'sub PCAP_ERROR_NO_SUCH_DEVICE () {-5;}' unless defined(&PCAP_ERROR_NO_SUCH_DEVICE);
    eval 'sub PCAP_ERROR_RFMON_NOTSUP () {-6;}' unless defined(&PCAP_ERROR_RFMON_NOTSUP);
    eval 'sub PCAP_ERROR_NOT_RFMON () {-7;}' unless defined(&PCAP_ERROR_NOT_RFMON);
    eval 'sub PCAP_ERROR_PERM_DENIED () {-8;}' unless defined(&PCAP_ERROR_PERM_DENIED);
    eval 'sub PCAP_ERROR_IFACE_NOT_UP () {-9;}' unless defined(&PCAP_ERROR_IFACE_NOT_UP);
    eval 'sub PCAP_ERROR_CANTSET_TSTAMP_TYPE () {-10;}' unless defined(&PCAP_ERROR_CANTSET_TSTAMP_TYPE);
    eval 'sub PCAP_ERROR_PROMISC_PERM_DENIED () {-11;}' unless defined(&PCAP_ERROR_PROMISC_PERM_DENIED);
    eval 'sub PCAP_ERROR_TSTAMP_PRECISION_NOTSUP () {-12;}' unless defined(&PCAP_ERROR_TSTAMP_PRECISION_NOTSUP);
    eval 'sub PCAP_WARNING () {1;}' unless defined(&PCAP_WARNING);
    eval 'sub PCAP_WARNING_PROMISC_NOTSUP () {2;}' unless defined(&PCAP_WARNING_PROMISC_NOTSUP);
    eval 'sub PCAP_WARNING_TSTAMP_TYPE_NOTSUP () {3;}' unless defined(&PCAP_WARNING_TSTAMP_TYPE_NOTSUP);
    eval 'sub PCAP_NETMASK_UNKNOWN () {0xffffffff;}' unless defined(&PCAP_NETMASK_UNKNOWN);
    if(defined(&__linux__)) {
    }
    eval 'sub PCAP_TSTAMP_HOST () {0;}' unless defined(&PCAP_TSTAMP_HOST);
    eval 'sub PCAP_TSTAMP_HOST_LOWPREC () {1;}' unless defined(&PCAP_TSTAMP_HOST_LOWPREC);
    eval 'sub PCAP_TSTAMP_HOST_HIPREC () {2;}' unless defined(&PCAP_TSTAMP_HOST_HIPREC);
    eval 'sub PCAP_TSTAMP_ADAPTER () {3;}' unless defined(&PCAP_TSTAMP_ADAPTER);
    eval 'sub PCAP_TSTAMP_ADAPTER_UNSYNCED () {4;}' unless defined(&PCAP_TSTAMP_ADAPTER_UNSYNCED);
    eval 'sub PCAP_TSTAMP_PRECISION_MICRO () {0;}' unless defined(&PCAP_TSTAMP_PRECISION_MICRO);
    eval 'sub PCAP_TSTAMP_PRECISION_NANO () {1;}' unless defined(&PCAP_TSTAMP_PRECISION_NANO);
    if(defined(&_WIN32)) {
	unless(defined(&BUILDING_PCAP)) {
	    eval 'sub pcap_fopen_offline_with_tstamp_precision {
	        my($f,$p,$b) = @_;
    		eval q( &pcap_hopen_offline_with_tstamp_precision( &_get_osfhandle( &_fileno($f)), $p, $b));
	    }' unless defined(&pcap_fopen_offline_with_tstamp_precision);
	    eval 'sub pcap_fopen_offline {
	        my($f,$b) = @_;
    		eval q( &pcap_hopen_offline( &_get_osfhandle( &_fileno($f)), $b));
	    }' unless defined(&pcap_fopen_offline);
	}
    } else {
    }
    if(defined(&_WIN32)) {
    }
    if(defined(&_WIN32)) {
	unless(defined(&BUILDING_PCAP)) {
	    eval 'sub pcap_dump_fopen {
	        my($p,$f) = @_;
    		eval q( &pcap_dump_hopen($p,  &_get_osfhandle( &_fileno($f))));
	    }' unless defined(&pcap_dump_fopen);
	}
    } else {
    }
    if(!defined(&__NetBSD__)  && !defined(&__QNX__)) {
    }
    if(defined(&_WIN32)) {
	if(!defined(&AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_)) {
	    eval 'sub AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ () {1;}' unless defined(&AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_);
	}
	eval 'sub MODE_CAPT () {0;}' unless defined(&MODE_CAPT);
	eval 'sub MODE_STAT () {1;}' unless defined(&MODE_STAT);
	eval 'sub MODE_MON () {2;}' unless defined(&MODE_MON);
    }
 elsif(defined(&MSDOS)) {
    } else {
    }
    eval 'sub PCAP_BUF_SIZE () {1024;}' unless defined(&PCAP_BUF_SIZE);
    eval 'sub PCAP_SRC_FILE () {2;}' unless defined(&PCAP_SRC_FILE);
    eval 'sub PCAP_SRC_IFLOCAL () {3;}' unless defined(&PCAP_SRC_IFLOCAL);
    eval 'sub PCAP_SRC_IFREMOTE () {4;}' unless defined(&PCAP_SRC_IFREMOTE);
    eval 'sub PCAP_SRC_FILE_STRING () {"file://";}' unless defined(&PCAP_SRC_FILE_STRING);
    eval 'sub PCAP_SRC_IF_STRING () {"rpcap://";}' unless defined(&PCAP_SRC_IF_STRING);
    eval 'sub PCAP_OPENFLAG_PROMISCUOUS () {0x1;}' unless defined(&PCAP_OPENFLAG_PROMISCUOUS);
    eval 'sub PCAP_OPENFLAG_DATATX_UDP () {0x2;}' unless defined(&PCAP_OPENFLAG_DATATX_UDP);
    eval 'sub PCAP_OPENFLAG_NOCAPTURE_RPCAP () {0x4;}' unless defined(&PCAP_OPENFLAG_NOCAPTURE_RPCAP);
    eval 'sub PCAP_OPENFLAG_NOCAPTURE_LOCAL () {0x8;}' unless defined(&PCAP_OPENFLAG_NOCAPTURE_LOCAL);
    eval 'sub PCAP_OPENFLAG_MAX_RESPONSIVENESS () {0x10;}' unless defined(&PCAP_OPENFLAG_MAX_RESPONSIVENESS);
    eval 'sub RPCAP_RMTAUTH_NULL () {0;}' unless defined(&RPCAP_RMTAUTH_NULL);
    eval 'sub RPCAP_RMTAUTH_PWD () {1;}' unless defined(&RPCAP_RMTAUTH_PWD);
    eval 'sub PCAP_SAMP_NOSAMP () {0;}' unless defined(&PCAP_SAMP_NOSAMP);
    eval 'sub PCAP_SAMP_1_EVERY_N () {1;}' unless defined(&PCAP_SAMP_1_EVERY_N);
    eval 'sub PCAP_SAMP_FIRST_AFTER_N_MS () {2;}' unless defined(&PCAP_SAMP_FIRST_AFTER_N_MS);
    eval 'sub RPCAP_HOSTLIST_SIZE () {1024;}' unless defined(&RPCAP_HOSTLIST_SIZE);
    if(defined(&__cplusplus)) {
    }
}
1;
