require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NET80211__IEEE80211_H_)) {
    eval 'sub _NET80211__IEEE80211_H_ () {1;}' unless defined(&_NET80211__IEEE80211_H_);
    eval("sub IEEE80211_T_DS () { 0; }") unless defined(&IEEE80211_T_DS);
    eval("sub IEEE80211_T_FH () { 1; }") unless defined(&IEEE80211_T_FH);
    eval("sub IEEE80211_T_OFDM () { 2; }") unless defined(&IEEE80211_T_OFDM);
    eval("sub IEEE80211_T_TURBO () { 3; }") unless defined(&IEEE80211_T_TURBO);
    eval 'sub IEEE80211_T_CCK () { &IEEE80211_T_DS;}' unless defined(&IEEE80211_T_CCK);
    eval("sub IEEE80211_MODE_AUTO () { 0; }") unless defined(&IEEE80211_MODE_AUTO);
    eval("sub IEEE80211_MODE_11A () { 1; }") unless defined(&IEEE80211_MODE_11A);
    eval("sub IEEE80211_MODE_11B () { 2; }") unless defined(&IEEE80211_MODE_11B);
    eval("sub IEEE80211_MODE_11G () { 3; }") unless defined(&IEEE80211_MODE_11G);
    eval("sub IEEE80211_MODE_FH () { 4; }") unless defined(&IEEE80211_MODE_FH);
    eval("sub IEEE80211_MODE_TURBO_A () { 5; }") unless defined(&IEEE80211_MODE_TURBO_A);
    eval("sub IEEE80211_MODE_TURBO_G () { 6; }") unless defined(&IEEE80211_MODE_TURBO_G);
    eval 'sub IEEE80211_MODE_MAX () {( &IEEE80211_MODE_TURBO_G + 1);}' unless defined(&IEEE80211_MODE_MAX);
    eval("sub IEEE80211_M_STA () { 1; }") unless defined(&IEEE80211_M_STA);
    eval("sub IEEE80211_M_IBSS () { 0; }") unless defined(&IEEE80211_M_IBSS);
    eval("sub IEEE80211_M_AHDEMO () { 3; }") unless defined(&IEEE80211_M_AHDEMO);
    eval("sub IEEE80211_M_HOSTAP () { 6; }") unless defined(&IEEE80211_M_HOSTAP);
    eval("sub IEEE80211_M_MONITOR () { 8; }") unless defined(&IEEE80211_M_MONITOR);
    eval("sub IEEE80211_PROT_NONE () { 0; }") unless defined(&IEEE80211_PROT_NONE);
    eval("sub IEEE80211_PROT_CTSONLY () { 1; }") unless defined(&IEEE80211_PROT_CTSONLY);
    eval("sub IEEE80211_PROT_RTSCTS () { 2; }") unless defined(&IEEE80211_PROT_RTSCTS);
    eval("sub IEEE80211_AUTH_NONE () { 0; }") unless defined(&IEEE80211_AUTH_NONE);
    eval("sub IEEE80211_AUTH_OPEN () { 1; }") unless defined(&IEEE80211_AUTH_OPEN);
    eval("sub IEEE80211_AUTH_SHARED () { 2; }") unless defined(&IEEE80211_AUTH_SHARED);
    eval("sub IEEE80211_AUTH_8021X () { 3; }") unless defined(&IEEE80211_AUTH_8021X);
    eval("sub IEEE80211_AUTH_AUTO () { 4; }") unless defined(&IEEE80211_AUTH_AUTO);
    eval("sub IEEE80211_AUTH_WPA () { 5; }") unless defined(&IEEE80211_AUTH_WPA);
    eval("sub IEEE80211_ROAMING_DEVICE () { 0; }") unless defined(&IEEE80211_ROAMING_DEVICE);
    eval("sub IEEE80211_ROAMING_AUTO () { 1; }") unless defined(&IEEE80211_ROAMING_AUTO);
    eval("sub IEEE80211_ROAMING_MANUAL () { 2; }") unless defined(&IEEE80211_ROAMING_MANUAL);
    eval 'sub IEEE80211_CHAN_MAX () {255;}' unless defined(&IEEE80211_CHAN_MAX);
    eval 'sub IEEE80211_CHAN_BYTES () {32;}' unless defined(&IEEE80211_CHAN_BYTES);
    eval 'sub IEEE80211_CHAN_ANY () {0xffff;}' unless defined(&IEEE80211_CHAN_ANY);
    eval 'sub IEEE80211_CHAN_ANYC () {( &__UNCONST( &ieee80211_channel_anyc));}' unless defined(&IEEE80211_CHAN_ANYC);
    eval 'sub IEEE80211_CHAN_TURBO () {0x10;}' unless defined(&IEEE80211_CHAN_TURBO);
    eval 'sub IEEE80211_CHAN_CCK () {0x20;}' unless defined(&IEEE80211_CHAN_CCK);
    eval 'sub IEEE80211_CHAN_OFDM () {0x40;}' unless defined(&IEEE80211_CHAN_OFDM);
    eval 'sub IEEE80211_CHAN_2GHZ () {0x80;}' unless defined(&IEEE80211_CHAN_2GHZ);
    eval 'sub IEEE80211_CHAN_5GHZ () {0x100;}' unless defined(&IEEE80211_CHAN_5GHZ);
    eval 'sub IEEE80211_CHAN_PASSIVE () {0x200;}' unless defined(&IEEE80211_CHAN_PASSIVE);
    eval 'sub IEEE80211_CHAN_DYN () {0x400;}' unless defined(&IEEE80211_CHAN_DYN);
    eval 'sub IEEE80211_CHAN_GFSK () {0x800;}' unless defined(&IEEE80211_CHAN_GFSK);
    eval 'sub IEEE80211_CHAN_GSM () {0x1000;}' unless defined(&IEEE80211_CHAN_GSM);
    eval 'sub IEEE80211_CHAN_HALF () {0x4000;}' unless defined(&IEEE80211_CHAN_HALF);
    eval 'sub IEEE80211_CHAN_QUARTER () {0x8000;}' unless defined(&IEEE80211_CHAN_QUARTER);
    eval 'sub IEEE80211_CHAN_HT20 () {0x10000;}' unless defined(&IEEE80211_CHAN_HT20);
    eval 'sub IEEE80211_CHAN_HT40U () {0x20000;}' unless defined(&IEEE80211_CHAN_HT40U);
    eval 'sub IEEE80211_CHAN_HT40D () {0x40000;}' unless defined(&IEEE80211_CHAN_HT40D);
    eval 'sub IEEE80211_CHAN_DFS () {0x80000;}' unless defined(&IEEE80211_CHAN_DFS);
    eval 'sub IEEE80211_CHAN_4MSXMIT () {0x100000;}' unless defined(&IEEE80211_CHAN_4MSXMIT);
    eval 'sub IEEE80211_CHAN_NOADHOC () {0x200000;}' unless defined(&IEEE80211_CHAN_NOADHOC);
    eval 'sub IEEE80211_CHAN_NOHOSTAP () {0x400000;}' unless defined(&IEEE80211_CHAN_NOHOSTAP);
    eval 'sub IEEE80211_CHAN_11D () {0x800000;}' unless defined(&IEEE80211_CHAN_11D);
    eval 'sub IEEE80211_CHAN_VHT20 () {0x1000000;}' unless defined(&IEEE80211_CHAN_VHT20);
    eval 'sub IEEE80211_CHAN_VHT40U () {0x2000000;}' unless defined(&IEEE80211_CHAN_VHT40U);
    eval 'sub IEEE80211_CHAN_VHT40D () {0x4000000;}' unless defined(&IEEE80211_CHAN_VHT40D);
    eval 'sub IEEE80211_CHAN_VHT80 () {0x8000000;}' unless defined(&IEEE80211_CHAN_VHT80);
    eval 'sub IEEE80211_CHAN_VHT80_80 () {0x10000000;}' unless defined(&IEEE80211_CHAN_VHT80_80);
    eval 'sub IEEE80211_CHAN_VHT160 () {0x20000000;}' unless defined(&IEEE80211_CHAN_VHT160);
    eval 'sub IEEE80211_CHAN_HT20 () {0x10000;}' unless defined(&IEEE80211_CHAN_HT20);
    eval 'sub IEEE80211_CHAN_HT40U () {0x20000;}' unless defined(&IEEE80211_CHAN_HT40U);
    eval 'sub IEEE80211_CHAN_HT40D () {0x40000;}' unless defined(&IEEE80211_CHAN_HT40D);
    eval 'sub IEEE80211_CHAN_DFS () {0x80000;}' unless defined(&IEEE80211_CHAN_DFS);
    eval 'sub IEEE80211_CHAN_4MSXMIT () {0x100000;}' unless defined(&IEEE80211_CHAN_4MSXMIT);
    eval 'sub IEEE80211_CHAN_NOADHOC () {0x200000;}' unless defined(&IEEE80211_CHAN_NOADHOC);
    eval 'sub IEEE80211_CHAN_NOHOSTAP () {0x400000;}' unless defined(&IEEE80211_CHAN_NOHOSTAP);
    eval 'sub IEEE80211_CHAN_11D () {0x800000;}' unless defined(&IEEE80211_CHAN_11D);
    eval 'sub IEEE80211_CHAN_HT40 () {( &IEEE80211_CHAN_HT40U |  &IEEE80211_CHAN_HT40D);}' unless defined(&IEEE80211_CHAN_HT40);
    eval 'sub IEEE80211_CHAN_HT () {( &IEEE80211_CHAN_HT20 |  &IEEE80211_CHAN_HT40);}' unless defined(&IEEE80211_CHAN_HT);
    eval 'sub IEEE80211_CHAN_VHT40 () {( &IEEE80211_CHAN_VHT40U |  &IEEE80211_CHAN_VHT40D);}' unless defined(&IEEE80211_CHAN_VHT40);
    eval 'sub IEEE80211_CHAN_VHT () {( &IEEE80211_CHAN_VHT20 |  &IEEE80211_CHAN_VHT40 |  &IEEE80211_CHAN_VHT80 |  &IEEE80211_CHAN_VHT80_80 |  &IEEE80211_CHAN_VHT160);}' unless defined(&IEEE80211_CHAN_VHT);
    eval 'sub IEEE80211_CHAN_FHSS () {( &IEEE80211_CHAN_2GHZ |  &IEEE80211_CHAN_GFSK);}' unless defined(&IEEE80211_CHAN_FHSS);
    eval 'sub IEEE80211_CHAN_A () {( &IEEE80211_CHAN_5GHZ |  &IEEE80211_CHAN_OFDM);}' unless defined(&IEEE80211_CHAN_A);
    eval 'sub IEEE80211_CHAN_B () {( &IEEE80211_CHAN_2GHZ |  &IEEE80211_CHAN_CCK);}' unless defined(&IEEE80211_CHAN_B);
    eval 'sub IEEE80211_CHAN_PUREG () {( &IEEE80211_CHAN_2GHZ |  &IEEE80211_CHAN_OFDM);}' unless defined(&IEEE80211_CHAN_PUREG);
    eval 'sub IEEE80211_CHAN_G () {( &IEEE80211_CHAN_2GHZ |  &IEEE80211_CHAN_DYN);}' unless defined(&IEEE80211_CHAN_G);
    eval 'sub IEEE80211_CHAN_T () {( &IEEE80211_CHAN_5GHZ |  &IEEE80211_CHAN_OFDM |  &IEEE80211_CHAN_TURBO);}' unless defined(&IEEE80211_CHAN_T);
    eval 'sub IEEE80211_CHAN_108G () {( &IEEE80211_CHAN_2GHZ |  &IEEE80211_CHAN_OFDM |  &IEEE80211_CHAN_TURBO);}' unless defined(&IEEE80211_CHAN_108G);
    eval 'sub IEEE80211_CHAN_ALL () {( &IEEE80211_CHAN_2GHZ |  &IEEE80211_CHAN_5GHZ |  &IEEE80211_CHAN_GFSK |  &IEEE80211_CHAN_CCK |  &IEEE80211_CHAN_OFDM |  &IEEE80211_CHAN_DYN);}' unless defined(&IEEE80211_CHAN_ALL);
    eval 'sub IEEE80211_CHAN_ALLTURBO () {( &IEEE80211_CHAN_ALL |  &IEEE80211_CHAN_TURBO);}' unless defined(&IEEE80211_CHAN_ALLTURBO);
    eval 'sub IEEE80211_IS_CHAN_ANYC {
        my($_c) = @_;
	    eval q((($_c) ==  &IEEE80211_CHAN_ANYC));
    }' unless defined(&IEEE80211_IS_CHAN_ANYC);
    eval 'sub _IEEE80211_IS_CHAN {
        my($_c, $_ch) = @_;
	    eval q(((($_c)-> &ic_flags &  &IEEE80211_CHAN_  $_ch) ==  &IEEE80211_CHAN_  $_ch));
    }' unless defined(&_IEEE80211_IS_CHAN);
    eval 'sub IEEE80211_IS_CHAN_FHSS {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &FHSS));
    }' unless defined(&IEEE80211_IS_CHAN_FHSS);
    eval 'sub IEEE80211_IS_CHAN_A {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &A));
    }' unless defined(&IEEE80211_IS_CHAN_A);
    eval 'sub IEEE80211_IS_CHAN_B {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &B));
    }' unless defined(&IEEE80211_IS_CHAN_B);
    eval 'sub IEEE80211_IS_CHAN_PUREG {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &PUREG));
    }' unless defined(&IEEE80211_IS_CHAN_PUREG);
    eval 'sub IEEE80211_IS_CHAN_G {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &G));
    }' unless defined(&IEEE80211_IS_CHAN_G);
    eval 'sub IEEE80211_IS_CHAN_ANYG {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &ANYG));
    }' unless defined(&IEEE80211_IS_CHAN_ANYG);
    eval 'sub IEEE80211_IS_CHAN_T {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &T));
    }' unless defined(&IEEE80211_IS_CHAN_T);
    eval 'sub IEEE80211_IS_CHAN_108G {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c, 108 &G));
    }' unless defined(&IEEE80211_IS_CHAN_108G);
    eval 'sub IEEE80211_IS_CHAN_2GHZ {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c, 2 &GHZ));
    }' unless defined(&IEEE80211_IS_CHAN_2GHZ);
    eval 'sub IEEE80211_IS_CHAN_5GHZ {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c, 5 &GHZ));
    }' unless defined(&IEEE80211_IS_CHAN_5GHZ);
    eval 'sub IEEE80211_IS_CHAN_OFDM {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &OFDM));
    }' unless defined(&IEEE80211_IS_CHAN_OFDM);
    eval 'sub IEEE80211_IS_CHAN_CCK {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &CCK));
    }' unless defined(&IEEE80211_IS_CHAN_CCK);
    eval 'sub IEEE80211_IS_CHAN_GFSK {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &GFSK));
    }' unless defined(&IEEE80211_IS_CHAN_GFSK);
    eval 'sub IEEE80211_IS_CHAN_HALF {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &HALF));
    }' unless defined(&IEEE80211_IS_CHAN_HALF);
    eval 'sub IEEE80211_IS_CHAN_QUARTER {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &QUARTER));
    }' unless defined(&IEEE80211_IS_CHAN_QUARTER);
    eval 'sub IEEE80211_IS_CHAN_FULL {
        my($_c) = @_;
	    eval q((! &IEEE80211_IS_CHAN_ANYC($_c)  && (($_c)-> &ic_flags & ( &IEEE80211_CHAN_QUARTER |  &IEEE80211_CHAN_HALF)) == 0));
    }' unless defined(&IEEE80211_IS_CHAN_FULL);
    eval 'sub IEEE80211_IS_CHAN_GSM {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &GSM));
    }' unless defined(&IEEE80211_IS_CHAN_GSM);
    eval 'sub IEEE80211_IS_CHAN_PASSIVE {
        my($_c) = @_;
	    eval q( &_IEEE80211_IS_CHAN($_c,  &PASSIVE));
    }' unless defined(&IEEE80211_IS_CHAN_PASSIVE);
    eval 'sub IEEE80211_FH_CHANMOD () {80;}' unless defined(&IEEE80211_FH_CHANMOD);
    eval 'sub IEEE80211_FH_CHAN {
        my($set,$pat) = @_;
	    eval q(((($set)-1)* &IEEE80211_FH_CHANMOD+($pat)));
    }' unless defined(&IEEE80211_FH_CHAN);
    eval 'sub IEEE80211_FH_CHANSET {
        my($chan) = @_;
	    eval q((($chan)/ &IEEE80211_FH_CHANMOD+1));
    }' unless defined(&IEEE80211_FH_CHANSET);
    eval 'sub IEEE80211_FH_CHANPAT {
        my($chan) = @_;
	    eval q((($chan)% &IEEE80211_FH_CHANMOD));
    }' unless defined(&IEEE80211_FH_CHANPAT);
    eval 'sub IEEE80211_RATE_SIZE () {8;}' unless defined(&IEEE80211_RATE_SIZE);
    eval 'sub IEEE80211_RATE_MAXSIZE () {15;}' unless defined(&IEEE80211_RATE_MAXSIZE);
}
1;
