require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NET_BPF_H_)) {
    eval 'sub _NET_BPF_H_ () {1;}' unless defined(&_NET_BPF_H_);
    require 'sys/ioccom.ph';
    require 'sys/time.ph';
    eval 'sub BPF_RELEASE () {199606;}' unless defined(&BPF_RELEASE);
    eval 'sub BPF_COP_EXTMEM_RELEASE () {20140624;}' unless defined(&BPF_COP_EXTMEM_RELEASE);
    eval 'sub BPF_ALIGNMENT () {$sizeof{\'long\'};}' unless defined(&BPF_ALIGNMENT);
    eval 'sub BPF_ALIGNMENT32 () {$sizeof{\'int\'};}' unless defined(&BPF_ALIGNMENT32);
    eval 'sub BPF_WORDALIGN {
        my($x) = @_;
	    eval q(((($x)+( &BPF_ALIGNMENT-1))&~( &BPF_ALIGNMENT-1)));
    }' unless defined(&BPF_WORDALIGN);
    eval 'sub BPF_WORDALIGN32 {
        my($x) = @_;
	    eval q(((($x)+( &BPF_ALIGNMENT32-1))&~( &BPF_ALIGNMENT32-1)));
    }' unless defined(&BPF_WORDALIGN32);
    eval 'sub BPF_MAXINSNS () {512;}' unless defined(&BPF_MAXINSNS);
    eval 'sub BPF_DFLTBUFSIZE () {(1024*1024);}' unless defined(&BPF_DFLTBUFSIZE);
    eval 'sub BPF_MAXBUFSIZE () {(1024*1024*16);}' unless defined(&BPF_MAXBUFSIZE);
    eval 'sub BPF_MINBUFSIZE () {32;}' unless defined(&BPF_MINBUFSIZE);
    eval 'sub BPF_MAJOR_VERSION () {1;}' unless defined(&BPF_MAJOR_VERSION);
    eval 'sub BPF_MINOR_VERSION () {1;}' unless defined(&BPF_MINOR_VERSION);
    eval 'sub BIOCGBLEN () { &_IOR(ord(\'B\'), 102, \'u_int\');}' unless defined(&BIOCGBLEN);
    eval 'sub BIOCSBLEN () { &_IOWR(ord(\'B\'), 102, \'u_int\');}' unless defined(&BIOCSBLEN);
    eval 'sub BIOCSETF () { &_IOW(ord(\'B\'), 103, \'struct bpf_program\');}' unless defined(&BIOCSETF);
    eval 'sub BIOCFLUSH () { &_IO(ord(\'B\'), 104);}' unless defined(&BIOCFLUSH);
    eval 'sub BIOCPROMISC () { &_IO(ord(\'B\'), 105);}' unless defined(&BIOCPROMISC);
    eval 'sub BIOCGDLT () { &_IOR(ord(\'B\'), 106, \'u_int\');}' unless defined(&BIOCGDLT);
    eval 'sub BIOCGETIF () { &_IOR(ord(\'B\'), 107, \'struct ifreq\');}' unless defined(&BIOCGETIF);
    eval 'sub BIOCSETIF () { &_IOW(ord(\'B\'), 108, \'struct ifreq\');}' unless defined(&BIOCSETIF);
    if(defined(&COMPAT_50)) {
	require 'compat/sys/time.ph';
	eval 'sub BIOCSORTIMEOUT () { &_IOW(ord(\'B\'), 109, \'struct timeval50\');}' unless defined(&BIOCSORTIMEOUT);
	eval 'sub BIOCGORTIMEOUT () { &_IOR(ord(\'B\'), 110, \'struct timeval50\');}' unless defined(&BIOCGORTIMEOUT);
    }
    eval 'sub BIOCGSTATS () { &_IOR(ord(\'B\'), 111, \'struct bpf_stat\');}' unless defined(&BIOCGSTATS);
    eval 'sub BIOCGSTATSOLD () { &_IOR(ord(\'B\'), 111, \'struct bpf_stat_old\');}' unless defined(&BIOCGSTATSOLD);
    eval 'sub BIOCIMMEDIATE () { &_IOW(ord(\'B\'), 112, \'u_int\');}' unless defined(&BIOCIMMEDIATE);
    eval 'sub BIOCVERSION () { &_IOR(ord(\'B\'), 113, \'struct bpf_version\');}' unless defined(&BIOCVERSION);
    eval 'sub BIOCSTCPF () { &_IOW(ord(\'B\'), 114, \'struct bpf_program\');}' unless defined(&BIOCSTCPF);
    eval 'sub BIOCSUDPF () { &_IOW(ord(\'B\'), 115, \'struct bpf_program\');}' unless defined(&BIOCSUDPF);
    eval 'sub BIOCGHDRCMPLT () { &_IOR(ord(\'B\'), 116, \'u_int\');}' unless defined(&BIOCGHDRCMPLT);
    eval 'sub BIOCSHDRCMPLT () { &_IOW(ord(\'B\'), 117, \'u_int\');}' unless defined(&BIOCSHDRCMPLT);
    eval 'sub BIOCSDLT () { &_IOW(ord(\'B\'), 118, \'u_int\');}' unless defined(&BIOCSDLT);
    eval 'sub BIOCGDLTLIST () { &_IOWR(ord(\'B\'), 119, \'struct bpf_dltlist\');}' unless defined(&BIOCGDLTLIST);
    eval 'sub BIOCGDIRECTION () { &_IOR(ord(\'B\'), 120, \'u_int\');}' unless defined(&BIOCGDIRECTION);
    eval 'sub BIOCSDIRECTION () { &_IOW(ord(\'B\'), 121, \'u_int\');}' unless defined(&BIOCSDIRECTION);
    eval 'sub BIOCSRTIMEOUT () { &_IOW(ord(\'B\'), 122, \'struct timeval\');}' unless defined(&BIOCSRTIMEOUT);
    eval 'sub BIOCGRTIMEOUT () { &_IOR(ord(\'B\'), 123, \'struct timeval\');}' unless defined(&BIOCGRTIMEOUT);
    eval 'sub BIOCGFEEDBACK () { &_IOR(ord(\'B\'), 124, \'u_int\');}' unless defined(&BIOCGFEEDBACK);
    eval 'sub BIOCSFEEDBACK () { &_IOW(ord(\'B\'), 125, \'u_int\');}' unless defined(&BIOCSFEEDBACK);
    eval 'sub BIOCFEEDBACK () { &BIOCSFEEDBACK;}' unless defined(&BIOCFEEDBACK);
    eval 'sub BIOCLOCK () { &_IO(ord(\'B\'), 126);}' unless defined(&BIOCLOCK);
    eval 'sub BIOCSETWF () { &_IOW(ord(\'B\'), 127, \'struct bpf_program\');}' unless defined(&BIOCSETWF);
    eval 'sub BIOCGSEESENT () { &BIOCGDIRECTION;}' unless defined(&BIOCGSEESENT);
    eval 'sub BIOCSSEESENT () { &BIOCSDIRECTION;}' unless defined(&BIOCSSEESENT);
    eval 'sub BPF_D_IN () {0;}' unless defined(&BPF_D_IN);
    eval 'sub BPF_D_INOUT () {1;}' unless defined(&BPF_D_INOUT);
    eval 'sub BPF_D_OUT () {2;}' unless defined(&BPF_D_OUT);
    if(defined(&_KERNEL)) {
	if(defined(&__mips64)) {
	    eval 'sub SIZEOF_BPF_HDR () {$sizeof{\'struct bpf_hdr\'};}' unless defined(&SIZEOF_BPF_HDR);
	    eval 'sub SIZEOF_BPF_HDR32 () {18;}' unless defined(&SIZEOF_BPF_HDR32);
	}
 elsif(defined(&__arm32__) || defined(&__i386__) || defined(&__m68k__) || defined(&__mips__) || defined(&__ns32k__) || defined(&__vax__) || defined(&__sh__) || (defined(&__sparc__)  && !defined(&__sparc64__))) {
	    eval 'sub SIZEOF_BPF_HDR () {18;}' unless defined(&SIZEOF_BPF_HDR);
	    eval 'sub SIZEOF_BPF_HDR32 () {18;}' unless defined(&SIZEOF_BPF_HDR32);
	} else {
	    eval 'sub SIZEOF_BPF_HDR () {$sizeof{\'struct bpf_hdr\'};}' unless defined(&SIZEOF_BPF_HDR);
	    eval 'sub SIZEOF_BPF_HDR32 () {$sizeof{\'struct bpf_hdr32\'};}' unless defined(&SIZEOF_BPF_HDR32);
	}
    }
    require 'net/dlt.ph';
    eval 'sub BPF_CLASS {
        my($code) = @_;
	    eval q((($code) & 0x7));
    }' unless defined(&BPF_CLASS);
    eval 'sub BPF_LD () {0x;}' unless defined(&BPF_LD);
    eval 'sub BPF_LDX () {0x1;}' unless defined(&BPF_LDX);
    eval 'sub BPF_ST () {0x2;}' unless defined(&BPF_ST);
    eval 'sub BPF_STX () {0x3;}' unless defined(&BPF_STX);
    eval 'sub BPF_ALU () {0x4;}' unless defined(&BPF_ALU);
    eval 'sub BPF_JMP () {0x5;}' unless defined(&BPF_JMP);
    eval 'sub BPF_RET () {0x6;}' unless defined(&BPF_RET);
    eval 'sub BPF_MISC () {0x7;}' unless defined(&BPF_MISC);
    eval 'sub BPF_SIZE {
        my($code) = @_;
	    eval q((($code) & 0x18));
    }' unless defined(&BPF_SIZE);
    eval 'sub BPF_W () {0x;}' unless defined(&BPF_W);
    eval 'sub BPF_H () {0x8;}' unless defined(&BPF_H);
    eval 'sub BPF_B () {0x10;}' unless defined(&BPF_B);
    eval 'sub BPF_MODE {
        my($code) = @_;
	    eval q((($code) & 0xe0));
    }' unless defined(&BPF_MODE);
    eval 'sub BPF_IMM () {0x;}' unless defined(&BPF_IMM);
    eval 'sub BPF_ABS () {0x20;}' unless defined(&BPF_ABS);
    eval 'sub BPF_IND () {0x40;}' unless defined(&BPF_IND);
    eval 'sub BPF_MEM () {0x60;}' unless defined(&BPF_MEM);
    eval 'sub BPF_LEN () {0x80;}' unless defined(&BPF_LEN);
    eval 'sub BPF_MSH () {0xa0;}' unless defined(&BPF_MSH);
    eval 'sub BPF_OP {
        my($code) = @_;
	    eval q((($code) & 0xf0));
    }' unless defined(&BPF_OP);
    eval 'sub BPF_ADD () {0x;}' unless defined(&BPF_ADD);
    eval 'sub BPF_SUB () {0x10;}' unless defined(&BPF_SUB);
    eval 'sub BPF_MUL () {0x20;}' unless defined(&BPF_MUL);
    eval 'sub BPF_DIV () {0x30;}' unless defined(&BPF_DIV);
    eval 'sub BPF_OR () {0x40;}' unless defined(&BPF_OR);
    eval 'sub BPF_AND () {0x50;}' unless defined(&BPF_AND);
    eval 'sub BPF_LSH () {0x60;}' unless defined(&BPF_LSH);
    eval 'sub BPF_RSH () {0x70;}' unless defined(&BPF_RSH);
    eval 'sub BPF_NEG () {0x80;}' unless defined(&BPF_NEG);
    eval 'sub BPF_MOD () {0x90;}' unless defined(&BPF_MOD);
    eval 'sub BPF_XOR () {0xa0;}' unless defined(&BPF_XOR);
    eval 'sub BPF_JA () {0x;}' unless defined(&BPF_JA);
    eval 'sub BPF_JEQ () {0x10;}' unless defined(&BPF_JEQ);
    eval 'sub BPF_JGT () {0x20;}' unless defined(&BPF_JGT);
    eval 'sub BPF_JGE () {0x30;}' unless defined(&BPF_JGE);
    eval 'sub BPF_JSET () {0x40;}' unless defined(&BPF_JSET);
    eval 'sub BPF_SRC {
        my($code) = @_;
	    eval q((($code) & 0x8));
    }' unless defined(&BPF_SRC);
    eval 'sub BPF_K () {0x;}' unless defined(&BPF_K);
    eval 'sub BPF_X () {0x8;}' unless defined(&BPF_X);
    eval 'sub BPF_RVAL {
        my($code) = @_;
	    eval q((($code) & 0x18));
    }' unless defined(&BPF_RVAL);
    eval 'sub BPF_A () {0x10;}' unless defined(&BPF_A);
    eval 'sub BPF_MISCOP {
        my($code) = @_;
	    eval q((($code) & 0xf8));
    }' unless defined(&BPF_MISCOP);
    eval 'sub BPF_TAX () {0x;}' unless defined(&BPF_TAX);
    eval 'sub BPF_COP () {0x20;}' unless defined(&BPF_COP);
    eval 'sub BPF_COPX () {0x40;}' unless defined(&BPF_COPX);
    eval 'sub BPF_TXA () {0x80;}' unless defined(&BPF_TXA);
    eval 'sub BPF_STMT {
        my($code, $k) = @_;
	    eval q({ ( &uint16_t)($code), 0, 0, $k });
    }' unless defined(&BPF_STMT);
    eval 'sub BPF_JUMP {
        my($code, $k, $jt, $jf) = @_;
	    eval q({ ( &uint16_t)($code), $jt, $jf, $k });
    }' unless defined(&BPF_JUMP);
    eval 'sub BPF_MEMWORDS () {16;}' unless defined(&BPF_MEMWORDS);
    eval 'sub BPF_MEMWORD_INIT {
        my($k) = @_;
	    eval q(( &UINT32_C(1) << ($k)));
    }' unless defined(&BPF_MEMWORD_INIT);
    if(defined(&_KERNEL)) {
	eval 'sub BPF_MAX_MEMWORDS () {30;}' unless defined(&BPF_MAX_MEMWORDS);
    }
    if(defined(&_KERNEL) || defined(&__BPF_PRIVATE)) {
    }
    if(defined(&_KERNEL)) {
	require 'net/bpfjit.ph';
	require 'net/if.ph';
	eval 'sub bpf_attach {
	    my($_ifp,$_dlt,$_hdrlen) = @_;
    	    eval q({  ($bpf_ops->{bpf_attach})($_ifp, $_dlt, $_hdrlen, & ($_ifp->{if_bpf})); });
	}' unless defined(&bpf_attach);
	eval 'sub bpf_attach2 {
	    my($_ifp,$_dlt,$_hdrlen,$_dp) = @_;
    	    eval q({  ($bpf_ops->{bpf_attach})($_ifp, $_dlt, $_hdrlen, $_dp); });
	}' unless defined(&bpf_attach2);
	eval 'sub bpf_mtap {
	    my($_ifp,$_m,$_direction) = @_;
    	    eval q({  &if ( ($_ifp->{if_bpf})) {  &if ( ($_ifp->{if_bpf_mtap})) {  ($_ifp->{if_bpf_mtap})( ($_ifp->{if_bpf}), $_m, $_direction); }  &else {  ($bpf_ops->{bpf_mtap})( ($_ifp->{if_bpf}), $_m, $_direction); } } });
	}' unless defined(&bpf_mtap);
	eval 'sub bpf_mtap2 {
	    my($_bpf,$_data,$_dlen,$_m,$_direction) = @_;
    	    eval q({  ($bpf_ops->{bpf_mtap2})($_bpf, $_data, $_dlen, $_m, $_direction); });
	}' unless defined(&bpf_mtap2);
	eval 'sub bpf_mtap3 {
	    my($_bpf,$_m,$_direction) = @_;
    	    eval q({  &if ($_bpf)  ($bpf_ops->{bpf_mtap})($_bpf, $_m, $_direction); });
	}' unless defined(&bpf_mtap3);
	eval 'sub bpf_mtap_af {
	    my($_ifp,$_af,$_m,$_direction) = @_;
    	    eval q({  &if ( ($_ifp->{if_bpf}))  ($bpf_ops->{bpf_mtap_af})( ($_ifp->{if_bpf}), $_af, $_m, $_direction); });
	}' unless defined(&bpf_mtap_af);
	eval 'sub bpf_change_type {
	    my($_ifp,$_dlt,$_hdrlen) = @_;
    	    eval q({  ($bpf_ops->{bpf_change_type})($_ifp, $_dlt, $_hdrlen); });
	}' unless defined(&bpf_change_type);
	eval 'sub bpf_peers_present {
	    my($dp) = @_;
    	    eval q({ $dp !=  &NULL; });
	}' unless defined(&bpf_peers_present);
	eval 'sub bpf_detach {
	    my($_ifp) = @_;
    	    eval q({  ($bpf_ops->{bpf_detach})($_ifp); });
	}' unless defined(&bpf_detach);
	eval 'sub bpf_mtap_sl_in {
	    my($_ifp,$_hdr,$_m) = @_;
    	    eval q({  ($bpf_ops->{bpf_mtap_sl_in})( ($_ifp->{if_bpf}), $_hdr, $_m); });
	}' unless defined(&bpf_mtap_sl_in);
	eval 'sub bpf_mtap_sl_out {
	    my($_ifp,$_hdr,$_m) = @_;
    	    eval q({  &if ( ($_ifp->{if_bpf}))  ($bpf_ops->{bpf_mtap_sl_out})( ($_ifp->{if_bpf}), $_hdr, $_m); });
	}' unless defined(&bpf_mtap_sl_out);
	eval 'sub bpf_mtap_softint_init {
	    my($_ifp) = @_;
    	    eval q({  ($bpf_ops->{bpf_mtap_softint_init})($_ifp); });
	}' unless defined(&bpf_mtap_softint_init);
	eval 'sub bpf_mtap_softint {
	    my($_ifp,$_m) = @_;
    	    eval q({  &if ( ($_ifp->{if_bpf}))  ($bpf_ops->{bpf_mtap_softint})($_ifp, $_m); });
	}' unless defined(&bpf_mtap_softint);
	eval 'sub bpf_register_track_event () {
	    eval q((\'struct bpf_if\' ** &_dp,  &void (* &_fun)(\'struct bpf_if\' *, \'struct ifnet\' *, \'int\', \'int\')) {  &if ( ($bpf_ops->{bpf_register_track_event}) ==  &NULL)  &ENXIO;  ($bpf_ops->{bpf_register_track_event})( &_dp,  &_fun); });
	}' unless defined(&bpf_register_track_event);
	eval 'sub bpf_deregister_track_event () {
	    eval q((\'struct bpf_if\' ** &_dp,  &void (* &_fun)(\'struct bpf_if\' *, \'struct ifnet\' *, \'int\', \'int\')) {  &if ( ($bpf_ops->{bpf_deregister_track_event}) ==  &NULL)  &ENXIO;  ($bpf_ops->{bpf_deregister_track_event})( &_dp,  &_fun); });
	}' unless defined(&bpf_deregister_track_event);
    }
    eval 'sub BPF_TRACK_EVENT_ATTACH () {1;}' unless defined(&BPF_TRACK_EVENT_ATTACH);
    eval 'sub BPF_TRACK_EVENT_DETACH () {2;}' unless defined(&BPF_TRACK_EVENT_DETACH);
}
1;
