require '_h2ph_pre.ph';

unless(defined(&__LINUX_IF_PACKET_H)) {
    eval 'sub __LINUX_IF_PACKET_H () {1;}' unless defined(&__LINUX_IF_PACKET_H);
    eval 'sub PACKET_HOST () {0;}' unless defined(&PACKET_HOST);
    eval 'sub PACKET_BROADCAST () {1;}' unless defined(&PACKET_BROADCAST);
    eval 'sub PACKET_MULTICAST () {2;}' unless defined(&PACKET_MULTICAST);
    eval 'sub PACKET_OTHERHOST () {3;}' unless defined(&PACKET_OTHERHOST);
    eval 'sub PACKET_OUTGOING () {4;}' unless defined(&PACKET_OUTGOING);
    eval 'sub PACKET_LOOPBACK () {5;}' unless defined(&PACKET_LOOPBACK);
    eval 'sub PACKET_FASTROUTE () {6;}' unless defined(&PACKET_FASTROUTE);
    eval 'sub PACKET_ADD_MEMBERSHIP () {1;}' unless defined(&PACKET_ADD_MEMBERSHIP);
    eval 'sub PACKET_DROP_MEMBERSHIP () {2;}' unless defined(&PACKET_DROP_MEMBERSHIP);
    eval 'sub PACKET_RECV_OUTPUT () {3;}' unless defined(&PACKET_RECV_OUTPUT);
    eval 'sub PACKET_RX_RING () {5;}' unless defined(&PACKET_RX_RING);
    eval 'sub PACKET_STATISTICS () {6;}' unless defined(&PACKET_STATISTICS);
    eval 'sub PACKET_COPY_THRESH () {7;}' unless defined(&PACKET_COPY_THRESH);
    eval 'sub TP_STATUS_KERNEL () {0;}' unless defined(&TP_STATUS_KERNEL);
    eval 'sub TP_STATUS_USER () {1;}' unless defined(&TP_STATUS_USER);
    eval 'sub TP_STATUS_COPY () {2;}' unless defined(&TP_STATUS_COPY);
    eval 'sub TP_STATUS_LOSING () {4;}' unless defined(&TP_STATUS_LOSING);
    eval 'sub TP_STATUS_CSUMNOTREADY () {8;}' unless defined(&TP_STATUS_CSUMNOTREADY);
    eval 'sub TPACKET_ALIGNMENT () {16;}' unless defined(&TPACKET_ALIGNMENT);
    eval 'sub TPACKET_ALIGN {
        local($x) = @_;
	    eval q(((($x)+ &TPACKET_ALIGNMENT-1)&~( &TPACKET_ALIGNMENT-1)));
    }' unless defined(&TPACKET_ALIGN);
    eval 'sub TPACKET_HDRLEN () {( &TPACKET_ALIGN($sizeof{\'struct tpacket_hdr\'}) + $sizeof{\'struct sockaddr_ll\'});}' unless defined(&TPACKET_HDRLEN);
    eval 'sub PACKET_MR_MULTICAST () {0;}' unless defined(&PACKET_MR_MULTICAST);
    eval 'sub PACKET_MR_PROMISC () {1;}' unless defined(&PACKET_MR_PROMISC);
    eval 'sub PACKET_MR_ALLMULTI () {2;}' unless defined(&PACKET_MR_ALLMULTI);
}
1;
