require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_NET80211_IEEE80211_IOCTL_H_)) {
    eval 'sub _NET80211_IEEE80211_IOCTL_H_ () {1;}' unless defined(&_NET80211_IEEE80211_IOCTL_H_);
    require 'sys/ioccom.ph';
    require 'net/if.ph';
    require 'net80211/_ieee80211.ph';
    require 'net80211/ieee80211.ph';
    require 'net80211/ieee80211_crypto.ph';
    eval 'sub IEEE80211_MAX_OPT_IE () {256;}' unless defined(&IEEE80211_MAX_OPT_IE);
    eval 'sub IEEE80211_KEY_DEFAULT () {0x80;}' unless defined(&IEEE80211_KEY_DEFAULT);
    eval 'sub IEEE80211_MLME_ASSOC () {1;}' unless defined(&IEEE80211_MLME_ASSOC);
    eval 'sub IEEE80211_MLME_DISASSOC () {2;}' unless defined(&IEEE80211_MLME_DISASSOC);
    eval 'sub IEEE80211_MLME_DEAUTH () {3;}' unless defined(&IEEE80211_MLME_DEAUTH);
    eval 'sub IEEE80211_MLME_AUTHORIZE () {4;}' unless defined(&IEEE80211_MLME_AUTHORIZE);
    eval 'sub IEEE80211_MLME_UNAUTHORIZE () {5;}' unless defined(&IEEE80211_MLME_UNAUTHORIZE);
    eval("sub IEEE80211_MACCMD_POLICY_OPEN () { 0; }") unless defined(&IEEE80211_MACCMD_POLICY_OPEN);
    eval("sub IEEE80211_MACCMD_POLICY_ALLOW () { 1; }") unless defined(&IEEE80211_MACCMD_POLICY_ALLOW);
    eval("sub IEEE80211_MACCMD_POLICY_DENY () { 2; }") unless defined(&IEEE80211_MACCMD_POLICY_DENY);
    eval("sub IEEE80211_MACCMD_FLUSH () { 3; }") unless defined(&IEEE80211_MACCMD_FLUSH);
    eval("sub IEEE80211_MACCMD_DETACH () { 4; }") unless defined(&IEEE80211_MACCMD_DETACH);
    eval("sub IEEE80211_MACCMD_POLICY () { 5; }") unless defined(&IEEE80211_MACCMD_POLICY);
    eval("sub IEEE80211_MACCMD_LIST () { 6; }") unless defined(&IEEE80211_MACCMD_LIST);
    eval 'sub IEEE80211_WMEPARAM_SELF () {0x;}' unless defined(&IEEE80211_WMEPARAM_SELF);
    eval 'sub IEEE80211_WMEPARAM_BSS () {0x8000;}' unless defined(&IEEE80211_WMEPARAM_BSS);
    eval 'sub IEEE80211_WMEPARAM_VAL () {0x7fff;}' unless defined(&IEEE80211_WMEPARAM_VAL);
    if(defined(&__FreeBSD__)) {
	eval 'sub SIOCS80211 () { &_IOW(ord(\'i\'), 234, \'struct ieee80211req\');}' unless defined(&SIOCS80211);
	eval 'sub SIOCG80211 () { &_IOWR(ord(\'i\'), 235, \'struct ieee80211req\');}' unless defined(&SIOCG80211);
	eval 'sub SIOCG80211STATS () { &_IOWR(ord(\'i\'), 236, \'struct ifreq\');}' unless defined(&SIOCG80211STATS);
    }
    if(defined(&__NetBSD__)) {
	eval 'sub SIOCS80211 () { &_IOW(ord(\'i\'), 244, \'struct ieee80211req\');}' unless defined(&SIOCS80211);
	eval 'sub SIOCG80211 () { &_IOWR(ord(\'i\'), 245, \'struct ieee80211req\');}' unless defined(&SIOCG80211);
	eval 'sub SIOCG80211STATS () { &_IOWR(ord(\'i\'), 246, \'struct ifreq\');}' unless defined(&SIOCG80211STATS);
	eval 'sub SIOCG80211ZSTATS () { &_IOWR(ord(\'i\'), 247, \'struct ifreq\');}' unless defined(&SIOCG80211ZSTATS);
	eval 'sub OSIOCG80211STATS () { &_IOWR(ord(\'i\'), 242, \'struct ifreq\');}' unless defined(&OSIOCG80211STATS);
	eval 'sub OSIOCG80211ZSTATS () { &_IOWR(ord(\'i\'), 243, \'struct ifreq\');}' unless defined(&OSIOCG80211ZSTATS);
    }
    if(defined(&__FreeBSD__) || defined(&COMPAT_FREEBSD_NET80211)) {
	eval 'sub IEEE80211_IOC_SSID () {1;}' unless defined(&IEEE80211_IOC_SSID);
    }
    eval 'sub IEEE80211_IOC_NUMSSIDS () {2;}' unless defined(&IEEE80211_IOC_NUMSSIDS);
    eval 'sub IEEE80211_IOC_WEP () {3;}' unless defined(&IEEE80211_IOC_WEP);
    eval 'sub IEEE80211_WEP_NOSUP () {-1;}' unless defined(&IEEE80211_WEP_NOSUP);
    eval 'sub IEEE80211_WEP_OFF () {0;}' unless defined(&IEEE80211_WEP_OFF);
    eval 'sub IEEE80211_WEP_ON () {1;}' unless defined(&IEEE80211_WEP_ON);
    eval 'sub IEEE80211_WEP_MIXED () {2;}' unless defined(&IEEE80211_WEP_MIXED);
    if(defined(&__FreeBSD__) || defined(&COMPAT_FREEBSD_NET80211)) {
	eval 'sub IEEE80211_IOC_WEPKEY () {4;}' unless defined(&IEEE80211_IOC_WEPKEY);
    }
    eval 'sub IEEE80211_IOC_NUMWEPKEYS () {5;}' unless defined(&IEEE80211_IOC_NUMWEPKEYS);
    if(defined(&__FreeBSD__) || defined(&COMPAT_FREEBSD_NET80211)) {
	eval 'sub IEEE80211_IOC_WEPTXKEY () {6;}' unless defined(&IEEE80211_IOC_WEPTXKEY);
    }
    eval 'sub IEEE80211_IOC_AUTHMODE () {7;}' unless defined(&IEEE80211_IOC_AUTHMODE);
    eval 'sub IEEE80211_IOC_STATIONNAME () {8;}' unless defined(&IEEE80211_IOC_STATIONNAME);
    if(defined(&__FreeBSD__) || defined(&COMPAT_FREEBSD_NET80211)) {
	eval 'sub IEEE80211_IOC_CHANNEL () {9;}' unless defined(&IEEE80211_IOC_CHANNEL);
    }
    eval 'sub IEEE80211_IOC_POWERSAVE () {10;}' unless defined(&IEEE80211_IOC_POWERSAVE);
    eval 'sub IEEE80211_POWERSAVE_NOSUP () {-1;}' unless defined(&IEEE80211_POWERSAVE_NOSUP);
    eval 'sub IEEE80211_POWERSAVE_OFF () {0;}' unless defined(&IEEE80211_POWERSAVE_OFF);
    eval 'sub IEEE80211_POWERSAVE_CAM () {1;}' unless defined(&IEEE80211_POWERSAVE_CAM);
    eval 'sub IEEE80211_POWERSAVE_PSP () {2;}' unless defined(&IEEE80211_POWERSAVE_PSP);
    eval 'sub IEEE80211_POWERSAVE_PSP_CAM () {3;}' unless defined(&IEEE80211_POWERSAVE_PSP_CAM);
    eval 'sub IEEE80211_POWERSAVE_ON () { &IEEE80211_POWERSAVE_CAM;}' unless defined(&IEEE80211_POWERSAVE_ON);
    eval 'sub IEEE80211_IOC_POWERSAVESLEEP () {11;}' unless defined(&IEEE80211_IOC_POWERSAVESLEEP);
    eval 'sub IEEE80211_IOC_RTSTHRESHOLD () {12;}' unless defined(&IEEE80211_IOC_RTSTHRESHOLD);
    eval 'sub IEEE80211_IOC_PROTMODE () {13;}' unless defined(&IEEE80211_IOC_PROTMODE);
    eval 'sub IEEE80211_PROTMODE_OFF () {0;}' unless defined(&IEEE80211_PROTMODE_OFF);
    eval 'sub IEEE80211_PROTMODE_CTS () {1;}' unless defined(&IEEE80211_PROTMODE_CTS);
    eval 'sub IEEE80211_PROTMODE_RTSCTS () {2;}' unless defined(&IEEE80211_PROTMODE_RTSCTS);
    eval 'sub IEEE80211_IOC_TXPOWER () {14;}' unless defined(&IEEE80211_IOC_TXPOWER);
    if(defined(&__FreeBSD__) || defined(&COMPAT_FREEBSD_NET80211)) {
	eval 'sub IEEE80211_IOC_BSSID () {15;}' unless defined(&IEEE80211_IOC_BSSID);
    }
    eval 'sub IEEE80211_IOC_ROAMING () {16;}' unless defined(&IEEE80211_IOC_ROAMING);
    eval 'sub IEEE80211_IOC_PRIVACY () {17;}' unless defined(&IEEE80211_IOC_PRIVACY);
    eval 'sub IEEE80211_IOC_DROPUNENCRYPTED () {18;}' unless defined(&IEEE80211_IOC_DROPUNENCRYPTED);
    eval 'sub IEEE80211_IOC_WPAKEY () {19;}' unless defined(&IEEE80211_IOC_WPAKEY);
    eval 'sub IEEE80211_IOC_DELKEY () {20;}' unless defined(&IEEE80211_IOC_DELKEY);
    eval 'sub IEEE80211_IOC_MLME () {21;}' unless defined(&IEEE80211_IOC_MLME);
    eval 'sub IEEE80211_IOC_OPTIE () {22;}' unless defined(&IEEE80211_IOC_OPTIE);
    eval 'sub IEEE80211_IOC_SCAN_REQ () {23;}' unless defined(&IEEE80211_IOC_SCAN_REQ);
    eval 'sub IEEE80211_IOC_SCAN_RESULTS () {24;}' unless defined(&IEEE80211_IOC_SCAN_RESULTS);
    eval 'sub IEEE80211_IOC_COUNTERMEASURES () {25;}' unless defined(&IEEE80211_IOC_COUNTERMEASURES);
    eval 'sub IEEE80211_IOC_WPA () {26;}' unless defined(&IEEE80211_IOC_WPA);
    eval 'sub IEEE80211_IOC_CHANLIST () {27;}' unless defined(&IEEE80211_IOC_CHANLIST);
    eval 'sub IEEE80211_IOC_WME () {28;}' unless defined(&IEEE80211_IOC_WME);
    eval 'sub IEEE80211_IOC_HIDESSID () {29;}' unless defined(&IEEE80211_IOC_HIDESSID);
    eval 'sub IEEE80211_IOC_APBRIDGE () {30;}' unless defined(&IEEE80211_IOC_APBRIDGE);
    eval 'sub IEEE80211_IOC_MCASTCIPHER () {31;}' unless defined(&IEEE80211_IOC_MCASTCIPHER);
    eval 'sub IEEE80211_IOC_MCASTKEYLEN () {32;}' unless defined(&IEEE80211_IOC_MCASTKEYLEN);
    eval 'sub IEEE80211_IOC_UCASTCIPHERS () {33;}' unless defined(&IEEE80211_IOC_UCASTCIPHERS);
    eval 'sub IEEE80211_IOC_UCASTCIPHER () {34;}' unless defined(&IEEE80211_IOC_UCASTCIPHER);
    eval 'sub IEEE80211_IOC_UCASTKEYLEN () {35;}' unless defined(&IEEE80211_IOC_UCASTKEYLEN);
    eval 'sub IEEE80211_IOC_DRIVER_CAPS () {36;}' unless defined(&IEEE80211_IOC_DRIVER_CAPS);
    eval 'sub IEEE80211_IOC_KEYMGTALGS () {37;}' unless defined(&IEEE80211_IOC_KEYMGTALGS);
    eval 'sub IEEE80211_IOC_RSNCAPS () {38;}' unless defined(&IEEE80211_IOC_RSNCAPS);
    eval 'sub IEEE80211_IOC_WPAIE () {39;}' unless defined(&IEEE80211_IOC_WPAIE);
    eval 'sub IEEE80211_IOC_STA_STATS () {40;}' unless defined(&IEEE80211_IOC_STA_STATS);
    eval 'sub IEEE80211_IOC_MACCMD () {41;}' unless defined(&IEEE80211_IOC_MACCMD);
    eval 'sub IEEE80211_IOC_CHANINFO () {42;}' unless defined(&IEEE80211_IOC_CHANINFO);
    eval 'sub IEEE80211_IOC_TXPOWMAX () {43;}' unless defined(&IEEE80211_IOC_TXPOWMAX);
    eval 'sub IEEE80211_IOC_STA_TXPOW () {44;}' unless defined(&IEEE80211_IOC_STA_TXPOW);
    eval 'sub IEEE80211_IOC_STA_INFO () {45;}' unless defined(&IEEE80211_IOC_STA_INFO);
    eval 'sub IEEE80211_IOC_WME_CWMIN () {46;}' unless defined(&IEEE80211_IOC_WME_CWMIN);
    eval 'sub IEEE80211_IOC_WME_CWMAX () {47;}' unless defined(&IEEE80211_IOC_WME_CWMAX);
    eval 'sub IEEE80211_IOC_WME_AIFS () {48;}' unless defined(&IEEE80211_IOC_WME_AIFS);
    eval 'sub IEEE80211_IOC_WME_TXOPLIMIT () {49;}' unless defined(&IEEE80211_IOC_WME_TXOPLIMIT);
    eval 'sub IEEE80211_IOC_WME_ACM () {50;}' unless defined(&IEEE80211_IOC_WME_ACM);
    eval 'sub IEEE80211_IOC_WME_ACKPOLICY () {51;}' unless defined(&IEEE80211_IOC_WME_ACKPOLICY);
    eval 'sub IEEE80211_IOC_DTIM_PERIOD () {52;}' unless defined(&IEEE80211_IOC_DTIM_PERIOD);
    eval 'sub IEEE80211_IOC_BEACON_INTERVAL () {53;}' unless defined(&IEEE80211_IOC_BEACON_INTERVAL);
    eval 'sub IEEE80211_IOC_ADDMAC () {54;}' unless defined(&IEEE80211_IOC_ADDMAC);
    eval 'sub IEEE80211_IOC_DELMAC () {55;}' unless defined(&IEEE80211_IOC_DELMAC);
    eval 'sub IEEE80211_IOC_PUREG () {56;}' unless defined(&IEEE80211_IOC_PUREG);
    eval 'sub IEEE80211_IOC_MCAST_RATE () {72;}' unless defined(&IEEE80211_IOC_MCAST_RATE);
    eval 'sub IEEE80211_IOC_FRAGTHRESHOLD () {73;}' unless defined(&IEEE80211_IOC_FRAGTHRESHOLD);
    if(defined(&__NetBSD__)) {
	eval 'sub SIOCS80211NWID () { &_IOWR(ord(\'i\'), 230, \'struct ifreq\');}' unless defined(&SIOCS80211NWID);
	eval 'sub SIOCG80211NWID () { &_IOWR(ord(\'i\'), 231, \'struct ifreq\');}' unless defined(&SIOCG80211NWID);
	eval 'sub SIOCS80211NWKEY () { &_IOW(ord(\'i\'), 232, \'struct ieee80211_nwkey\');}' unless defined(&SIOCS80211NWKEY);
	eval 'sub SIOCG80211NWKEY () { &_IOWR(ord(\'i\'), 233, \'struct ieee80211_nwkey\');}' unless defined(&SIOCG80211NWKEY);
	eval 'sub IEEE80211_NWKEY_OPEN () {0;}' unless defined(&IEEE80211_NWKEY_OPEN);
	eval 'sub IEEE80211_NWKEY_WEP () {1;}' unless defined(&IEEE80211_NWKEY_WEP);
	eval 'sub IEEE80211_NWKEY_EAP () {2;}' unless defined(&IEEE80211_NWKEY_EAP);
	eval 'sub IEEE80211_NWKEY_PERSIST () {0x100;}' unless defined(&IEEE80211_NWKEY_PERSIST);
	eval 'sub SIOCS80211POWER () { &_IOW(ord(\'i\'), 234, \'struct ieee80211_power\');}' unless defined(&SIOCS80211POWER);
	eval 'sub SIOCG80211POWER () { &_IOWR(ord(\'i\'), 235, \'struct ieee80211_power\');}' unless defined(&SIOCG80211POWER);
	eval 'sub SIOCS80211AUTH () { &_IOW(ord(\'i\'), 236, \'struct ieee80211_auth\');}' unless defined(&SIOCS80211AUTH);
	eval 'sub SIOCG80211AUTH () { &_IOWR(ord(\'i\'), 237, \'struct ieee80211_auth\');}' unless defined(&SIOCG80211AUTH);
	unless(defined(&IEEE80211_CHAN_ANY)) {
	    eval 'sub IEEE80211_CHAN_ANY () {0xffff;}' unless defined(&IEEE80211_CHAN_ANY);
	}
	eval 'sub SIOCS80211CHANNEL () { &_IOW(ord(\'i\'), 238, \'struct ieee80211chanreq\');}' unless defined(&SIOCS80211CHANNEL);
	eval 'sub SIOCG80211CHANNEL () { &_IOWR(ord(\'i\'), 239, \'struct ieee80211chanreq\');}' unless defined(&SIOCG80211CHANNEL);
	eval 'sub SIOCS80211BSSID () { &_IOW(ord(\'i\'), 240, \'struct ieee80211_bssid\');}' unless defined(&SIOCS80211BSSID);
	eval 'sub SIOCG80211BSSID () { &_IOWR(ord(\'i\'), 241, \'struct ieee80211_bssid\');}' unless defined(&SIOCG80211BSSID);
    }
}
1;
