├── .gitignore ├── Black80211.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist ├── xcuserdata │ └── rpeshkov.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── project.pbxproj ├── Black80211 ├── FakeDevice.cpp ├── apple80211 │ ├── catalina │ │ ├── IO80211SkywalkInterface.h │ │ ├── IOSkywalkEthernetInterface.h │ │ ├── IO80211WorkLoop.h │ │ ├── IO80211Interface.h │ │ ├── IO80211Controller.h │ │ ├── apple80211_wps.h │ │ ├── apple80211_var.h │ │ └── apple80211_ioctl.h │ └── ioctl ├── apple80211.h ├── FakeDevice.hpp ├── Info.plist ├── Black80211Control.hpp ├── debug.h ├── Black80211Control.cpp └── Black80211Control_ioctl.cpp ├── README.md ├── makefile └── Black80211_Sierra copy-Info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | DerivedData/ 2 | xcuserdata/ 3 | 4 | .DS_Store 5 | build/ 6 | -------------------------------------------------------------------------------- /Black80211.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Black80211.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Black80211.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Black80211/FakeDevice.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // FakeDevice.cpp 3 | // Black80211 4 | // 5 | // Created by Roman Peshkov on 06/05/2018. 6 | // Copyright © 2018 Roman Peshkov. All rights reserved. 7 | // 8 | 9 | #include "FakeDevice.hpp" 10 | #include "apple80211.h" 11 | 12 | FakeDevice::FakeDevice() 13 | : m_powerState(APPLE80211_POWER_OFF) 14 | , m_state(APPLE80211_S_INIT) 15 | , m_published(false) 16 | , counter(-1){ 17 | 18 | } 19 | 20 | FakeDevice::~FakeDevice() { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Black80211/apple80211/catalina/IO80211SkywalkInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // IO80211SkywalkInterface.h 3 | // AppleIntelWifiAdapter 4 | // 5 | // Created by 钟先耀 on 2019/10/18. 6 | // Copyright © 2019 钟先耀. All rights reserved. 7 | // 8 | 9 | #ifndef IO80211SkywalkInterface_h 10 | #define IO80211SkywalkInterface_h 11 | 12 | #include "IOSkywalkEthernetInterface.h" 13 | 14 | class IO80211SkywalkInterface : IOSkywalkEthernetInterface { 15 | OSDeclareAbstractStructors(IO80211SkywalkInterface) 16 | 17 | public: 18 | 19 | }; 20 | 21 | #endif /* IO80211SkywalkInterface_h */ 22 | -------------------------------------------------------------------------------- /Black80211/apple80211/catalina/IOSkywalkEthernetInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOSkywalkEthernetInterface.h 3 | // AppleIntelWifiAdapter 4 | // 5 | // Created by 钟先耀 on 2019/10/18. 6 | // Copyright © 2019 钟先耀. All rights reserved. 7 | // 8 | 9 | #ifndef IOSkywalkEthernetInterface_h 10 | #define IOSkywalkEthernetInterface_h 11 | 12 | #include 13 | 14 | class IOSkywalkEthernetInterface : public IOEthernetController { 15 | OSDeclareAbstractStructors( IOSkywalkEthernetInterface ) 16 | 17 | public: 18 | 19 | }; 20 | 21 | #endif /* IOSkywalkEthernetInterface_h */ 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Black80211-Catalina 2 | 3 | This project aims to be used like a simulator of IEEE80211 stack for MacOS. (only for Catalina) 4 | 5 | The intent for this project is to provide a clean base that you can manipulate the 802.11 stack through, 6 | and to eventually write drivers for. 7 | 8 | ## READ ME FIRST 9 | 10 | **THIS ISN'T A WIRELESS DRIVER** 11 | **I WILL NOT PROVIDE SUPPORT.** 12 | **PLEASE DO NOT EMAIL ME OR MAKE ISSUES REGARDING IT NOT WORKING.** 13 | ***I WILL SLAP YOU.*** 14 | 15 | ## Known issues 16 | 17 | - Unable to unload kext (something is retaining the driver) 18 | - IO80211Interface needs to be populated with the actual variables, and not a massive uint8 array 19 | -------------------------------------------------------------------------------- /Black80211/apple80211.h: -------------------------------------------------------------------------------- 1 | // 2 | // apple80211.h 3 | // Black80211 4 | // 5 | // Created by Roman Peshkov on 02/05/2018. 6 | // Copyright © 2018 Roman Peshkov. All rights reserved. 7 | // 8 | 9 | #ifndef apple80211_h 10 | #define apple80211_h 11 | 12 | #ifdef SIERRA 13 | #include "apple80211/sierra/IO80211Controller.h" 14 | #include "apple80211/sierra/IO80211WorkLoop.h" 15 | #include "apple80211/sierra/IO80211Interface.h" 16 | #endif 17 | 18 | #ifdef HIGH_SIERRA 19 | #include "apple80211/high_sierra/IO80211Controller.h" 20 | #include "apple80211/high_sierra/IO80211WorkLoop.h" 21 | #include "apple80211/high_sierra/IO80211Interface.h" 22 | #endif 23 | 24 | #ifdef CATALINA 25 | #include "apple80211/catalina/IO80211Controller.h" 26 | #include "apple80211/catalina/IO80211WorkLoop.h" 27 | #include "apple80211/catalina/IO80211Interface.h" 28 | #endif 29 | 30 | 31 | #endif /* apple80211_h */ 32 | -------------------------------------------------------------------------------- /Black80211.xcodeproj/xcuserdata/rpeshkov.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Black80211_HighSierra.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | Black80211_Sierra.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | A61272212039FD13009DD95B 21 | 22 | primary 23 | 24 | 25 | A6881FF6209A29A3009B1576 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Black80211/apple80211/catalina/IO80211WorkLoop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * IO80211WorkLoop.h 3 | * Family 4 | * 5 | * Created by Pete on 5/31/06. 6 | * Copyright 2006 Apple Computer, Inc. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef _IO80211WORKLOOP_H 11 | #define _IO80211WORKLOOP_H 12 | #include 13 | 14 | class IO80211WorkLoop : public IOWorkLoop 15 | { 16 | OSDeclareDefaultStructors( IO80211WorkLoop ) 17 | 18 | public: 19 | 20 | static IO80211WorkLoop * workLoop(); 21 | 22 | virtual void openGate() APPLE_KEXT_OVERRIDE; 23 | virtual void closeGate() APPLE_KEXT_OVERRIDE; 24 | virtual int sleepGate( void * event, UInt32 interuptibleType ) APPLE_KEXT_OVERRIDE; 25 | virtual int sleepGateDeadline( void * event, UInt32 interuptibleType, AbsoluteTime deadline ); 26 | virtual void wakeupGate( void * event, bool oneThread ) APPLE_KEXT_OVERRIDE; 27 | 28 | }; 29 | #endif 30 | -------------------------------------------------------------------------------- /Black80211/FakeDevice.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // FakeDevice.hpp 3 | // Black80211 4 | // 5 | // Created by Roman Peshkov on 06/05/2018. 6 | // Copyright © 2018 Roman Peshkov. All rights reserved. 7 | // 8 | 9 | #ifndef FakeDevice_hpp 10 | #define FakeDevice_hpp 11 | 12 | #include 13 | 14 | class FakeDevice { 15 | public: 16 | FakeDevice(); 17 | ~FakeDevice(); 18 | 19 | UInt32 powerState() { return m_powerState; } 20 | void setPowerState(UInt32 powerState) { m_powerState = powerState; }; 21 | 22 | UInt32 state() { return m_state; } 23 | void setState(UInt32 state) { m_state = state; } 24 | 25 | bool published() { return m_published; } 26 | void setPublished(bool value) { m_published = value; } 27 | 28 | SInt32 counter; 29 | 30 | private: 31 | UInt32 m_powerState; 32 | UInt32 m_state; 33 | bool m_published; 34 | 35 | }; 36 | 37 | #endif /* FakeDevice_hpp */ 38 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | TARGETOS := $(shell uname -s) 2 | 3 | ifeq ($(TARGETOS), Darwin) 4 | OSXRELEASE := $(shell uname -r | sed 's/\..*//') 5 | ifeq ($(OSXRELEASE), 17) 6 | OSXVER = HighSierra 7 | endif 8 | ifeq ($(OSXRELEASE), 16) 9 | OSXVER = Sierra 10 | endif 11 | endif 12 | KEXT=DerivedData/Black80211/Build/Products/$(OSXVER)/Debug/Black80211.kext 13 | 14 | ifeq ($(findstring 32,$(BITS)),32) 15 | OPTIONS:=$(OPTIONS) -arch i386 16 | endif 17 | 18 | ifeq ($(findstring 64,$(BITS)),64) 19 | OPTIONS:=$(OPTIONS) -arch x86_64 20 | endif 21 | 22 | .PHONY: all 23 | all: 24 | xcodebuild build $(OPTIONS) -scheme Black80211_$(OSXVER) -configuration Debug 25 | 26 | .PHONY: deps 27 | deps: 28 | sudo kextlibs -xml $(KEXT) 29 | 30 | .PHONY: load 31 | load: 32 | sudo chown -R root:wheel $(KEXT) 33 | sudo kextutil $(KEXT) 34 | 35 | .PHONY: unload 36 | unload: 37 | sudo kextunload $(KEXT) 38 | 39 | .PHONY: clean 40 | clean: 41 | sudo rm -rf $(KEXT) 42 | -------------------------------------------------------------------------------- /Black80211/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | IOKitPersonalities 26 | 27 | Black80211 28 | 29 | CFBundleIdentifier 30 | net.rpeshkov.${PRODUCT_NAME:rfc1034identifier} 31 | IOClass 32 | Black80211Control 33 | IOProviderClass 34 | IOPCIDevice 35 | IOPCIPrimaryMatch 36 | 0x00008086&0x00009d1a 37 | 38 | 39 | NSHumanReadableCopyright 40 | Copyright © 2018 Roman Peshkov. All rights reserved. 41 | OSBundleLibraries 42 | 43 | com.apple.iokit.IO80211Family 44 | 1200.12.2b1 45 | com.apple.iokit.IONetworkingFamily 46 | 3.2 47 | com.apple.iokit.IOPCIFamily 48 | 2.9 49 | com.apple.kpi.bsd 50 | 16.7 51 | com.apple.kpi.iokit 52 | 16.7 53 | com.apple.kpi.libkern 54 | 16.7 55 | com.apple.kpi.mach 56 | 16.7 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Black80211_Sierra copy-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | IOKitPersonalities 26 | 27 | Black80211 28 | 29 | CFBundleIdentifier 30 | net.rpeshkov.${PRODUCT_NAME:rfc1034identifier} 31 | IOClass 32 | Black80211Control 33 | IOPCIPrimaryMatch 34 | 0x00008086&0x0000ffff 35 | IOProviderClass 36 | IOPCIDevice 37 | 38 | 39 | NSHumanReadableCopyright 40 | Copyright © 2018 Roman Peshkov. All rights reserved. 41 | OSBundleLibraries 42 | 43 | com.apple.iokit.IO80211Family 44 | 1200.12.2b1 45 | com.apple.iokit.IONetworkingFamily 46 | 3.2 47 | com.apple.iokit.IOPCIFamily 48 | 2.9 49 | com.apple.kpi.bsd 50 | 16.7 51 | com.apple.kpi.iokit 52 | 16.7 53 | com.apple.kpi.libkern 54 | 16.7 55 | com.apple.kpi.mach 56 | 16.7 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Black80211/apple80211/catalina/IO80211Interface.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _IO80211INTERFACE_H 3 | #define _IO80211INTERFACE_H 4 | 5 | /* 6 | * Kernel 7 | */ 8 | #if defined(KERNEL) && defined(__cplusplus) 9 | 10 | #include 11 | 12 | #if VERSION_MAJOR > 8 13 | #define _MODERN_BPF 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | enum IO80211LinkState 21 | { 22 | kIO80211NetworkLinkUndefined, // Starting link state when an interface is created 23 | kIO80211NetworkLinkDown, // Interface not capable of transmitting packets 24 | kIO80211NetworkLinkUp, // Interface capable of transmitting packets 25 | }; 26 | typedef enum IO80211LinkState IO80211LinkState; 27 | 28 | /*! @defined kIO80211InterfaceClass 29 | @abstract The name of the IO80211Interface class. 30 | */ 31 | #define kIO80211InterfaceClass "IO80211Interface" 32 | 33 | typedef UInt64 IO80211FlowQueueHash; 34 | class RSNSupplicant; 35 | class IOTimerEventSource; 36 | class IOGatedOutputQueue; 37 | class IO80211Controller; 38 | class IO80211Workloop; 39 | class IO80211ScanManager; 40 | class IO80211PeerManager; 41 | class IO80211FlowQueueDatabase; 42 | class IO80211InterfaceMonitor; 43 | class IO80211AssociationJoinSnapshot; 44 | 45 | struct apple80211_debug_command; 46 | struct apple80211_txstats; 47 | struct apple80211_chip_counters_tx; 48 | struct apple80211_chip_error_counters_tx; 49 | struct apple80211_chip_counters_rx; 50 | struct apple80211_ManagementInformationBasedot11_counters; 51 | struct apple80211_leaky_ap_stats; 52 | struct apple80211_leaky_ap_ssid_metrics; 53 | struct apple80211_interface_availability; 54 | struct apple80211_pmk_cache_data; 55 | struct apple80211_ap_cmp_data; 56 | struct TxPacketRequest; 57 | struct AWSRequest; 58 | struct packet_info_tx; 59 | struct userPrintCtx; 60 | 61 | typedef int apple80211_postMessage_tlv_types; 62 | 63 | class IO80211Interface : public IOEthernetInterface 64 | { 65 | OSDeclareDefaultStructors( IO80211Interface ); 66 | 67 | public: 68 | virtual bool terminate(unsigned int) APPLE_KEXT_OVERRIDE; 69 | virtual bool attach(IOService*) APPLE_KEXT_OVERRIDE; 70 | virtual void detach(IOService*) APPLE_KEXT_OVERRIDE; 71 | virtual bool init(IONetworkController*) APPLE_KEXT_OVERRIDE; 72 | virtual IOReturn updateReport(IOReportChannelList *,uint,void *,void *) override; 73 | virtual IOReturn configureReport(IOReportChannelList *,uint,void *,void *) override; 74 | virtual UInt32 inputPacket(mbuf_t packet, 75 | UInt32 length = 0, 76 | IOOptionBits options = 0, 77 | void * param = 0) APPLE_KEXT_OVERRIDE; 78 | virtual bool inputEvent(unsigned int, void*) APPLE_KEXT_OVERRIDE; 79 | virtual IOReturn newUserClient(task_t, void*, UInt32 type, OSDictionary*, IOUserClient**) APPLE_KEXT_OVERRIDE; 80 | virtual SInt32 performCommand(IONetworkController*, unsigned long, void*, void*) APPLE_KEXT_OVERRIDE; 81 | virtual IOReturn attachToDataLinkLayer(IOOptionBits, void*) APPLE_KEXT_OVERRIDE; 82 | virtual void detachFromDataLinkLayer(unsigned int, void*) APPLE_KEXT_OVERRIDE; 83 | virtual int errnoFromReturn(int) override; 84 | virtual const char* stringFromReturn(int) override; 85 | 86 | virtual void setPoweredOnByUser(bool); 87 | virtual void setEnabledBySystem(bool); 88 | 89 | virtual bool setLinkState(IO80211LinkState, unsigned int); 90 | virtual bool setLinkState(IO80211LinkState, int, unsigned int); 91 | virtual UInt32 outputPacket(mbuf_t, void*); 92 | 93 | virtual bool setLinkQualityMetric(int); 94 | virtual void handleDebugCmd(apple80211_debug_command*); 95 | OSMetaClassDeclareReservedUnused( IO80211Interface, 0); 96 | OSMetaClassDeclareReservedUnused( IO80211Interface, 1); 97 | OSMetaClassDeclareReservedUnused( IO80211Interface, 2); 98 | OSMetaClassDeclareReservedUnused( IO80211Interface, 3); 99 | OSMetaClassDeclareReservedUnused( IO80211Interface, 4); 100 | OSMetaClassDeclareReservedUnused( IO80211Interface, 5); 101 | OSMetaClassDeclareReservedUnused( IO80211Interface, 6); 102 | OSMetaClassDeclareReservedUnused( IO80211Interface, 7); 103 | OSMetaClassDeclareReservedUnused( IO80211Interface, 8); 104 | OSMetaClassDeclareReservedUnused( IO80211Interface, 9); 105 | OSMetaClassDeclareReservedUnused( IO80211Interface, 10); 106 | OSMetaClassDeclareReservedUnused( IO80211Interface, 11); 107 | OSMetaClassDeclareReservedUnused( IO80211Interface, 12); 108 | OSMetaClassDeclareReservedUnused( IO80211Interface, 13); 109 | OSMetaClassDeclareReservedUnused( IO80211Interface, 14); 110 | OSMetaClassDeclareReservedUnused( IO80211Interface, 15); 111 | public: 112 | IO80211FlowQueue * findOrCreateFlowQueue(IO80211FlowQueueHash); 113 | void dropTxPacket(mbuf_t); 114 | void logDebug(unsigned long long, char const*, ...); 115 | void vlogDebug(unsigned long long, char const*, va_list); 116 | const char * getBSDName(); 117 | bool setLeakyAPStatsMode(unsigned int); 118 | void stopOutputQueues(); 119 | void startOutputQueues(); 120 | bool updateLinkSpeed(); 121 | bool reportDataTransferRatesStatic(void*); 122 | void logDebug(char const*, ...); 123 | void postMessage(unsigned int, void* data = NULL, unsigned long dataLen = 0); 124 | protected: 125 | u_int8_t dat[0x500]; 126 | }; 127 | 128 | #endif /* defined(KERNEL) && defined(__cplusplus) */ 129 | 130 | #endif /* ! _IO80211INTERFACE_H */ 131 | 132 | -------------------------------------------------------------------------------- /Black80211/Black80211Control.hpp: -------------------------------------------------------------------------------- 1 | /* add your code here */ 2 | #ifndef net80211_Voodoo80211Device_h 3 | #define net80211_Voodoo80211Device_h 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | #include 26 | 27 | #include "apple80211.h" 28 | 29 | #include "FakeDevice.hpp" 30 | 31 | typedef enum { 32 | MEDIUM_TYPE_NONE = 0, 33 | MEDIUM_TYPE_AUTO, 34 | MEDIUM_TYPE_1MBIT, 35 | MEDIUM_TYPE_2MBIT, 36 | MEDIUM_TYPE_5MBIT, 37 | MEDIUM_TYPE_11MBIT, 38 | MEDIUM_TYPE_54MBIT, 39 | MEDIUM_TYPE_INVALID 40 | } mediumType_t; 41 | 42 | #define RELEASE(x) if(x){(x)->release();(x)=NULL;} 43 | 44 | class Black80211Control : public IO80211Controller { 45 | 46 | OSDeclareDefaultStructors(Black80211Control) 47 | 48 | public: 49 | bool init(OSDictionary* parameters) APPLE_KEXT_OVERRIDE; 50 | void free() APPLE_KEXT_OVERRIDE; 51 | bool start(IOService* provider) APPLE_KEXT_OVERRIDE; 52 | void stop(IOService* provider) APPLE_KEXT_OVERRIDE; 53 | IOService* probe(IOService* provider, SInt32* score) override; 54 | 55 | SInt32 apple80211Request(unsigned int request_type, int request_number, IO80211Interface* interface, void* data) override; 56 | UInt32 outputPacket (mbuf_t m, void* param) override; 57 | IOReturn getMaxPacketSize(UInt32* maxSize) const; 58 | const OSString* newVendorString() const; 59 | const OSString* newModelString() const; 60 | const OSString* newRevisionString() const; 61 | IOReturn enable(IONetworkInterface *netif) override; 62 | IOReturn disable(IONetworkInterface *netif) override; 63 | bool configureInterface(IONetworkInterface *netif) override; 64 | IO80211Interface* getNetworkInterface() override; 65 | IOReturn getHardwareAddressForInterface(IO80211Interface* netif, IOEthernetAddress* addr) override; 66 | IOReturn getHardwareAddress(IOEthernetAddress* addr) override; 67 | IOReturn setPromiscuousMode(IOEnetPromiscuousMode mode) override; 68 | IOReturn setMulticastMode(IOEnetMulticastMode mode) override; 69 | IOReturn setMulticastList(IOEthernetAddress* addr, UInt32 len) override; 70 | SInt32 monitorModeSetEnabled(IO80211Interface* interface, bool enabled, UInt32 dlt) override; 71 | 72 | bool createWorkLoop() override; 73 | IOWorkLoop* getWorkLoop() const override; 74 | 75 | protected: 76 | IO80211Interface* getInterface(); 77 | 78 | private: 79 | // 1 - SSID 80 | IOReturn getSSID(IO80211Interface* interface, struct apple80211_ssid_data* sd); 81 | IOReturn setSSID(IO80211Interface* interface, struct apple80211_ssid_data* sd); 82 | // 2 - AUTH_TYPE 83 | IOReturn getAUTH_TYPE(IO80211Interface* interface, struct apple80211_authtype_data* ad); 84 | // 4 - CHANNEL 85 | IOReturn getCHANNEL(IO80211Interface* interface, struct apple80211_channel_data* cd); 86 | // 7 - TXPOWER 87 | IOReturn getTXPOWER(IO80211Interface* interface, struct apple80211_txpower_data* txd); 88 | // 8 - RATE 89 | IOReturn getRATE(IO80211Interface* interface, struct apple80211_rate_data* rd); 90 | // 9 - BSSID 91 | IOReturn getBSSID(IO80211Interface* interface, struct apple80211_bssid_data* bd); 92 | // 10 - SCAN_REQ 93 | IOReturn setSCAN_REQ(IO80211Interface* interface, struct apple80211_scan_data* sd); 94 | // 11 - SCAN_RESULT 95 | IOReturn getSCAN_RESULT(IO80211Interface* interface, apple80211_scan_result* *sr); 96 | // 12 - CARD_CAPABILITIES 97 | IOReturn getCARD_CAPABILITIES(IO80211Interface* interface, struct apple80211_capability_data* cd); 98 | // 13 - STATE 99 | IOReturn getSTATE(IO80211Interface* interface, struct apple80211_state_data* sd); 100 | IOReturn setSTATE(IO80211Interface* interface, struct apple80211_state_data* sd); 101 | // 14 - PHY_MODE 102 | IOReturn getPHY_MODE(IO80211Interface* interface, struct apple80211_phymode_data* pd); 103 | // 15 - OP_MODE 104 | IOReturn getOP_MODE(IO80211Interface* interface, struct apple80211_opmode_data* od); 105 | // 16 - RSSI 106 | IOReturn getRSSI(IO80211Interface* interface, struct apple80211_rssi_data* rd); 107 | // 17 - NOISE 108 | IOReturn getNOISE(IO80211Interface* interface,struct apple80211_noise_data* nd); 109 | // 18 - INT_MIT 110 | IOReturn getINT_MIT(IO80211Interface* interface, struct apple80211_intmit_data* imd); 111 | // 19 - POWER 112 | IOReturn getPOWER(IO80211Interface* interface, struct apple80211_power_data* pd); 113 | IOReturn setPOWER(IO80211Interface* interface, struct apple80211_power_data* pd); 114 | // 20 - ASSOCIATE 115 | IOReturn setASSOCIATE(IO80211Interface* interface,struct apple80211_assoc_data* ad); 116 | // 27 - SUPPORTED_CHANNELS 117 | IOReturn getSUPPORTED_CHANNELS(IO80211Interface* interface, struct apple80211_sup_channel_data* ad); 118 | // 28 - LOCALE 119 | IOReturn getLOCALE(IO80211Interface* interface, struct apple80211_locale_data* ld); 120 | // 37 - TX_ANTENNA 121 | IOReturn getTX_ANTENNA(IO80211Interface* interface, apple80211_antenna_data* ad); 122 | // 39 - ANTENNA_DIVERSITY 123 | IOReturn getANTENNA_DIVERSITY(IO80211Interface* interface, apple80211_antenna_data* ad); 124 | // 43 - DRIVER_VERSION 125 | IOReturn getDRIVER_VERSION(IO80211Interface* interface, struct apple80211_version_data* hv); 126 | // 44 - HARDWARE_VERSION 127 | IOReturn getHARDWARE_VERSION(IO80211Interface* interface, struct apple80211_version_data* hv); 128 | // 51 - COUNTRY_CODE 129 | IOReturn getCOUNTRY_CODE(IO80211Interface* interface, struct apple80211_country_code_data* cd); 130 | // 57 - MCS 131 | IOReturn getMCS(IO80211Interface* interface, struct apple80211_mcs_data* md); 132 | IOReturn getROAM_THRESH(IO80211Interface* interface, struct apple80211_roam_threshold_data* md); 133 | IOReturn getRADIO_INFO(IO80211Interface* interface, struct apple80211_radio_info_data* md); 134 | 135 | 136 | inline void ReleaseAll() { 137 | RELEASE(fOutputQueue); 138 | RELEASE(fCommandGate); 139 | RELEASE(fWorkloop); 140 | RELEASE(mediumDict); 141 | RELEASE(fWorkloop); 142 | RELEASE(fPciDevice); 143 | 144 | if (dev) { 145 | delete dev; 146 | dev = NULL; 147 | } 148 | } 149 | 150 | bool addMediumType(UInt32 type, UInt32 speed, UInt32 code, char* name = 0); 151 | 152 | IO80211WorkLoop* fWorkloop; 153 | IO80211Interface* fInterface; 154 | IOGatedOutputQueue* fOutputQueue; 155 | IOCommandGate* fCommandGate; 156 | IOPCIDevice* fPciDevice; 157 | 158 | FakeDevice* dev; 159 | 160 | OSDictionary* mediumDict; 161 | IONetworkMedium* mediumTable[MEDIUM_TYPE_INVALID]; 162 | }; 163 | 164 | #endif 165 | -------------------------------------------------------------------------------- /Black80211/debug.h: -------------------------------------------------------------------------------- 1 | // 2 | // debug.h 3 | // Black80211_HighSierra 4 | // 5 | // Created by Roman Peshkov on 05/07/2018. 6 | // Copyright © 2018 Roman Peshkov. All rights reserved. 7 | // 8 | 9 | #ifndef debug_h 10 | #define debug_h 11 | 12 | const char* IOCTL_NAMES[] = { 13 | "UNKNOWN", 14 | "SSID", 15 | "AUTH_TYPE", 16 | "CIPHER_KEY", 17 | "CHANNEL", 18 | "POWERSAVE", 19 | "PROTMODE", 20 | "TXPOWER", 21 | "RATE", 22 | "BSSID", 23 | "SCAN_REQ", 24 | "SCAN_RESULT", 25 | "CARD_CAPABILITIES", 26 | "STATE", 27 | "PHY_MODE", 28 | "OP_MODE", 29 | "RSSI", 30 | "NOISE", 31 | "INT_MIT", 32 | "POWER", 33 | "ASSOCIATE", 34 | "ASSOCIATE_RESULT", 35 | "DISASSOCIATE", 36 | "STATUS_DEV_NAME", 37 | "IBSS_MODE", 38 | "HOST_AP_MODE", 39 | "AP_MODE", 40 | "SUPPORTED_CHANNELS", 41 | "LOCALE", 42 | "DEAUTH", 43 | "COUNTERMEASURES", 44 | "FRAG_THRESHOLD", 45 | "RATE_SET", 46 | "SHORT_SLOT", 47 | "MULTICAST_RATE", 48 | "SHORT_RETRY_LIMIT", 49 | "LONG_RETRY_LIMIT", 50 | "TX_ANTENNA", 51 | "RX_ANTENNA", 52 | "ANTENNA_DIVERSITY", 53 | "ROM", 54 | "DTIM_INT", 55 | "STATION_LIST", 56 | "DRIVER_VERSION", 57 | "HARDWARE_VERSION", 58 | "RAND", 59 | "RSN_IE", 60 | "BACKGROUND_SCAN", 61 | "AP_IE_LIST", 62 | "STATS", 63 | "ASSOCIATION_STATUS", 64 | "COUNTRY_CODE", 65 | "DEBUG_FLAGS", 66 | "LAST_RX_PKT_DATA", 67 | "RADIO_INFO", 68 | "GUARD_INTERVAL", 69 | "MIMO_POWERSAVE", 70 | "MCS", 71 | "RIFS", 72 | "LDPC", 73 | "MSDU", 74 | "MPDU", 75 | "BLOCK_ACK", 76 | "PLS", 77 | "PSMP", 78 | "PHY_SUB_MODE", 79 | "MCS_INDEX_SET", 80 | "CACHE_THRESH_BCAST", 81 | "CACHE_THRESH_DIRECT", 82 | "WOW_PARAMETERS", 83 | "WOW_ENABLED", 84 | "40MHZ_INTOLERANT", 85 | "PID_LOCK", 86 | "STA_IE_LIST", 87 | "STA_AUTHORIZE", 88 | "STA_DISASSOCIATE", 89 | "STA_DEAUTH", 90 | "RSN_CONF", 91 | "KEY_RSC", 92 | "STA_STATS", 93 | "ROAM_THRESH", 94 | "VENDOR_DBG_FLAGS", 95 | "CACHE_AGE_THRESH", 96 | "PMK_CACHE", 97 | "LINK_QUAL_EVENT_PARAMS", 98 | "IE", 99 | "SCAN_REQ_MULTIPLE", 100 | "BTCOEX_MODE", 101 | "WOW_TEST", 102 | "CLEAR_PMK_CACHE", 103 | "SCANCACHE_CLEAR", 104 | "P2P_ENABLE", 105 | "P2P_LISTEN", 106 | "P2P_SCAN", 107 | "VIRTUAL_IF_CREATE", 108 | "VIRTUAL_IF_DELETE", 109 | "VIRTUAL_IF_ROLE", 110 | "VIRTUAL_IF_PARENT", 111 | "P2P_GO_CONF", 112 | "P2P_NOA_LIST", 113 | "P2P_OPP_PS", 114 | "P2P_CT_WINDOW", 115 | "BT_COEX_FLAGS", 116 | "CURRENT_NETWORK", 117 | "BT_POWER", 118 | "AVAILABILITY", 119 | "RSSI_BOUNDS", 120 | "ROAM", 121 | "TX_CHAIN_POWER", 122 | "CDD_MODE", 123 | "LAST_BCAST_SCAN_TIME", 124 | "THERMAL_THROTTLING", 125 | "FACTORY_MODE", 126 | "REASSOCIATE", 127 | "???MISSING???", 128 | "POWER_DEBUG_INFO", 129 | "AWDL_SYNC_PARAMS", 130 | "AWDL_SYNC_ENABLED", 131 | "AWDL_EXTENSION_STATE_MACHINE_PARAMETERS", 132 | "AWDL_SERVICE_PARAMS", 133 | "AWDL_PEER_SERVICE_REQUEST", 134 | "AWDL_ELECTION_ALGORITHM_ENABLED", 135 | "AWDL_ELECTION_ID", 136 | "AWDL_MAX_TREE_DEPTH", 137 | "AWDL_GUARD_TIME", 138 | "AWDL_BSSID", 139 | "AWDL_ELECTION_METRIC", 140 | "AWDL_AVAILABILITY_WINDOW_AP_ALIGNMENT", 141 | "AWDL_SYNC_FRAME_AP_BEACON_ALIGNMENT", 142 | "AWDL_SYNCHRONIZATION_CHANNEL_SEQUENCE", 143 | "PEER_CACHE_MAXIMUM_SIZE", 144 | "AWDL_OUI", 145 | "AWDL_MASTER_CHANNEL", 146 | "AWDL_TOP_MASTER", 147 | "AWDL_SYNC_STATE", 148 | "AWDL_ELECTION_RSSI_THRESHOLDS", 149 | "AWDL_PRESENCE_MODE", 150 | "AWDL_ELECTION_MASTER_COUNTS", 151 | "AWDL_PERIODIC_SYNC_FRAME_PACKET_LIFETIME", 152 | "AWDL_MASTER_MODE_SYNC_FRAME_PERIOD", 153 | "AWDL_NON_ELECTION_MASTER_MODE_SYNC_FRAME_PERIOD", 154 | "AWDL_EXPLICIT_AVAILABILITY_WINDOW_EXTENSION_OPT_OUT", 155 | "AWDL_GET_AWDL_MASTER_DATABASE", 156 | "PEER_CACHE_CONTROL", 157 | "AWDL_BATTERY_LEVEL", 158 | "AWDL_BT_COEX_AW_PROTECTED_PERIOD_LENGTH", 159 | "AWDL_BT_COEX_AGREEMENT", 160 | "AWDL_BT_COEX_AGREEMENT_ENABLED", 161 | "AWDL_STRATEGY", 162 | "AWDL_OOB_REQUEST", 163 | "AWDL_MAX_NO_MASTER_PERIODS", 164 | "AWDL_SYNC_FRAME_TEMPLATE", 165 | "LOG_FLAGS", 166 | "PEER_STATS", 167 | "HT_CAPABILITY", 168 | "AWDL_ELECTION_PARAMS", 169 | "LINK_CHANGED_EVENT_DATA", 170 | "GET_DEBUG_INFO", 171 | "AWDL_DEVICE_CAPABILITIES", 172 | "AWDL_RSSI_MEASUREMENT_REQUEST", 173 | "AWDL_AES_KEY", 174 | "AWDL_SCAN_RESERVED_TIME", 175 | "AWDL_CTL", 176 | "AWDL_SOCIAL_TIME_SLOTS", 177 | "AWDL_PEER_TRAFFIC_REGISTRATION", 178 | "EXTENDED_STATS", 179 | "BEACON_PERIOD", 180 | "AWDL_FORCED_ROAM_CONFIG", 181 | "AWDL_QUIET", 182 | "ACL_POLICY", 183 | "ACL_ADD", 184 | "ACL_REMOVE", 185 | "ACL_FLUSH", 186 | "ACL_LIST", 187 | "CHAIN_ACK", 188 | "DESENSE", 189 | "OFFLOAD_SCANNING", 190 | "OFFLOAD_RSN", 191 | "OFFLOAD_COUNTRY_CODE", 192 | "OFFLOAD_KEEPALIVE_L2", 193 | "OFFLOAD_ARP_NDP", 194 | "VHT_MCS_INDEX_SET", 195 | "DWDS", 196 | "INTERRUPT_STATS", 197 | "INTERRUPT_STATS_RESET", 198 | "TIMER_STATS", 199 | "TIMER_STATS_RESET", 200 | "OFFLOAD_STATS", 201 | "OFFLOAD_STATS_RESET", 202 | "OFFLOAD_BEACONS", 203 | "ROAMING", 204 | "OFFLOAD_ARP", 205 | "OFFLOAD_NDP", 206 | "OFFLOAD_SCAN", 207 | "DESENSE_LEVEL", 208 | "MCS_VHT", 209 | "TX_NSS", 210 | "GAS_REQ", 211 | "GAS_START", 212 | "GAS_SET_PEER", 213 | "GAS_RESULTS", 214 | "AWDL_BTLE_PEER_INDICATION", 215 | "AWDL_BTLE_STATE_PARAMS", 216 | "AWDL_PEER_DATABASE", 217 | "AWDL_BTLE_ENABLE_SYNC_WITH_PARAMS", 218 | "AWDL_SECONDARY_MASTER_CHANNEL", 219 | "PHY_STATS", 220 | "CHANNELS_INFO", 221 | "AWDL_AF_TX_MODE", 222 | "ERROR_STRING", 223 | "ERROR_NO", 224 | "AWDL_PIGGYBACK_SCAN_REQ", 225 | "AWDL_PRIVATE_ELECTION_ID", 226 | "AWDL_MIN_RATE", 227 | "VHT_CAPABILITY", 228 | "BGSCAN_CACHE_RESULTS", 229 | "ROAM_PROFILE", 230 | "AWDL_OPER_MODE", 231 | "RESTORE_DEFAULTS", 232 | "AWDL_ENCRYPTION_KEYS", 233 | "AWDL_ENCRYPTION_TYPE", 234 | "BTCOEX_PROFILES", 235 | "BTCOEX_CONFIG", 236 | "AWDL_STATISTICS", 237 | "AWDL_ENABLE_ROAMING", 238 | "AWDL_OOB_AUTO_REQUEST", 239 | "AWDL_TXCAL_PERIOD", 240 | "CHIP_COUNTER_STATS", 241 | "DBG_GUARD_TIME_PARAMS", 242 | "AWDL_AWDL_ADVERTISERS", 243 | "LEAKY_AP_STATS_MODE", 244 | "CAPTURE", 245 | "LEAKY_AP_STATS", 246 | "AWDL_BLOCK_SET_COMMANDS", 247 | "LEAKY_AP_AWD_MODE", 248 | "BTCOEX_OPTIONS", 249 | "FORCE_SYNC_TO_PEER", 250 | "COUNTRY_CHANNELS", 251 | "PRIVATE_MAC", 252 | "RESET_CHIP", 253 | "CRASH", 254 | "RANGING_ENABLE", 255 | "RANGING_START", 256 | "RANGING_AUTHENTICATE", 257 | "AWDL_PREFERRED_CHANNELS", 258 | "LEAKY_AP_SSID_STATS", 259 | "AWDL_RSDB_CAPS", 260 | "AWDL_DEV_STATS", 261 | "LAST_ASSOC_HISTORY", 262 | "AWDL_COMMON_CHANNEL", 263 | "AWDL_PEERS_INFO", 264 | "TKO_PARAMS", 265 | "TKO_DUMP", 266 | "AWDL_NEARBY_LOG_TRIGGER", 267 | "HW_SUPPORTED_CHANNELS", 268 | "BTCOEX_PROFILE", 269 | "BTCOEX_PROFILE_ACTIVE", 270 | "TRAP_INFO", 271 | "THERMAL_INDEX", 272 | "MAX_NSS_FOR_AP", 273 | "BTCOEX_2G_CHAIN_DISABLE", 274 | "POWER_BUDGET", 275 | "AWDL_DFSP_CONFIG", 276 | "AWDL_DFSP_UCSA_CONFIG", 277 | "SCAN_BACKOFF_REPORT", 278 | "OFFLOAD_TCPKA_ENABLE", 279 | "RANGING_CAPS", 280 | "PER_CORE_RSSI_REPORT", 281 | }; 282 | 283 | 284 | #endif /* debug_h */ 285 | -------------------------------------------------------------------------------- /Black80211/apple80211/ioctl: -------------------------------------------------------------------------------- 1 | #define APPLE80211_IOC_PID_LOCK 0 2 | #define APPLE80211_IOC_STA_IE_LIST 0 3 | #define APPLE80211_IOC_STA_AUTHORIZE 0 4 | #define APPLE80211_IOC_STA_DISASSOCIATE 0 5 | #define APPLE80211_IOC_STA_DEAUTH 0 6 | #define APPLE80211_IOC_RSN_CONF 0 7 | #define APPLE80211_IOC_KEY_RSC 0 8 | #define APPLE80211_IOC_STA_STATS 0 9 | #define APPLE80211_IOC_ROAM_THRESH 0 10 | #define APPLE80211_IOC_VENDOR_DBG_FLAGS 0 11 | #define APPLE80211_IOC_CACHE_AGE_THRESH 0 12 | #define APPLE80211_IOC_PMK_CACHE 0 13 | #define APPLE80211_IOC_LINK_QUAL_EVENT_PARAMS 0 14 | #define APPLE80211_IOC_IE 0 15 | #define APPLE80211_IOC_SCAN_REQ_MULTIPLE 0 16 | #define APPLE80211_IOC_BTCOEX_MODE 0 17 | #define APPLE80211_IOC_WOW_TEST 0 18 | #define APPLE80211_IOC_CLEAR_PMK_CACHE 0 19 | #define APPLE80211_IOC_SCANCACHE_CLEAR 0 20 | #define APPLE80211_IOC_P2P_ENABLE 0 21 | #define APPLE80211_IOC_P2P_LISTEN 0 22 | #define APPLE80211_IOC_P2P_SCAN 0 23 | #define APPLE80211_IOC_VIRTUAL_IF_CREATE 0 24 | #define APPLE80211_IOC_VIRTUAL_IF_DELETE 0 25 | #define APPLE80211_IOC_VIRTUAL_IF_ROLE 0 26 | #define APPLE80211_IOC_VIRTUAL_IF_PARENT 0 27 | #define APPLE80211_IOC_P2P_GO_CONF 0 28 | #define APPLE80211_IOC_P2P_NOA_LIST 0 29 | #define APPLE80211_IOC_P2P_OPP_PS 0 30 | #define APPLE80211_IOC_P2P_CT_WINDOW 0 31 | #define APPLE80211_IOC_BT_COEX_FLAGS 0 32 | #define APPLE80211_IOC_CURRENT_NETWORK 0 33 | #define APPLE80211_IOC_BT_POWER 0 34 | #define APPLE80211_IOC_AVAILABILITY 0 35 | #define APPLE80211_IOC_RSSI_BOUNDS 0 36 | #define APPLE80211_IOC_ROAM 0 37 | #define APPLE80211_IOC_TX_CHAIN_POWER 0 38 | #define APPLE80211_IOC_CDD_MODE 0 39 | #define APPLE80211_IOC_LAST_BCAST_SCAN_TIME 0 40 | #define APPLE80211_IOC_THERMAL_THROTTLING 0 41 | #define APPLE80211_IOC_FACTORY_MODE 0 42 | #define APPLE80211_IOC_REASSOCIATE 0 43 | #define APPLE80211_IOC_POWER_DEBUG_INFO 0 44 | #define APPLE80211_IOC_AWDL_SYNC_PARAMS 0 45 | #define APPLE80211_IOC_AWDL_SYNC_ENABLED 0 46 | #define APPLE80211_IOC_AWDL_EXTENSION_STATE_MACHINE_PARAMETERS 0 47 | #define APPLE80211_IOC_AWDL_SERVICE_PARAMS 0 48 | #define APPLE80211_IOC_AWDL_PEER_SERVICE_REQUEST 0 49 | #define APPLE80211_IOC_AWDL_ELECTION_ALGORITHM_ENABLED 0 50 | #define APPLE80211_IOC_AWDL_ELECTION_ID 0 51 | #define APPLE80211_IOC_AWDL_MAX_TREE_DEPTH 0 52 | #define APPLE80211_IOC_AWDL_GUARD_TIME 0 53 | #define APPLE80211_IOC_AWDL_BSSID 0 54 | #define APPLE80211_IOC_AWDL_ELECTION_METRIC 0 55 | #define APPLE80211_IOC_AWDL_AVAILABILITY_WINDOW_AP_ALIGNMENT 0 56 | #define APPLE80211_IOC_AWDL_SYNC_FRAME_AP_BEACON_ALIGNMENT 0 57 | #define APPLE80211_IOC_AWDL_SYNCHRONIZATION_CHANNEL_SEQUENCE 0 58 | #define APPLE80211_IOC_PEER_CACHE_MAXIMUM_SIZE 0 59 | #define APPLE80211_IOC_AWDL_OUI 0 60 | #define APPLE80211_IOC_AWDL_MASTER_CHANNEL 0 61 | #define APPLE80211_IOC_AWDL_TOP_MASTER 0 62 | #define APPLE80211_IOC_AWDL_SYNC_STATE 0 63 | #define APPLE80211_IOC_AWDL_ELECTION_RSSI_THRESHOLDS 0 64 | #define APPLE80211_IOC_AWDL_PRESENCE_MODE 0 65 | #define APPLE80211_IOC_AWDL_ELECTION_MASTER_COUNTS 0 66 | #define APPLE80211_IOC_AWDL_PERIODIC_SYNC_FRAME_PACKET_LIFETIME 0 67 | #define APPLE80211_IOC_AWDL_MASTER_MODE_SYNC_FRAME_PERIOD 0 68 | #define APPLE80211_IOC_AWDL_NON_ELECTION_MASTER_MODE_SYNC_FRAME_PERIOD 0 69 | #define APPLE80211_IOC_AWDL_EXPLICIT_AVAILABILITY_WINDOW_EXTENSION_OPT_OUT 0 70 | #define APPLE80211_IOC_AWDL_GET_AWDL_MASTER_DATABASE 0 71 | #define APPLE80211_IOC_PEER_CACHE_CONTROL 0 72 | #define APPLE80211_IOC_AWDL_BATTERY_LEVEL 0 73 | #define APPLE80211_IOC_AWDL_BT_COEX_AW_PROTECTED_PERIOD_LENGTH 0 74 | #define APPLE80211_IOC_AWDL_BT_COEX_AGREEMENT 0 75 | #define APPLE80211_IOC_AWDL_BT_COEX_AGREEMENT_ENABLED 0 76 | #define APPLE80211_IOC_AWDL_STRATEGY 0 77 | #define APPLE80211_IOC_AWDL_OOB_REQUEST 0 78 | #define APPLE80211_IOC_AWDL_MAX_NO_MASTER_PERIODS 0 79 | #define APPLE80211_IOC_AWDL_SYNC_FRAME_TEMPLATE 0 80 | #define APPLE80211_IOC_LOG_FLAGS 0 81 | #define APPLE80211_IOC_PEER_STATS 0 82 | #define APPLE80211_IOC_HT_CAPABILITY 0 83 | #define APPLE80211_IOC_AWDL_ELECTION_PARAMS 0 84 | #define APPLE80211_IOC_LINK_CHANGED_EVENT_DATA 0 85 | #define APPLE80211_IOC_GET_DEBUG_INFO 0 86 | #define APPLE80211_IOC_AWDL_DEVICE_CAPABILITIES 0 87 | #define APPLE80211_IOC_AWDL_RSSI_MEASUREMENT_REQUEST 0 88 | #define APPLE80211_IOC_AWDL_AES_KEY 0 89 | #define APPLE80211_IOC_AWDL_SCAN_RESERVED_TIME 0 90 | #define APPLE80211_IOC_AWDL_CTL 0 91 | #define APPLE80211_IOC_AWDL_SOCIAL_TIME_SLOTS 0 92 | #define APPLE80211_IOC_AWDL_PEER_TRAFFIC_REGISTRATION 0 93 | #define APPLE80211_IOC_EXTENDED_STATS 0 94 | #define APPLE80211_IOC_BEACON_PERIOD 0 95 | #define APPLE80211_IOC_AWDL_FORCED_ROAM_CONFIG 0 96 | #define APPLE80211_IOC_AWDL_QUIET 0 97 | #define APPLE80211_IOC_ACL_POLICY 0 98 | #define APPLE80211_IOC_ACL_ADD 0 99 | #define APPLE80211_IOC_ACL_REMOVE 0 100 | #define APPLE80211_IOC_ACL_FLUSH 0 101 | #define APPLE80211_IOC_ACL_LIST 0 102 | #define APPLE80211_IOC_CHAIN_ACK 0 103 | #define APPLE80211_IOC_DESENSE 0 104 | #define APPLE80211_IOC_OFFLOAD_SCANNING 0 105 | #define APPLE80211_IOC_OFFLOAD_RSN 0 106 | #define APPLE80211_IOC_OFFLOAD_COUNTRY_CODE 0 107 | #define APPLE80211_IOC_OFFLOAD_KEEPALIVE_L2 0 108 | #define APPLE80211_IOC_OFFLOAD_ARP_NDP 0 109 | #define APPLE80211_IOC_VHT_MCS_INDEX_SET 0 110 | #define APPLE80211_IOC_DWDS 0 111 | #define APPLE80211_IOC_INTERRUPT_STATS 0 112 | #define APPLE80211_IOC_INTERRUPT_STATS_RESET 0 113 | #define APPLE80211_IOC_TIMER_STATS 0 114 | #define APPLE80211_IOC_TIMER_STATS_RESET 0 115 | #define APPLE80211_IOC_OFFLOAD_STATS 0 116 | #define APPLE80211_IOC_OFFLOAD_STATS_RESET 0 117 | #define APPLE80211_IOC_OFFLOAD_BEACONS 0 118 | #define APPLE80211_IOC_ROAMING 0 119 | #define APPLE80211_IOC_OFFLOAD_ARP 0 120 | #define APPLE80211_IOC_OFFLOAD_NDP 0 121 | #define APPLE80211_IOC_OFFLOAD_SCAN 0 122 | #define APPLE80211_IOC_DESENSE_LEVEL 0 123 | #define APPLE80211_IOC_MCS_VHT 0 124 | #define APPLE80211_IOC_TX_NSS 0 125 | #define APPLE80211_IOC_GAS_REQ 0 126 | #define APPLE80211_IOC_GAS_START 0 127 | #define APPLE80211_IOC_GAS_SET_PEER 0 128 | #define APPLE80211_IOC_GAS_RESULTS 0 129 | #define APPLE80211_IOC_AWDL_BTLE_PEER_INDICATION 0 130 | #define APPLE80211_IOC_AWDL_BTLE_STATE_PARAMS 0 131 | #define APPLE80211_IOC_AWDL_PEER_DATABASE 0 132 | #define APPLE80211_IOC_AWDL_BTLE_ENABLE_SYNC_WITH_PARAMS 0 133 | #define APPLE80211_IOC_AWDL_SECONDARY_MASTER_CHANNEL 0 134 | #define APPLE80211_IOC_PHY_STATS 0 135 | #define APPLE80211_IOC_CHANNELS_INFO 0 136 | #define APPLE80211_IOC_AWDL_AF_TX_MODE 0 137 | #define APPLE80211_IOC_ERROR_STRING 0 138 | #define APPLE80211_IOC_ERROR_NO 0 139 | #define APPLE80211_IOC_AWDL_PIGGYBACK_SCAN_REQ 0 140 | #define APPLE80211_IOC_AWDL_PRIVATE_ELECTION_ID 0 141 | #define APPLE80211_IOC_AWDL_MIN_RATE 0 142 | #define APPLE80211_IOC_VHT_CAPABILITY 0 143 | #define APPLE80211_IOC_BGSCAN_CACHE_RESULTS 0 144 | #define APPLE80211_IOC_ROAM_PROFILE 0 145 | #define APPLE80211_IOC_AWDL_OPER_MODE 0 146 | #define APPLE80211_IOC_RESTORE_DEFAULTS 0 147 | #define APPLE80211_IOC_AWDL_ENCRYPTION_KEYS 0 148 | #define APPLE80211_IOC_AWDL_ENCRYPTION_TYPE 0 149 | #define APPLE80211_IOC_BTCOEX_PROFILES 0 150 | #define APPLE80211_IOC_BTCOEX_CONFIG 0 151 | #define APPLE80211_IOC_AWDL_STATISTICS 0 152 | #define APPLE80211_IOC_AWDL_ENABLE_ROAMING 0 153 | #define APPLE80211_IOC_AWDL_OOB_AUTO_REQUEST 0 154 | #define APPLE80211_IOC_AWDL_TXCAL_PERIOD 0 155 | #define APPLE80211_IOC_CHIP_COUNTER_STATS 0 156 | #define APPLE80211_IOC_DBG_GUARD_TIME_PARAMS 0 157 | #define APPLE80211_IOC_AWDL_AWDL_ADVERTISERS 0 158 | #define APPLE80211_IOC_LEAKY_AP_STATS_MODE 0 159 | #define APPLE80211_IOC_CAPTURE 0 160 | #define APPLE80211_IOC_LEAKY_AP_STATS 0 161 | #define APPLE80211_IOC_AWDL_BLOCK_SET_COMMANDS 0 162 | #define APPLE80211_IOC_LEAKY_AP_AWD_MODE 0 163 | #define APPLE80211_IOC_BTCOEX_OPTIONS 0 164 | #define APPLE80211_IOC_FORCE_SYNC_TO_PEER 0 165 | #define APPLE80211_IOC_COUNTRY_CHANNELS 0 166 | #define APPLE80211_IOC_PRIVATE_MAC 0 167 | #define APPLE80211_IOC_RESET_CHIP 0 168 | #define APPLE80211_IOC_CRASH 0 169 | #define APPLE80211_IOC_RANGING_ENABLE 0 170 | #define APPLE80211_IOC_RANGING_START 0 171 | #define APPLE80211_IOC_RANGING_AUTHENTICATE 0 172 | #define APPLE80211_IOC_AWDL_PREFERRED_CHANNELS 0 173 | #define APPLE80211_IOC_LEAKY_AP_SSID_STATS 0 174 | #define APPLE80211_IOC_AWDL_RSDB_CAPS 0 175 | #define APPLE80211_IOC_AWDL_DEV_STATS 0 176 | #define APPLE80211_IOC_LAST_ASSOC_HISTORY 0 177 | #define APPLE80211_IOC_AWDL_COMMON_CHANNEL 0 178 | #define APPLE80211_IOC_AWDL_PEERS_INFO 0 179 | #define APPLE80211_IOC_TKO_PARAMS 0 180 | #define APPLE80211_IOC_TKO_DUMP 0 181 | #define APPLE80211_IOC_AWDL_NEARBY_LOG_TRIGGER 0 182 | #define APPLE80211_IOC_HW_SUPPORTED_CHANNELS 0 183 | #define APPLE80211_IOC_BTCOEX_PROFILE 0 184 | #define APPLE80211_IOC_BTCOEX_PROFILE_ACTIVE 0 185 | #define APPLE80211_IOC_TRAP_INFO 0 186 | #define APPLE80211_IOC_THERMAL_INDEX 0 187 | #define APPLE80211_IOC_MAX_NSS_FOR_AP 0 188 | #define APPLE80211_IOC_BTCOEX_2G_CHAIN_DISABLE 0 189 | #define APPLE80211_IOC_POWER_BUDGET 0 190 | #define APPLE80211_IOC_AWDL_DFSP_CONFIG 0 191 | #define APPLE80211_IOC_AWDL_DFSP_UCSA_CONFIG 0 192 | #define APPLE80211_IOC_SCAN_BACKOFF_REPORT 0 193 | #define APPLE80211_IOC_OFFLOAD_TCPKA_ENABLE 0 194 | #define APPLE80211_IOC_RANGING_CAPS 0 195 | #define APPLE80211_IOC_PER_CORE_RSSI_REPORT 0 196 | -------------------------------------------------------------------------------- /Black80211/Black80211Control.cpp: -------------------------------------------------------------------------------- 1 | /* add your code here*/ 2 | 3 | typedef unsigned int ifnet_ctl_cmd_t; 4 | 5 | #include "IONetworkInterface.h" 6 | #include "IONetworkController.h" 7 | 8 | #include "Black80211Control.hpp" 9 | 10 | #include "debug.h" 11 | 12 | OSDefineMetaClassAndStructors(Black80211Control, IO80211Controller); 13 | #define super IO80211Controller 14 | 15 | bool Black80211Control::init(OSDictionary* parameters) { 16 | IOLog("Black80211: Init"); 17 | 18 | if (!super::init(parameters)) { 19 | IOLog("Black80211: Failed to call IO80211Controller::init!"); 20 | return false; 21 | } 22 | 23 | dev = new FakeDevice(); 24 | return true; 25 | } 26 | 27 | void Black80211Control::free() { 28 | IOLog("Black80211: Free"); 29 | 30 | ReleaseAll(); 31 | super::free(); 32 | } 33 | 34 | IOService* Black80211Control::probe(IOService *provider, SInt32 *score) { 35 | IOLog("Black80211: probing"); 36 | 37 | super::probe(provider, score); 38 | 39 | fPciDevice = OSDynamicCast(IOPCIDevice, provider); 40 | if (!fPciDevice) { 41 | IOLog("Black80211: Provider is not PCI device"); 42 | fPciDevice = NULL; 43 | return NULL; 44 | } 45 | UInt16 fDeviceId = fPciDevice->configRead16(kIOPCIConfigDeviceID); 46 | UInt16 fSubsystemId = fPciDevice->configRead16(kIOPCIConfigSubSystemID); 47 | 48 | if(fDeviceId != 0x24FD) { 49 | IOLog("Black80211: not a 8265 device"); 50 | fPciDevice = NULL; 51 | return NULL; 52 | } 53 | 54 | fPciDevice->retain(); 55 | 56 | return this; 57 | } 58 | 59 | bool Black80211Control::createWorkLoop() { 60 | if(!fWorkloop) { 61 | fWorkloop = IO80211WorkLoop::workLoop(); 62 | } 63 | 64 | return (fWorkloop != NULL); 65 | } 66 | 67 | IOWorkLoop* Black80211Control::getWorkLoop() const { 68 | return fWorkloop; 69 | } 70 | 71 | bool Black80211Control::start(IOService* provider) { 72 | IOLog("Black80211: Start"); 73 | if (!super::start(provider)) { 74 | IOLog("Black80211: Failed to call IO80211Controller::start!"); 75 | ReleaseAll(); 76 | return false; 77 | } 78 | 79 | //fWorkloop = (IO80211WorkLoop *)getWorkLoop(); 80 | if (!fWorkloop) { 81 | IOLog("Black80211: Failed to get workloop!"); 82 | ReleaseAll(); 83 | return false; 84 | } 85 | 86 | fCommandGate = IOCommandGate::commandGate(this); 87 | if (!fCommandGate) { 88 | IOLog("Black80211: Failed to create command gate!"); 89 | ReleaseAll(); 90 | return false; 91 | } 92 | 93 | if (fWorkloop->addEventSource(fCommandGate) != kIOReturnSuccess) { 94 | IOLog("Black80211: Failed to register command gate event source!"); 95 | ReleaseAll(); 96 | return false; 97 | } 98 | 99 | fCommandGate->enable(); 100 | 101 | mediumDict = OSDictionary::withCapacity(MEDIUM_TYPE_INVALID + 1); 102 | addMediumType(kIOMediumIEEE80211None, 0, MEDIUM_TYPE_NONE); 103 | addMediumType(kIOMediumIEEE80211Auto, 0, MEDIUM_TYPE_AUTO); 104 | addMediumType(kIOMediumIEEE80211DS1, 1000000, MEDIUM_TYPE_1MBIT); 105 | addMediumType(kIOMediumIEEE80211DS2, 2000000, MEDIUM_TYPE_2MBIT); 106 | addMediumType(kIOMediumIEEE80211DS5, 5500000, MEDIUM_TYPE_5MBIT); 107 | addMediumType(kIOMediumIEEE80211DS11, 11000000, MEDIUM_TYPE_11MBIT); 108 | addMediumType(kIOMediumIEEE80211, 54000000, MEDIUM_TYPE_54MBIT, "OFDM54"); 109 | //addMediumType(kIOMediumIEEE80211OptionAdhoc, 0, MEDIUM_TYPE_ADHOC,"ADHOC"); 110 | 111 | if (!publishMediumDictionary(mediumDict)) { 112 | IOLog("Black80211: Failed to publish medium dictionary!"); 113 | ReleaseAll(); 114 | return false; 115 | } 116 | 117 | if (!setCurrentMedium(mediumTable[MEDIUM_TYPE_AUTO])) { 118 | IOLog("Black80211: Failed to set current medium!"); 119 | ReleaseAll(); 120 | return false; 121 | } 122 | if (!setSelectedMedium(mediumTable[MEDIUM_TYPE_AUTO])) { 123 | IOLog("Black80211: Failed to set selected medium!"); 124 | ReleaseAll(); 125 | return false; 126 | } 127 | 128 | /* 129 | if (!setLinkStatus(kIONetworkLinkValid, mediumTable[MEDIUM_TYPE_AUTO])) { 130 | IOLog("Black80211: Failed to set link status!"); 131 | ReleaseAll(); 132 | return false; 133 | } 134 | */ 135 | if (!attachInterface((IONetworkInterface**) &fInterface, true)) { 136 | kprintf("Black80211: Failed to attach interface!"); 137 | ReleaseAll(); 138 | return false; 139 | } 140 | 141 | 142 | fInterface->registerService(); 143 | registerService(); 144 | 145 | 146 | return true; 147 | } 148 | 149 | IOReturn Black80211Control::enable(IONetworkInterface* iface) { 150 | kprintf("Black80211: enable"); 151 | IOMediumType mediumType = kIOMediumIEEE80211Auto; 152 | IONetworkMedium *medium = IONetworkMedium::getMediumWithType(mediumDict, mediumType); 153 | setLinkStatus(kIONetworkLinkActive | kIONetworkLinkValid, medium); 154 | 155 | if(fInterface) { 156 | fInterface->postMessage(1); 157 | } 158 | 159 | return kIOReturnSuccess; 160 | } 161 | 162 | IOReturn Black80211Control::disable(IONetworkInterface* iface) { 163 | kprintf("Black80211: disable"); 164 | return kIOReturnSuccess; 165 | } 166 | 167 | bool Black80211Control::addMediumType(UInt32 type, UInt32 speed, UInt32 code, char* name) { 168 | bool ret = false; 169 | 170 | IONetworkMedium* medium = IONetworkMedium::medium(type, speed, 0, code, name); 171 | if (medium) { 172 | ret = IONetworkMedium::addMedium(mediumDict, medium); 173 | if (ret) 174 | mediumTable[code] = medium; 175 | medium->release(); 176 | } 177 | return ret; 178 | } 179 | 180 | 181 | void Black80211Control::stop(IOService* provider) { 182 | if (fCommandGate) { 183 | IOLog("Black80211::stop: Command gate alive. Disabling it."); 184 | fCommandGate->disable(); 185 | IOLog("Black80211::stop: Done disabling command gate"); 186 | if (fWorkloop) { 187 | IOLog("Black80211::stop: Workloop alive. Removing command gate"); 188 | fWorkloop->removeEventSource(fCommandGate); 189 | } 190 | } 191 | 192 | if (fInterface) { 193 | IOLog("Black80211::stop: Detaching interface"); 194 | detachInterface(fInterface, true); 195 | fInterface = NULL; 196 | } 197 | 198 | super::stop(provider); 199 | } 200 | 201 | IOReturn Black80211Control::getHardwareAddress(IOEthernetAddress* addr) { 202 | addr->bytes[0] = 0xAA; 203 | addr->bytes[1] = 0x99; 204 | addr->bytes[2] = 0x88; 205 | addr->bytes[3] = 0x77; 206 | addr->bytes[4] = 0x66; 207 | addr->bytes[5] = 0x55; 208 | return kIOReturnSuccess; 209 | } 210 | 211 | IOReturn Black80211Control::getHardwareAddressForInterface(IO80211Interface* netif, 212 | IOEthernetAddress* addr) { 213 | return getHardwareAddress(addr); 214 | } 215 | 216 | SInt32 Black80211Control::apple80211Request(unsigned int request_type, 217 | int request_number, 218 | IO80211Interface* interface, 219 | void* data) { 220 | if (request_type != SIOCGA80211 && request_type != SIOCSA80211) { 221 | IOLog("Black80211: Invalid IOCTL request type: %u", request_type); 222 | IOLog("Expected either %lu or %lu", SIOCGA80211, SIOCSA80211); 223 | return kIOReturnError; 224 | } 225 | 226 | IOReturn ret = 0; 227 | 228 | bool isGet = (request_type == SIOCGA80211); 229 | 230 | #define IOCTL(REQ_TYPE, REQ, DATA_TYPE) \ 231 | if (REQ_TYPE == SIOCGA80211) { \ 232 | ret = get##REQ(interface, (struct DATA_TYPE* )data); \ 233 | } else { \ 234 | ret = set##REQ(interface, (struct DATA_TYPE* )data); \ 235 | } 236 | 237 | #define IOCTL_GET(REQ_TYPE, REQ, DATA_TYPE) \ 238 | if (REQ_TYPE == SIOCGA80211) { \ 239 | ret = get##REQ(interface, (struct DATA_TYPE* )data); \ 240 | } 241 | #define IOCTL_SET(REQ_TYPE, REQ, DATA_TYPE) \ 242 | if (REQ_TYPE == SIOCSA80211) { \ 243 | ret = set##REQ(interface, (struct DATA_TYPE* )data); \ 244 | } 245 | 246 | kprintf("Black80211: IOCTL %s(%d) %s", 247 | isGet ? "get" : "set", 248 | request_number, 249 | IOCTL_NAMES[request_number]); 250 | 251 | switch (request_number) { 252 | case APPLE80211_IOC_SSID: // 1 253 | IOCTL(request_type, SSID, apple80211_ssid_data); 254 | break; 255 | case APPLE80211_IOC_AUTH_TYPE: // 2 256 | IOCTL_GET(request_type, AUTH_TYPE, apple80211_authtype_data); 257 | break; 258 | case APPLE80211_IOC_CHANNEL: // 4 259 | IOCTL_GET(request_type, CHANNEL, apple80211_channel_data); 260 | break; 261 | case APPLE80211_IOC_TXPOWER: // 7 262 | IOCTL_GET(request_type, TXPOWER, apple80211_txpower_data); 263 | break; 264 | case APPLE80211_IOC_RATE: // 8 265 | IOCTL_GET(request_type, RATE, apple80211_rate_data); 266 | break; 267 | case APPLE80211_IOC_BSSID: // 9 268 | IOCTL_GET(request_type, BSSID, apple80211_bssid_data); 269 | break; 270 | case APPLE80211_IOC_SCAN_REQ: // 10 271 | IOCTL_SET(request_type, SCAN_REQ, apple80211_scan_data); 272 | break; 273 | case APPLE80211_IOC_SCAN_RESULT: // 11 274 | IOCTL_GET(request_type, SCAN_RESULT, apple80211_scan_result*); 275 | break; 276 | case APPLE80211_IOC_CARD_CAPABILITIES: // 12 277 | IOCTL_GET(request_type, CARD_CAPABILITIES, apple80211_capability_data); 278 | break; 279 | case APPLE80211_IOC_STATE: // 13 280 | IOCTL_GET(request_type, STATE, apple80211_state_data); 281 | break; 282 | case APPLE80211_IOC_PHY_MODE: // 14 283 | IOCTL_GET(request_type, PHY_MODE, apple80211_phymode_data); 284 | break; 285 | case APPLE80211_IOC_OP_MODE: // 15 286 | IOCTL_GET(request_type, OP_MODE, apple80211_opmode_data); 287 | break; 288 | case APPLE80211_IOC_RSSI: // 16 289 | IOCTL_GET(request_type, RSSI, apple80211_rssi_data); 290 | break; 291 | case APPLE80211_IOC_NOISE: // 17 292 | IOCTL_GET(request_type, NOISE, apple80211_noise_data); 293 | break; 294 | case APPLE80211_IOC_INT_MIT: // 18 295 | IOCTL_GET(request_type, INT_MIT, apple80211_intmit_data); 296 | break; 297 | case APPLE80211_IOC_POWER: // 19 298 | IOCTL(request_type, POWER, apple80211_power_data); 299 | break; 300 | case APPLE80211_IOC_ASSOCIATE: // 20 301 | IOCTL_SET(request_type, ASSOCIATE, apple80211_assoc_data); 302 | break; 303 | case APPLE80211_IOC_SUPPORTED_CHANNELS: // 27 304 | IOCTL_GET(request_type, SUPPORTED_CHANNELS, apple80211_sup_channel_data); 305 | break; 306 | case APPLE80211_IOC_LOCALE: // 28 307 | IOCTL_GET(request_type, LOCALE, apple80211_locale_data); 308 | break; 309 | case APPLE80211_IOC_TX_ANTENNA: // 37 310 | IOCTL_GET(request_type, TX_ANTENNA, apple80211_antenna_data); 311 | break; 312 | case APPLE80211_IOC_ANTENNA_DIVERSITY: // 39 313 | IOCTL_GET(request_type, ANTENNA_DIVERSITY, apple80211_antenna_data); 314 | break; 315 | case APPLE80211_IOC_DRIVER_VERSION: // 43 316 | IOCTL_GET(request_type, DRIVER_VERSION, apple80211_version_data); 317 | break; 318 | case APPLE80211_IOC_HARDWARE_VERSION: // 44 319 | IOCTL_GET(request_type, HARDWARE_VERSION, apple80211_version_data); 320 | break; 321 | case APPLE80211_IOC_COUNTRY_CODE: // 51 322 | IOCTL_GET(request_type, COUNTRY_CODE, apple80211_country_code_data); 323 | break; 324 | case APPLE80211_IOC_RADIO_INFO: 325 | IOCTL_GET(request_type, RADIO_INFO, apple80211_radio_info_data); 326 | break; 327 | case APPLE80211_IOC_MCS: // 57 328 | IOCTL_GET(request_type, MCS, apple80211_mcs_data); 329 | break; 330 | case APPLE80211_IOC_WOW_PARAMETERS: // 69 331 | break; 332 | case APPLE80211_IOC_ROAM_THRESH: 333 | IOCTL_GET(request_type, ROAM_THRESH, apple80211_roam_threshold_data); 334 | break; 335 | case APPLE80211_IOC_TX_CHAIN_POWER: // 108 336 | break; 337 | case APPLE80211_IOC_THERMAL_THROTTLING: // 111 338 | break; 339 | default: 340 | kprintf("Black80211: unhandled ioctl %s %d", IOCTL_NAMES[request_number], request_number); 341 | break; 342 | } 343 | #undef IOCTL 344 | 345 | return ret; 346 | } 347 | 348 | bool Black80211Control::configureInterface(IONetworkInterface *netif) { 349 | kprintf("Black80211: Configure interface"); 350 | if (!super::configureInterface(netif)) { 351 | return false; 352 | } 353 | 354 | return true; 355 | } 356 | 357 | IO80211Interface* Black80211Control::getNetworkInterface() { 358 | return fInterface; 359 | } 360 | 361 | UInt32 Black80211Control::outputPacket(mbuf_t m, void* param) { 362 | freePacket(m); 363 | return kIOReturnSuccess; 364 | } 365 | 366 | IOReturn Black80211Control::getMaxPacketSize( UInt32* maxSize ) const { 367 | *maxSize = 1500; 368 | return kIOReturnSuccess; 369 | } 370 | 371 | IOReturn Black80211Control::setPromiscuousMode(IOEnetPromiscuousMode mode) { 372 | return kIOReturnSuccess; 373 | } 374 | 375 | IOReturn Black80211Control::setMulticastMode(IOEnetMulticastMode mode) { 376 | return kIOReturnSuccess; 377 | } 378 | 379 | IOReturn Black80211Control::setMulticastList(IOEthernetAddress* addr, UInt32 len) { 380 | return kIOReturnSuccess; 381 | } 382 | 383 | SInt32 Black80211Control::monitorModeSetEnabled(IO80211Interface* interface, 384 | bool enabled, 385 | UInt32 dlt) { 386 | return kIOReturnSuccess; 387 | } 388 | 389 | const OSString* Black80211Control::newVendorString() const { 390 | return OSString::withCString("black_wizard"); 391 | } 392 | 393 | const OSString* Black80211Control::newModelString() const { 394 | return OSString::withCString("BlackControl80211"); 395 | } 396 | 397 | const OSString* Black80211Control::newRevisionString() const { 398 | return OSString::withCString("1.0"); 399 | } 400 | -------------------------------------------------------------------------------- /Black80211/Black80211Control_ioctl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Black80211Control_ioctl.cpp 3 | // Black80211 4 | // 5 | // Created by Roman Peshkov on 30/06/2018. 6 | // Copyright © 2018 Roman Peshkov. All rights reserved. 7 | // 8 | 9 | #include "Black80211Control.hpp" 10 | 11 | const char *fake_ssid = "UPC5424297"; 12 | const uint8_t fake_bssid[] = { 0x64, 0x7C, 0x34, 0x5C, 0x1C, 0x40 }; 13 | const char *fake_hw_version = "Hardware 1.0"; 14 | const char *fake_drv_version = "Driver 1.0"; 15 | const char *fake_country_code = "CZ"; 16 | 17 | const apple80211_channel fake_channel = { 18 | .version = APPLE80211_VERSION, 19 | .channel = 1, 20 | .flags = APPLE80211_C_FLAG_2GHZ | APPLE80211_C_FLAG_20MHZ | APPLE80211_C_FLAG_ACTIVE 21 | }; 22 | 23 | // This string contains information elements from beacon frame that I captured via Wireshark 24 | const char beacon_ie[] = "\x00\x0a\x55" \ 25 | "\x50\x43\x35\x34\x32\x34\x32\x39\x37\x01\x08\x82\x84\x8b\x96\x0c" \ 26 | "\x12\x18\x24\x03\x01\x01\x05\x04\x00\x01\x00\x00\x07\x06\x43\x5a" \ 27 | "\x20\x01\x0d\x14\x2a\x01\x04\x32\x04\x30\x48\x60\x6c\x2d\x1a\xad" \ 28 | "\x01\x1b\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" \ 29 | "\x00\x00\x00\x04\x06\xe6\xe7\x0d\x00\x3d\x16\x01\x00\x17\x00\x00" \ 30 | "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" \ 31 | "\x00\x4a\x0e\x14\x00\x0a\x00\x2c\x01\xc8\x00\x14\x00\x05\x00\x19" \ 32 | "\x00\x7f\x01\x01\xdd\x18\x00\x50\xf2\x02\x01\x01\x80\x00\x03\xa4" \ 33 | "\x00\x00\x27\xa4\x00\x00\x42\x43\x5e\x00\x62\x32\x2f\x00\xdd\x09" \ 34 | "\x00\x03\x7f\x01\x01\x00\x00\xff\x7f\x30\x18\x01\x00\x00\x0f\xac" \ 35 | "\x02\x02\x00\x00\x0f\xac\x04\x00\x0f\xac\x02\x01\x00\x00\x0f\xac" \ 36 | "\x02\x00\x00\xdd\x1a\x00\x50\xf2\x01\x01\x00\x00\x50\xf2\x02\x02" \ 37 | "\x00\x00\x50\xf2\x04\x00\x50\xf2\x02\x01\x00\x00\x50\xf2\x02\xdd" \ 38 | "\x22\x00\x50\xf2\x04\x10\x4a\x00\x01\x10\x10\x44\x00\x01\x02\x10" \ 39 | "\x57\x00\x01\x01\x10\x3c\x00\x01\x01\x10\x49\x00\x06\x00\x37\x2a" \ 40 | "\x00\x01\x20"; 41 | 42 | // 43 | // MARK: 1 - SSID 44 | // 45 | 46 | IOReturn Black80211Control::getSSID(IO80211Interface *interface, 47 | struct apple80211_ssid_data *sd) { 48 | 49 | bzero(sd, sizeof(*sd)); 50 | sd->version = APPLE80211_VERSION; 51 | strncpy((char*)sd->ssid_bytes, fake_ssid, sizeof(sd->ssid_bytes)); 52 | sd->ssid_len = (uint32_t)strlen(fake_ssid); 53 | 54 | return kIOReturnSuccess; 55 | } 56 | 57 | IOReturn Black80211Control::setSSID(IO80211Interface *interface, 58 | struct apple80211_ssid_data *sd) { 59 | 60 | fInterface->postMessage(APPLE80211_M_SSID_CHANGED); 61 | return kIOReturnSuccess; 62 | } 63 | 64 | // 65 | // MARK: 2 - AUTH_TYPE 66 | // 67 | 68 | IOReturn Black80211Control::getAUTH_TYPE(IO80211Interface *interface, 69 | struct apple80211_authtype_data *ad) { 70 | ad->version = APPLE80211_VERSION; 71 | ad->authtype_lower = APPLE80211_AUTHTYPE_OPEN; 72 | ad->authtype_upper = APPLE80211_AUTHTYPE_NONE; 73 | return kIOReturnSuccess; 74 | } 75 | 76 | // 77 | // MARK: 4 - CHANNEL 78 | // 79 | 80 | IOReturn Black80211Control::getCHANNEL(IO80211Interface *interface, 81 | struct apple80211_channel_data *cd) { 82 | //return kIOReturnError; 83 | 84 | memset(cd, 0, sizeof(apple80211_channel_data)); 85 | //bzero(cd, sizeof(apple80211_channel_data)); 86 | 87 | cd->version = APPLE80211_VERSION; 88 | cd->channel = fake_channel; 89 | return kIOReturnSuccess; 90 | } 91 | 92 | // 93 | // MARK: 7 - TXPOWER 94 | // 95 | 96 | IOReturn Black80211Control::getTXPOWER(IO80211Interface *interface, 97 | struct apple80211_txpower_data *txd) { 98 | 99 | txd->version = APPLE80211_VERSION; 100 | txd->txpower = 100; 101 | txd->txpower_unit = APPLE80211_UNIT_PERCENT; 102 | return kIOReturnSuccess; 103 | } 104 | 105 | // 106 | // MARK: 8 - RATE 107 | // 108 | 109 | IOReturn Black80211Control::getRATE(IO80211Interface *interface, struct apple80211_rate_data *rd) { 110 | rd->version = APPLE80211_VERSION; 111 | rd->num_radios = 1; 112 | rd->rate[0] = 54; 113 | return kIOReturnSuccess; 114 | } 115 | 116 | // 117 | // MARK: 9 - BSSID 118 | // 119 | 120 | IOReturn Black80211Control::getBSSID(IO80211Interface *interface, 121 | struct apple80211_bssid_data *bd) { 122 | 123 | bzero(bd, sizeof(*bd)); 124 | 125 | bd->version = APPLE80211_VERSION; 126 | memcpy(bd->bssid.octet, fake_bssid, sizeof(fake_bssid)); 127 | return kIOReturnSuccess; 128 | } 129 | 130 | static IOReturn scanAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3) { 131 | IOSleep(2000); 132 | IO80211Interface *iface = (IO80211Interface *)arg0; 133 | FakeDevice *dev = (FakeDevice*)arg1; 134 | iface->postMessage(APPLE80211_M_SCAN_DONE); 135 | return kIOReturnSuccess; 136 | } 137 | 138 | // 139 | // MARK: 10 - SCAN_REQ 140 | // 141 | IOReturn Black80211Control::setSCAN_REQ(IO80211Interface *interface, 142 | struct apple80211_scan_data *sd) { 143 | if (dev->state() == APPLE80211_S_SCAN) { 144 | return kIOReturnBusy; 145 | } 146 | dev->setState(APPLE80211_S_SCAN); 147 | kprintf("Black80211. Scan requested. Type: %u\n" 148 | "BSS Type: %u\n" 149 | "PHY Mode: %u\n" 150 | "Dwell time: %u\n" 151 | "Rest time: %u\n" 152 | "Num channels: %u\n", 153 | sd->scan_type, 154 | sd->bss_type, 155 | sd->phy_mode, 156 | sd->dwell_time, 157 | sd->rest_time, 158 | sd->num_channels); 159 | 160 | if (interface) { 161 | dev->setPublished(false); 162 | fCommandGate->runAction(scanAction, interface, dev); 163 | } 164 | 165 | return kIOReturnSuccess; 166 | } 167 | 168 | // 169 | // MARK: 11 - SCAN_RESULT 170 | // 171 | IOReturn Black80211Control::getSCAN_RESULT(IO80211Interface *interface, 172 | struct apple80211_scan_result **sr) { 173 | if (dev->published()) { 174 | dev->setState(APPLE80211_S_INIT); 175 | return 0xe0820446; 176 | } 177 | 178 | struct apple80211_scan_result* result = 179 | (struct apple80211_scan_result*)IOMalloc(sizeof(struct apple80211_scan_result)); 180 | 181 | 182 | 183 | bzero(result, sizeof(*result)); 184 | result->version = APPLE80211_VERSION; 185 | 186 | result->asr_channel = fake_channel; 187 | 188 | result->asr_noise = -101; 189 | // result->asr_snr = 60; 190 | result->asr_rssi = -73; 191 | result->asr_beacon_int = 100; 192 | 193 | result->asr_cap = 0x411; 194 | 195 | result->asr_age = 0; 196 | 197 | memcpy(result->asr_bssid, fake_bssid, sizeof(fake_bssid)); 198 | 199 | result->asr_nrates = 1; 200 | result->asr_rates[0] = 54; 201 | 202 | strncpy((char*)result->asr_ssid, fake_ssid, sizeof(result->asr_ssid)); 203 | result->asr_ssid_len = strlen(fake_ssid); 204 | 205 | result->asr_ie_len = 246; 206 | result->asr_ie_data = IOMalloc(result->asr_ie_len); 207 | memcpy(result->asr_ie_data, beacon_ie, result->asr_ie_len); 208 | 209 | *sr = result; 210 | 211 | dev->setPublished(true); 212 | 213 | return kIOReturnSuccess; 214 | } 215 | 216 | // 217 | // MARK: 12 - CARD_CAPABILITIES 218 | // 219 | 220 | IOReturn Black80211Control::getCARD_CAPABILITIES(IO80211Interface *interface, 221 | struct apple80211_capability_data *cd) { 222 | cd->version = APPLE80211_VERSION; 223 | cd->capabilities[0] = 0xab; 224 | cd->capabilities[1] = 0x7e; 225 | return kIOReturnSuccess; 226 | } 227 | 228 | // 229 | // MARK: 13 - STATE 230 | // 231 | 232 | IOReturn Black80211Control::getSTATE(IO80211Interface *interface, 233 | struct apple80211_state_data *sd) { 234 | sd->version = APPLE80211_VERSION; 235 | sd->state = dev->state(); 236 | return kIOReturnSuccess; 237 | } 238 | 239 | IOReturn Black80211Control::setSTATE(IO80211Interface *interface, 240 | struct apple80211_state_data *sd) { 241 | kprintf("Black82011: Setting state: %u", sd->state); 242 | dev->setState(sd->state); 243 | return kIOReturnSuccess; 244 | } 245 | 246 | // 247 | // MARK: 14 - PHY_MODE 248 | // 249 | 250 | IOReturn Black80211Control::getPHY_MODE(IO80211Interface *interface, 251 | struct apple80211_phymode_data *pd) { 252 | pd->version = APPLE80211_VERSION; 253 | pd->phy_mode = APPLE80211_MODE_11A 254 | | APPLE80211_MODE_11B 255 | | APPLE80211_MODE_11G; 256 | pd->active_phy_mode = APPLE80211_MODE_AUTO; 257 | return kIOReturnSuccess; 258 | } 259 | 260 | // 261 | // MARK: 15 - OP_MODE 262 | // 263 | 264 | IOReturn Black80211Control::getOP_MODE(IO80211Interface *interface, 265 | struct apple80211_opmode_data *od) { 266 | od->version = APPLE80211_VERSION; 267 | od->op_mode = APPLE80211_M_STA; 268 | return kIOReturnSuccess; 269 | } 270 | 271 | // 272 | // MARK: 16 - RSSI 273 | // 274 | 275 | IOReturn Black80211Control::getRSSI(IO80211Interface *interface, 276 | struct apple80211_rssi_data *rd) { 277 | 278 | bzero(rd, sizeof(*rd)); 279 | rd->version = APPLE80211_VERSION; 280 | rd->num_radios = 1; 281 | rd->rssi[0] = -42; 282 | rd->aggregate_rssi = -42; 283 | rd->rssi_unit = APPLE80211_UNIT_DBM; 284 | return kIOReturnSuccess; 285 | } 286 | 287 | // 288 | // MARK: 17 - NOISE 289 | // 290 | 291 | IOReturn Black80211Control::getNOISE(IO80211Interface *interface, 292 | struct apple80211_noise_data *nd) { 293 | 294 | bzero(nd, sizeof(*nd)); 295 | nd->version = APPLE80211_VERSION; 296 | nd->num_radios = 1; 297 | nd->noise[0] = -101; 298 | nd->aggregate_noise = -101; 299 | nd->noise_unit = APPLE80211_UNIT_DBM; 300 | return kIOReturnSuccess; 301 | } 302 | 303 | // 304 | // MARK: 18 - INT_MIT 305 | // 306 | IOReturn Black80211Control::getINT_MIT(IO80211Interface* interface, 307 | struct apple80211_intmit_data* imd) { 308 | imd->version = APPLE80211_VERSION; 309 | imd->int_mit = APPLE80211_INT_MIT_AUTO; 310 | return kIOReturnSuccess; 311 | } 312 | 313 | 314 | // 315 | // MARK: 19 - POWER 316 | // 317 | 318 | IOReturn Black80211Control::getPOWER(IO80211Interface *interface, 319 | struct apple80211_power_data *pd) { 320 | pd->version = APPLE80211_VERSION; 321 | pd->num_radios = 1; 322 | pd->power_state[0] = dev->powerState(); 323 | 324 | return kIOReturnSuccess; 325 | } 326 | 327 | IOReturn Black80211Control::setPOWER(IO80211Interface *interface, 328 | struct apple80211_power_data *pd) { 329 | if (pd->num_radios > 0) { 330 | dev->setPowerState(pd->power_state[0]); 331 | } 332 | //fInterface->postMessage(APPLE80211_M_POWER_CHANGED, NULL, 0); 333 | 334 | return kIOReturnSuccess; 335 | } 336 | 337 | // 338 | // MARK: 20 - ASSOCIATE 339 | // 340 | 341 | IOReturn Black80211Control::setASSOCIATE(IO80211Interface *interface, 342 | struct apple80211_assoc_data *ad) { 343 | IOLog("Black80211::setAssociate %s", ad->ad_ssid); 344 | fInterface->setLinkState(IO80211LinkState::kIO80211NetworkLinkUp, 0); 345 | return kIOReturnSuccess; 346 | } 347 | 348 | // 349 | // MARK: 27 - SUPPORTED_CHANNELS 350 | // 351 | 352 | IOReturn Black80211Control::getSUPPORTED_CHANNELS(IO80211Interface *interface, 353 | struct apple80211_sup_channel_data *ad) { 354 | ad->version = APPLE80211_VERSION; 355 | ad->num_channels = 1; 356 | ad->supported_channels[0] = fake_channel; 357 | return kIOReturnSuccess; 358 | } 359 | 360 | // 361 | // MARK: 28 - LOCALE 362 | // 363 | 364 | IOReturn Black80211Control::getLOCALE(IO80211Interface *interface, 365 | struct apple80211_locale_data *ld) { 366 | ld->version = APPLE80211_VERSION; 367 | ld->locale = APPLE80211_LOCALE_FCC; 368 | 369 | return kIOReturnSuccess; 370 | } 371 | 372 | // 373 | // MARK: 37 - TX_ANTENNA 374 | // 375 | IOReturn Black80211Control::getTX_ANTENNA(IO80211Interface *interface, 376 | apple80211_antenna_data *ad) { 377 | ad->version = APPLE80211_VERSION; 378 | ad->num_radios = 1; 379 | ad->antenna_index[0] = 1; 380 | return kIOReturnSuccess; 381 | } 382 | 383 | // 384 | // MARK: 39 - ANTENNA_DIVERSITY 385 | // 386 | 387 | IOReturn Black80211Control::getANTENNA_DIVERSITY(IO80211Interface *interface, 388 | apple80211_antenna_data *ad) { 389 | ad->version = APPLE80211_VERSION; 390 | ad->num_radios = 1; 391 | ad->antenna_index[0] = 1; 392 | return kIOReturnSuccess; 393 | } 394 | 395 | // 396 | // MARK: 43 - DRIVER_VERSION 397 | // 398 | 399 | IOReturn Black80211Control::getDRIVER_VERSION(IO80211Interface *interface, 400 | struct apple80211_version_data *hv) { 401 | hv->version = APPLE80211_VERSION; 402 | strncpy(hv->string, fake_drv_version, sizeof(hv->string)); 403 | hv->string_len = strlen(fake_drv_version); 404 | return kIOReturnSuccess; 405 | } 406 | 407 | // 408 | // MARK: 44 - HARDWARE_VERSION 409 | // 410 | 411 | IOReturn Black80211Control::getHARDWARE_VERSION(IO80211Interface *interface, 412 | struct apple80211_version_data *hv) { 413 | hv->version = APPLE80211_VERSION; 414 | strncpy(hv->string, fake_hw_version, sizeof(hv->string)); 415 | hv->string_len = strlen(fake_hw_version); 416 | return kIOReturnSuccess; 417 | } 418 | 419 | // 420 | // MARK: 51 - COUNTRY_CODE 421 | // 422 | 423 | IOReturn Black80211Control::getCOUNTRY_CODE(IO80211Interface *interface, 424 | struct apple80211_country_code_data *cd) { 425 | cd->version = APPLE80211_VERSION; 426 | strncpy((char*)cd->cc, fake_country_code, sizeof(cd->cc)); 427 | return kIOReturnSuccess; 428 | } 429 | 430 | // 431 | // MARK: 57 - MCS 432 | // 433 | IOReturn Black80211Control::getMCS(IO80211Interface* interface, struct apple80211_mcs_data* md) { 434 | md->version = APPLE80211_VERSION; 435 | md->index = APPLE80211_MCS_INDEX_AUTO; 436 | return kIOReturnSuccess; 437 | } 438 | 439 | IOReturn Black80211Control::getROAM_THRESH(IO80211Interface* interface, struct apple80211_roam_threshold_data* md) { 440 | md->threshold = 1000; 441 | md->count = 0; 442 | return kIOReturnSuccess; 443 | } 444 | 445 | IOReturn Black80211Control::getRADIO_INFO(IO80211Interface* interface, struct apple80211_radio_info_data* md) 446 | { 447 | md->version = 1; 448 | md->count = 1; 449 | return kIOReturnSuccess; 450 | } 451 | -------------------------------------------------------------------------------- /Black80211/apple80211/catalina/IO80211Controller.h: -------------------------------------------------------------------------------- 1 | #ifndef _IO80211CONTROLLER_H 2 | #define _IO80211CONTROLLER_H 3 | 4 | #if defined(KERNEL) && defined(__cplusplus) 5 | 6 | #include 7 | 8 | #if VERSION_MAJOR > 8 9 | #define _MODERN_BPF 10 | #endif 11 | 12 | #include 13 | 14 | #include 15 | //#include "IOEthernetController.h" 16 | 17 | #include 18 | #include 19 | 20 | #include "apple80211_ioctl.h" 21 | #include "IO80211SkywalkInterface.h" 22 | #include "IO80211WorkLoop.h" 23 | 24 | #define AUTH_TIMEOUT 15 // seconds 25 | 26 | /*! @enum LinkSpeed. 27 | @abstract ???. 28 | @discussion ???. 29 | @constant LINK_SPEED_80211A 54 Mbps 30 | @constant LINK_SPEED_80211B 11 Mbps. 31 | @constant LINK_SPEED_80211G 54 Mbps. 32 | */ 33 | enum { 34 | LINK_SPEED_80211A = 54000000ul, // 54 Mbps 35 | LINK_SPEED_80211B = 11000000ul, // 11 Mbps 36 | LINK_SPEED_80211G = 54000000ul, // 54 Mbps 37 | LINK_SPEED_80211N = 300000000ul, // 300 Mbps (MCS index 15, 400ns GI, 40 MHz channel) 38 | }; 39 | 40 | enum IO80211CountryCodeOp 41 | { 42 | kIO80211CountryCodeReset, // Reset country code to world wide default, and start 43 | // searching for 802.11d beacon 44 | }; 45 | typedef enum IO80211CountryCodeOp IO80211CountryCodeOp; 46 | 47 | enum IO80211SystemPowerState 48 | { 49 | kIO80211SystemPowerStateUnknown, 50 | kIO80211SystemPowerStateAwake, 51 | kIO80211SystemPowerStateSleeping, 52 | }; 53 | typedef enum IO80211SystemPowerState IO80211SystemPowerState; 54 | 55 | enum IO80211FeatureCode 56 | { 57 | kIO80211Feature80211n = 1, 58 | }; 59 | typedef enum IO80211FeatureCode IO80211FeatureCode; 60 | 61 | 62 | class IOSkywalkInterface; 63 | class IO80211ScanManager; 64 | enum CCStreamLogLevel 65 | { 66 | LEVEL_1, 67 | }; 68 | 69 | enum scanSource 70 | { 71 | SOURCE_1, 72 | }; 73 | 74 | enum joinStatus 75 | { 76 | STATUS_1, 77 | }; 78 | 79 | class IO80211Controller; 80 | class IO80211Interface; 81 | class IO82110WorkLoop; 82 | class IO80211VirtualInterface; 83 | class IO80211ControllerMonitor; 84 | class CCLogPipe; 85 | class CCIOReporterLogStream; 86 | class CCLogStream; 87 | class IO80211VirtualInterface; 88 | class IO80211RangingManager; 89 | class IO80211FlowQueue; 90 | class IO80211FlowQueueLegacy; 91 | class FlowIdMetadata; 92 | class IOReporter; 93 | extern void IO80211VirtualInterfaceNamerRetain(); 94 | 95 | 96 | struct apple80211_hostap_state; 97 | 98 | struct apple80211_awdl_sync_channel_sequence; 99 | struct ieee80211_ht_capability_ie; 100 | struct apple80211_channel_switch_announcement; 101 | struct apple80211_beacon_period_data; 102 | struct apple80211_power_debug_sub_info; 103 | struct apple80211_stat_report; 104 | struct apple80211_frame_counters; 105 | struct apple80211_leaky_ap_event; 106 | struct apple80211_chip_stats; 107 | struct apple80211_extended_stats; 108 | struct apple80211_ampdu_stat_report; 109 | struct apple80211_btCoex_report; 110 | struct apple80211_cca_report; 111 | class CCPipe; 112 | struct apple80211_lteCoex_report; 113 | 114 | //typedef int scanSource; 115 | //typedef int joinStatus; 116 | //typedef int CCStreamLogLevel; 117 | typedef IOReturn (*IOCTL_FUNC)(IO80211Controller*, IO80211Interface*, IO80211VirtualInterface*, apple80211req*, bool); 118 | extern IOCTL_FUNC gGetHandlerTable[]; 119 | extern IOCTL_FUNC gSetHandlerTable[]; 120 | 121 | #define __int64 int 122 | #define ulong unsigned long 123 | #define _QWORD UInt64 124 | #define uint UInt 125 | 126 | class IO80211Controller : public IOEthernetController { 127 | OSDeclareAbstractStructors(IO80211Controller) 128 | 129 | public: 130 | 131 | virtual void requestPacketTx(void*, uint) {} 132 | 133 | virtual IOReturn getHardwareAddressForInterface(IO80211Interface *,IOEthernetAddress *); 134 | virtual void inputMonitorPacket(mbuf_t,uint,void *,ulong); 135 | virtual int outputRaw80211Packet(IO80211Interface *,mbuf_t); 136 | 137 | virtual int outputActionFrame(IO80211Interface *,mbuf_t); 138 | 139 | virtual int bpfOutputPacket(OSObject *,uint,mbuf_t) { 140 | return 0; 141 | } 142 | 143 | virtual SInt32 monitorModeSetEnabled(IO80211Interface*, bool, uint) { 144 | return 0; 145 | } 146 | 147 | virtual IO80211Interface* getNetworkInterface(void); 148 | 149 | virtual IO80211SkywalkInterface* getPrimarySkywalkInterface(void); 150 | 151 | virtual SInt32 apple80211_ioctl(IO80211Interface *, IO80211VirtualInterface*, ifnet_t,ulong,void *); 152 | virtual SInt32 apple80211_ioctl(IO80211SkywalkInterface *,ulong,void *); 153 | 154 | virtual SInt32 apple80211_ioctl(IO80211Interface *, ifnet_t,ulong id,void *) { 155 | IOLog("Black80211: ioctl called with %x", id); 156 | return 0; 157 | } 158 | 159 | virtual SInt32 apple80211Request(unsigned int, int, IO80211Interface*, void*) = 0; 160 | 161 | virtual SInt32 apple80211VirtualRequest(uint,int,IO80211VirtualInterface *,void *) { 162 | return kIOReturnSuccess; 163 | } 164 | 165 | virtual SInt32 apple80211SkywalkRequest(uint,int,IO80211SkywalkInterface *,void *); 166 | virtual SInt32 stopDMA() { return 0x66; }; 167 | virtual UInt32 hardwareOutputQueueDepth(IO80211Interface*) { return 0; }; 168 | virtual SInt32 performCountryCodeOperation(IO80211Interface*, IO80211CountryCodeOp) { return 0; }; 169 | virtual bool useAppleRSNSupplicant(IO80211Interface *); 170 | virtual bool useAppleRSNSupplicant(IO80211VirtualInterface *); 171 | virtual void dataLinkLayerAttachComplete(IO80211Interface *); 172 | virtual SInt32 enableFeature(IO80211FeatureCode, void*) { return 0; }; 173 | virtual SInt32 setVirtualHardwareAddress(IO80211VirtualInterface *,ether_addr *) { 174 | return kIOReturnSuccess; 175 | } 176 | virtual SInt32 enableVirtualInterface(IO80211VirtualInterface *) 177 | { 178 | return kIOReturnSuccess; 179 | }; 180 | virtual SInt32 disableVirtualInterface(IO80211VirtualInterface *) 181 | { 182 | return kIOReturnSuccess; 183 | }; 184 | 185 | virtual bool requiresExplicitMBufRelease() { return false; }; 186 | virtual bool flowIdSupported() { return false; }; 187 | 188 | virtual IO80211FlowQueueLegacy* requestFlowQueue(FlowIdMetadata const*); 189 | virtual void releaseFlowQueue(IO80211FlowQueue *); 190 | 191 | virtual void getLogPipes(CCPipe**, CCPipe**, CCPipe**) {}; 192 | 193 | virtual IOReturn enablePacketTimestamping(void) { 194 | return kIOReturnUnsupported; 195 | } 196 | 197 | virtual IOReturn disablePacketTimestamping(void) { 198 | return kIOReturnUnsupported; 199 | } 200 | 201 | virtual UInt32 selfDiagnosticsReport(int,char const*,uint); 202 | 203 | virtual UInt32 getDataQueueDepth(OSObject *); 204 | 205 | virtual mbuf_flags_t inputPacket(mbuf_t); 206 | 207 | virtual SInt32 apple80211_ioctl_get(IO80211Interface *,IO80211VirtualInterface *,ifnet_t,void *); 208 | 209 | virtual SInt32 apple80211_ioctl_get(IO80211SkywalkInterface *,void *); 210 | 211 | virtual SInt32 apple80211_ioctl_set(IO80211Interface *,IO80211VirtualInterface *,IO80211SkywalkInterface *,void *); 212 | 213 | virtual SInt32 apple80211_ioctl_set(IO80211SkywalkInterface *,void*); 214 | 215 | virtual bool attachInterface(IOSkywalkInterface *,IOService *); 216 | 217 | 218 | virtual IO80211VirtualInterface* createVirtualInterface(ether_addr *,uint) { 219 | return NULL; 220 | } 221 | virtual bool attachVirtualInterface(IO80211VirtualInterface **,ether_addr *,uint,bool); 222 | virtual bool detachVirtualInterface(IO80211VirtualInterface *,bool); 223 | 224 | virtual IOReturn enable(IO80211SkywalkInterface *); 225 | 226 | virtual IOReturn disable(IO80211SkywalkInterface *); 227 | virtual IOReturn updateReport(IOReportChannelList *,uint,void *,void *) override; 228 | virtual IOReturn configureReport(IOReportChannelList *,uint,void *,void *) override; 229 | 230 | virtual void detachInterface(IONetworkInterface *, bool sync = false) APPLE_KEXT_OVERRIDE; 231 | virtual bool attachInterface(IONetworkInterface **, bool attach = true) APPLE_KEXT_OVERRIDE; 232 | virtual void stop(IOService *) override; 233 | virtual void free() override; 234 | virtual bool terminate(unsigned int) APPLE_KEXT_OVERRIDE; 235 | virtual bool init(OSDictionary *) override; 236 | virtual IOService* getProvider(void) const APPLE_KEXT_OVERRIDE; 237 | /* 238 | virtual SInt32 apple80211_ioctl_get(IO80211Interface *,IO80211VirtualInterface *,IO80211SkywalkInterface *,void *) { 239 | return kIOReturnUnsupported; 240 | } 241 | */ 242 | 243 | IO80211SkywalkInterface* getInfraInterface(void) { 244 | return NULL; 245 | } 246 | IO80211ScanManager* getPrimaryInterfaceScanManager(void) { 247 | return NULL; 248 | } 249 | 250 | IO80211ControllerMonitor* getInterfaceMonitor(void) { 251 | return NULL; 252 | } 253 | 254 | 255 | IOReturn addReporterLegend(IOService *,IOReporter *,char const*,char const*); 256 | IOReturn removeReporterFromLegend(IOService *,IOReporter *,char const*,char const*); 257 | IOReturn unlockIOReporterLegend(void); 258 | void lockIOReporterLegend(void);//怀疑对象,之前是返回int 259 | IOReturn logIOReportLogStreamSubscription(ulong long); 260 | IOReturn addIOReportLogStreamForProvider(IOService *,ulong long *); 261 | IOReturn addSubscriptionForThisReporterFetchedOnTimer(IOReporter *,char const*,char const*,IOService *) ; 262 | IOReturn addSubscriptionForProviderFetchedOnTimer(IOService *); 263 | void handleIOReporterTimer(IOTimerEventSource *); 264 | void setIOReportersStreamFlags(ulong long); 265 | void updateIOReportersStreamFrequency(void); //怀疑对象,之前是返回int 266 | void setIOReportersStreamLevel(CCStreamLogLevel); 267 | 268 | 269 | void powerChangeGated(OSObject *,void *,void *,void *,void *) {}; 270 | int copyOut(void const*,ulong long,ulong) { 271 | return 0; 272 | } 273 | 274 | //modified 275 | 276 | 277 | SInt32 getASSOCIATE_RESULT(IO80211Interface *,IO80211VirtualInterface *,IO80211SkywalkInterface *,apple80211_assoc_result_data *) { 278 | return kIOReturnSuccess; 279 | } 280 | virtual int errnoFromReturn(int) override; 281 | virtual const char* stringFromReturn(int) override; 282 | 283 | virtual IONetworkInterface* createInterface(void) override; 284 | virtual IOReturn getHardwareAddress(IOEthernetAddress *) override; 285 | virtual IOWorkLoop* getWorkLoop(void) const APPLE_KEXT_OVERRIDE; 286 | virtual bool createWorkLoop(void) override; 287 | virtual IOOutputQueue* getOutputQueue(void) const APPLE_KEXT_OVERRIDE; 288 | 289 | virtual bool configureInterface(IONetworkInterface *) override; 290 | virtual IOReturn enable(IONetworkInterface *) override; 291 | virtual IOReturn disable(IONetworkInterface *) override; 292 | virtual bool start(IOService *) override; 293 | 294 | //virtual SInt32 apple 295 | 296 | 297 | virtual IOReturn outputStart(IONetworkInterface *,uint) { 298 | return kIOReturnSuccess; 299 | } 300 | 301 | /* 302 | virtual IOReturn setChanNoiseFloorLTE(apple80211_stat_report *,int) { 303 | return kIOReturnSuccess; 304 | } 305 | virtual IOReturn setChanNoiseFloor(apple80211_stat_report *,int) { 306 | return kIOReturnSuccess; 307 | } 308 | virtual IOReturn setChanCCA(apple80211_stat_report *,int) { 309 | return kIOReturnSuccess; 310 | } 311 | virtual IOReturn setChanExtendedCCA(apple80211_stat_report *,apple80211_cca_report *) { 312 | return kIOReturnSuccess; 313 | } 314 | virtual bool setLTECoexstat(apple80211_stat_report *,apple80211_lteCoex_report *) { 315 | return false; 316 | } 317 | virtual bool setBTCoexstat(apple80211_stat_report *,apple80211_btCoex_report *) { 318 | return false; 319 | } 320 | virtual bool setAMPDUstat(apple80211_stat_report *,apple80211_ampdu_stat_report *,apple80211_channel *) { 321 | return false; 322 | } 323 | virtual UInt32 getCountryCode(apple80211_country_code_data *) { 324 | return 0; 325 | } 326 | virtual IOReturn setCountryCode(apple80211_country_code_data *) { 327 | return kIOReturnUnsupported; 328 | } 329 | virtual bool getInfraExtendedStats(apple80211_extended_stats *) { 330 | return false; 331 | } 332 | virtual bool getChipCounterStats(apple80211_chip_stats *) { 333 | return false; 334 | } 335 | virtual bool setExtendedChipCounterStats(apple80211_stat_report *,void *) { 336 | return false; 337 | } 338 | bool setChipCounterStats(apple80211_stat_report *,apple80211_chip_stats *,apple80211_channel *) { 339 | return false; 340 | } 341 | virtual bool setLeakyAPStats(apple80211_leaky_ap_event *) { 342 | return false; 343 | } 344 | bool setFrameStats(apple80211_stat_report *,apple80211_frame_counters *,apple80211_channel *) { 345 | return false; 346 | } 347 | bool setPowerStats(apple80211_stat_report *,apple80211_power_debug_sub_info *) { 348 | return false; 349 | } 350 | */ 351 | 352 | IOReturn copyIn(ulong long,void *,ulong) { 353 | return kIOReturnUnsupported; 354 | } 355 | void logIOCTL(apple80211req *) {}; 356 | bool isIOCTLLoggingRestricted(apple80211req *) { 357 | return false; 358 | } 359 | 360 | bool getBeaconPeriod(apple80211_beacon_period_data *) { 361 | return false; 362 | } 363 | SInt32 apple80211VirtualRequestIoctl(uint,int,IO80211VirtualInterface *,void *) { 364 | return kIOReturnUnsupported; 365 | } 366 | bool getBSSIDData(OSObject *,apple80211_bssid_data *) { 367 | return false; 368 | } 369 | bool getSSIDData(apple80211_ssid_data *) { 370 | return false; 371 | 372 | } 373 | bool inputInfraPacket(mbuf_t) { 374 | return false; 375 | } 376 | void notifyHostapState(apple80211_hostap_state *) {}; 377 | bool isAwdlAssistedDiscoveryEnabled(void) { 378 | return false; 379 | } 380 | void joinDone(scanSource,joinStatus) {}; 381 | void joinStarted(scanSource,joinStatus) {}; 382 | void handleChannelSwitchAnnouncement(apple80211_channel_switch_announcement *) {}; 383 | void scanDone(scanSource,int) {}; 384 | void scanStarted(scanSource,apple80211_scan_data *) {}; 385 | void printChannels(void) {}; 386 | void updateInterfaceCoexRiskPct(ulong long) {}; 387 | SInt32 getInfraChannel(apple80211_channel_data *) { 388 | return kIOReturnUnsupported; 389 | } 390 | void calculateInterfacesAvaiability(void);//怀疑对象,之前是返回int 391 | void setChannelSequenceList(apple80211_awdl_sync_channel_sequence *) {};//怀疑对象,之前是返回int 392 | void setPrimaryInterfaceDatapathState(bool) {}; 393 | UInt32 getPrimaryInterfaceLinkState(void) { 394 | return kIOReturnSuccess; 395 | } 396 | void setCurrentChannel(apple80211_channel *);//怀疑对象,之前是返回int 397 | void setHtCapability(ieee80211_ht_capability_ie *) {}; 398 | UInt32 getHtCapability(void); 399 | UInt32 getHtCapabilityLength(void); 400 | bool io80211isDebuggable(bool* enable) { 401 | *enable = true; 402 | return true; 403 | } 404 | void logDebug(ulong long,char const*,...);//怀疑对象,之前是返回int 405 | void vlogDebug(ulong long,char const*,va_list);//怀疑对象,之前是返回char 406 | void logDebug(char const*,...);//怀疑对象,之前是返回int 407 | 408 | bool calculateInterfacesCoex(void) { 409 | return false; 410 | } 411 | void setInfraChannel(apple80211_channel *) { 412 | } 413 | 414 | void configureAntennae(void) {}; 415 | SInt32 apple80211RequestIoctl(uint,int,IO80211Interface *,void *); 416 | UInt32 radioCountForInterface(IO80211Interface *); 417 | void releaseIOReporters(void); 418 | bool findAndAttachToFaultReporter(void) { 419 | return false; 420 | } 421 | UInt32 setupControlPathLogging(void); 422 | IOReturn createIOReporters(IOService *); 423 | IOReturn powerChangeHandler(void *,void *,uint,IOService *,void *,ulong); 424 | 425 | 426 | OSMetaClassDeclareReservedUnused( IO80211Controller, 0); 427 | OSMetaClassDeclareReservedUnused( IO80211Controller, 1); 428 | OSMetaClassDeclareReservedUnused( IO80211Controller, 2); 429 | OSMetaClassDeclareReservedUnused( IO80211Controller, 3); 430 | OSMetaClassDeclareReservedUnused( IO80211Controller, 4); 431 | OSMetaClassDeclareReservedUnused( IO80211Controller, 5); 432 | OSMetaClassDeclareReservedUnused( IO80211Controller, 6); 433 | OSMetaClassDeclareReservedUnused( IO80211Controller, 7); 434 | OSMetaClassDeclareReservedUnused( IO80211Controller, 8); 435 | OSMetaClassDeclareReservedUnused( IO80211Controller, 9); 436 | OSMetaClassDeclareReservedUnused( IO80211Controller, 10); 437 | OSMetaClassDeclareReservedUnused( IO80211Controller, 11); 438 | OSMetaClassDeclareReservedUnused( IO80211Controller, 12); 439 | OSMetaClassDeclareReservedUnused( IO80211Controller, 13); 440 | OSMetaClassDeclareReservedUnused( IO80211Controller, 14); 441 | OSMetaClassDeclareReservedUnused( IO80211Controller, 15); 442 | 443 | protected: 444 | static IORegistryPlane gIO80211Plane; 445 | static IORegistryEntry* kIO80211PlaneName; 446 | //0x118 447 | IOTimerEventSource * _report_gathering_timer; // 0x118 448 | OSArray * _reporter_num; // 0x120 OSArray of OSNumber 449 | UInt32 _var_128; // timeout ticks 450 | bool _wan_debug_enable; // 0x12c 451 | // 3 bytes padding 452 | UInt32 _debug_value; // 0x130 453 | IORecursiveLock * _recursive_lock; // 0x138 454 | UInt64 _ht_cap_0x0; // 0x140 455 | UInt64 _ht_cap_0x8; // 0x148 456 | UInt64 _ht_cap_0x10; // 0x150 457 | UInt32 _ht_cap_0x18; // 0x158 458 | UInt32 _ht_cap_len; // 0x15c 459 | IO80211ControllerMonitor * _fControllerMonitor; // 0x160 460 | CCLogPipe * _fControllerIOReporterPipe; // 0x168 461 | CCIOReporterLogStream * _fControllerIOReporterStream; // 0x170 462 | CCLogPipe * _controlPathLogPipe; // 0x180 463 | CCLogStream * _ioctlLogStream; // 0x188 464 | CCLogStream * _eventLogStream; // 0x190 465 | IO82110WorkLoop * _workLoop; // 0x198 466 | IO80211Interface * _interface; // 0x1a0 467 | IO80211VirtualInterface * _v_interface; // 0x1a8 468 | IO80211VirtualInterface (* _vir_interface)[4]; // 0x1b0 469 | 470 | UInt64 _vlog_debug ; // 0x1d0 vlogDebug ? 471 | UInt32 _unknown; // 0x1d8 472 | UInt32 _infra_channel; // 0x1dc compared with offet 8 of apple80211_stat_report IO80211Controller::setChanCCA(apple80211_stat_report*, int) 473 | UInt32 _infra_channel_flags; // 0x1e0 compared with offet 8 of apple80211_channel 474 | UInt32 _current_channel; // 0x1e8 loaded with offet 04 of apple80211_channel 475 | UInt32 _current_channel_fags; // 0x1ec loaded with offet 08 of apple80211_channel 476 | UInt8 _awdl_sync[0x190]; // 0x1f0, 0x190 bytes apple80211_awdl_sync_channel_sequence 477 | IONotifier * _powerDownNotifier; // 0x380 478 | IOService * _provider; // 0x388 479 | IO80211RangingManager * _ranger_manager; // 0x390 480 | bool _var_398; // 0x398 checked in IO80211Controller::disable(IONetworkInterface*) 481 | // 7 byte padding 482 | IONotifier * _notifier1; // 0x3a0 483 | bool _var_3a8; // 0x3a8 484 | // 7 byte padding 485 | UInt64 _last_pointer; // 0x3b0 unused 486 | uint8_t filler[0x2B2]; 487 | //0x3CA 488 | }; 489 | 490 | #endif /* defined(KERNEL) && defined(__cplusplus) */ 491 | 492 | #endif /* !_IO80211CONTROLLER_H */ 493 | -------------------------------------------------------------------------------- /Black80211/apple80211/catalina/apple80211_wps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wps_eap.h 3 | * Family 4 | * 5 | * Created by Pete on 6/20/06. 6 | * Copyright 2006 Apple Computer, Inc. All rights reserved. 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | //#include "eap_defs.h" 13 | 14 | #ifndef WPS_EAP_H 15 | #define WPS_EAP_H 16 | 17 | #define WPS_HANDSHAKE_TIMEOUT 120 /* seconds */ 18 | #define WPS_RETRANSMIT_TIMEOUT 5 19 | #define WPS_MAX_RETRIES 3 20 | 21 | #define WPS_IDENTITY_STR "WFA-SimpleConfig-Enrollee-1-0" 22 | #define WPS_IDENTITY_STR_LEN 29 23 | #define WPS_PERSONALIZATION_STRING "Wi-Fi Easy and Secure Key Derivation" 24 | #define WPS_PERSONALIZATION_STRING_LEN ( sizeof( WPS_PERSONALIZATION_STRING ) - 1 ) 25 | #define WPS_KDF_KEY_BITS 640 26 | 27 | #define WPS_DISPLAY_PIN_LEN 8 28 | 29 | #define EAP_TYPE_ID 1 30 | #define WPS_EAP_METHOD_TYPE 254 31 | 32 | #define WPS_VENDOR_ID_BYTES 0x00, 0x37, 0x2A 33 | #define WPS_VENDOR_TYPE 0x00000001 34 | 35 | #define WPS_OP_START 0x01 36 | #define WPS_OP_ACK 0x02 37 | #define WPS_OP_NACK 0x03 38 | #define WPS_OP_MSG 0x04 39 | #define WPS_OP_DONE 0x05 40 | 41 | #define WPS_FLAG_MF 0x01 /* more fragments */ 42 | #define WPS_FLAG_LF 0x02 /* length field in use */ 43 | 44 | #define WPS_MAX_MSG_LEN UINT16_MAX /* max frag len, my limit */ 45 | 46 | #define PACKED __attribute__((packed)) 47 | 48 | struct wps_eap_hdr 49 | { 50 | u_int8_t code; 51 | u_int8_t identifier; 52 | u_int16_t length; 53 | u_int8_t type; 54 | u_int8_t vendor_id[3]; 55 | u_int32_t vendor_type; 56 | u_int8_t op_code; 57 | u_int8_t flags; 58 | u_int16_t msg_length; 59 | // u_int8_t msg[1]; /* data follows */ 60 | }PACKED; 61 | #define WPS_EAP_HDR_LEN( _whdr ) ( ( _whdr->flags & WPS_FLAG_LF ) ? sizeof( struct wps_eap_hdr ) : sizeof( struct wps_eap_hdr ) - sizeof( u_int16_t ) ) 62 | 63 | // Messages elements 64 | 65 | #define BUF_SIZE_64_BITS 8 66 | #define BUF_SIZE_128_BITS 16 67 | #define BUF_SIZE_160_BITS 20 68 | #define BUF_SIZE_256_BITS 32 69 | #define BUF_SIZE_512_BITS 64 70 | #define BUF_SIZE_1024_BITS 128 71 | #define BUF_SIZE_1536_BITS 192 72 | 73 | struct wps_msg_elem_hdr 74 | { 75 | u_int16_t elem_id; 76 | u_int16_t elem_len; 77 | }PACKED; 78 | 79 | #define WPS_ELEM_SET_HEADER( elem, id, len ) (elem)->hdr.elem_id = htons( id ); (elem)->hdr.elem_len = htons( len ) 80 | 81 | struct wps_dev_type 82 | { 83 | u_int16_t category; 84 | u_int8_t oui[4]; 85 | u_int16_t sub_category; 86 | }PACKED; 87 | 88 | #define WIFI_DEV_TYPE_OUI_BYTES 0x00, 0x50, 0xf2, 0x04 89 | 90 | #define DEFINE_WPS_ELEMENT( name, param ) typedef struct { \ 91 | struct wps_msg_elem_hdr hdr; \ 92 | param; \ 93 | }PACKED name 94 | 95 | 96 | #define WPS_VERSION 0x10 97 | DEFINE_WPS_ELEMENT( wps_elem_ap_channel_t, u_int16_t channel ); 98 | DEFINE_WPS_ELEMENT( wps_elem_assoc_state_t, u_int16_t assoc_state ); 99 | DEFINE_WPS_ELEMENT( wps_elem_auth_type_t, u_int16_t auth_type ); 100 | DEFINE_WPS_ELEMENT( wps_elem_auth_type_flags_t, u_int16_t auth_flags ); 101 | #define AUTHENTICATOR_MSG_SIZE ( sizeof( struct wps_msg_elem_hdr ) + 8 ) 102 | DEFINE_WPS_ELEMENT( wps_elem_authenticator_t, u_int8_t authenticator[8] ); 103 | DEFINE_WPS_ELEMENT( wps_elem_config_methods_t, u_int16_t config_methods ); 104 | DEFINE_WPS_ELEMENT( wps_elem_config_error_t, u_int16_t error ); 105 | DEFINE_WPS_ELEMENT( wps_elem_confirm_url4_t, u_int16_t url4[1] ); // <= 64B 106 | DEFINE_WPS_ELEMENT( wps_elem_confirm_url6_t, u_int16_t url6[1] ); // <= 76B 107 | DEFINE_WPS_ELEMENT( wps_elem_conn_type_t, u_int8_t conn_type ); 108 | DEFINE_WPS_ELEMENT( wps_elem_conn_type_flags_t, u_int8_t conn_type_flags ); 109 | DEFINE_WPS_ELEMENT( wps_elem_credential_t, u_int8_t cred[1] ); // <= ??? 110 | DEFINE_WPS_ELEMENT( wps_elem_dev_name_t, u_int8_t dev_name[1] ); // <= 32B 111 | DEFINE_WPS_ELEMENT( wps_elem_dev_pw_id_t, u_int16_t dev_pw_id ); 112 | DEFINE_WPS_ELEMENT( wps_elem_e_hash1_t, u_int8_t e_hash1[BUF_SIZE_256_BITS] ); 113 | DEFINE_WPS_ELEMENT( wps_elem_e_hash2_t, u_int8_t e_hash2[BUF_SIZE_256_BITS] ); 114 | DEFINE_WPS_ELEMENT( wps_elem_e_snonce1_t, u_int8_t e_snonce1[BUF_SIZE_128_BITS] ); 115 | DEFINE_WPS_ELEMENT( wps_elem_e_snonce2_t, u_int8_t e_snonce2[BUF_SIZE_128_BITS] ); 116 | DEFINE_WPS_ELEMENT( wps_elem_ecrypt_settings_t, u_int8_t settings[1] ); // no limit defined 117 | DEFINE_WPS_ELEMENT( wps_elem_encrypt_type_t, u_int16_t encrypt_type ); 118 | DEFINE_WPS_ELEMENT( wps_elem_encrypt_type_flags_t, u_int16_t encrypt_type_flags ); 119 | DEFINE_WPS_ELEMENT( wps_elem_enrl_nonce_t, u_int8_t nonce[BUF_SIZE_128_BITS] ); 120 | DEFINE_WPS_ELEMENT( wps_elem_feature_id_t, u_int32_t feature_id ); 121 | DEFINE_WPS_ELEMENT( wps_elem_identity_t, u_int8_t identity[1] ); // <= 80 122 | // identity proof? 123 | DEFINE_WPS_ELEMENT( wps_elem_iv_t, u_int8_t iv[BUF_SIZE_256_BITS] ); 124 | DEFINE_WPS_ELEMENT( wps_elem_key_wrap_authenticator_t, u_int8_t key_wrap_authenticator[8] ); 125 | DEFINE_WPS_ELEMENT( wps_elem_key_id_t, u_int8_t key_id[16] ); 126 | DEFINE_WPS_ELEMENT( wps_elem_mac_addr_t, u_int8_t mac[ETHER_ADDR_LEN] ); 127 | DEFINE_WPS_ELEMENT( wps_elem_manufacturer_t, u_int8_t manufacturer[1] ); // <= 64 128 | DEFINE_WPS_ELEMENT( wps_elem_msg_type_t, u_int8_t msg_type ); 129 | DEFINE_WPS_ELEMENT( wps_elem_model_name_t, u_int8_t model_name[1] ); // <= 32B 130 | DEFINE_WPS_ELEMENT( wps_elem_model_number_t, u_int8_t model_number[1] ); // <= 32B 131 | DEFINE_WPS_ELEMENT( wps_elem_network_index_t, u_int8_t network_index ); 132 | DEFINE_WPS_ELEMENT( wps_elem_network_key_t, u_int8_t network_key[1] ); // <= 64B 133 | DEFINE_WPS_ELEMENT( wps_elem_network_key_index_t, u_int8_t network_key_index ); 134 | DEFINE_WPS_ELEMENT( wps_elem_new_dev_name_t, u_int8_t new_dev_name[1] ); // <= 32B 135 | DEFINE_WPS_ELEMENT( wps_elem_new_pw_t, u_int8_t new_pw[1] ); // <= 64 136 | // oob device password? 137 | DEFINE_WPS_ELEMENT( wps_elem_os_version_t, u_int32_t os_version ); 138 | DEFINE_WPS_ELEMENT( wps_elem_power_level_t, u_int8_t power_level ); 139 | DEFINE_WPS_ELEMENT( wps_elem_psk_current_t, u_int8_t psk_current ); 140 | DEFINE_WPS_ELEMENT( wps_elem_psk_max_t, u_int8_t psk_max ); 141 | DEFINE_WPS_ELEMENT( wps_elem_public_key_t, u_int8_t key[BUF_SIZE_1536_BITS] ); 142 | DEFINE_WPS_ELEMENT( wps_elem_radio_enabled_t, u_int8_t radio_enabled ); // bool? 143 | DEFINE_WPS_ELEMENT( wps_elem_reboot_t, u_int8_t reboot ); // bool? 144 | DEFINE_WPS_ELEMENT( wps_elem_reg_current_t, u_int8_t reg_current ); 145 | DEFINE_WPS_ELEMENT( wps_elem_reg_established_t, u_int8_t reg_established ); // bool? 146 | DEFINE_WPS_ELEMENT( wps_elem_reg_list_t, u_int8_t reg_list[1] ); // <= 512B 147 | DEFINE_WPS_ELEMENT( wps_elem_reg_max_t, u_int8_t reg_max ); 148 | DEFINE_WPS_ELEMENT( wps_elem_reg_nonce_t, u_int8_t nonce[BUF_SIZE_128_BITS] ); 149 | DEFINE_WPS_ELEMENT( wps_elem_req_type_t, u_int8_t req_type ); 150 | DEFINE_WPS_ELEMENT( wps_elem_resp_type_t, u_int8_t resp_type ); 151 | DEFINE_WPS_ELEMENT( wps_elem_rf_band_t, u_int8_t rf_band ); 152 | DEFINE_WPS_ELEMENT( wps_elem_r_hash1, u_int8_t r_hash1[BUF_SIZE_256_BITS] ); 153 | DEFINE_WPS_ELEMENT( wps_elem_r_hash2, u_int8_t r_hash2[BUF_SIZE_256_BITS] ); 154 | DEFINE_WPS_ELEMENT( wps_elem_r_snonce1, u_int8_t r_snonce1[BUF_SIZE_128_BITS] ); 155 | DEFINE_WPS_ELEMENT( wps_elem_r_snonce2, u_int8_t r_snonce2[BUF_SIZE_128_BITS] ); 156 | DEFINE_WPS_ELEMENT( wps_elem_selected_reg_t, u_int8_t selected_reg ); // bool? 157 | DEFINE_WPS_ELEMENT( wps_elem_serial_number_t, u_int8_t serial_number[1] ); // <= 32B 158 | DEFINE_WPS_ELEMENT( wps_elem_simple_config_state_t, u_int8_t simple_config_state ); 159 | DEFINE_WPS_ELEMENT( wps_elem_ssid_t, u_int8_t ssid[32] ); 160 | DEFINE_WPS_ELEMENT( wps_elem_total_networks_t, u_int8_t total_networks ); 161 | DEFINE_WPS_ELEMENT( wps_elem_uuid_e_t, u_int8_t uuid_e[16] ); 162 | DEFINE_WPS_ELEMENT( wps_elem_uuid_r_t, u_int8_t uuid_r[16] ); 163 | DEFINE_WPS_ELEMENT( wps_elem_vendor_ext_t, u_int8_t vendor_ext[1] ); // <= 1024 164 | DEFINE_WPS_ELEMENT( wps_elem_version_t, u_int8_t version ); // int? 165 | DEFINE_WPS_ELEMENT( wps_elem_x_509_cert_req_t, u_int8_t cert_req[1] ); // limit? 166 | DEFINE_WPS_ELEMENT( wps_elem_x_509_cert_t, u_int8_t cert[1] ); // limit? 167 | DEFINE_WPS_ELEMENT( wps_elem_eap_id_t, u_int8_t eap_id[1] ); // <= 64 168 | DEFINE_WPS_ELEMENT( wps_elem_msg_counter_t, u_int8_t msg_counter[8] ); 169 | DEFINE_WPS_ELEMENT( wps_elem_public_key_hash_t, u_int8_t public_key_hash[BUF_SIZE_160_BITS] ); 170 | DEFINE_WPS_ELEMENT( wps_elem_rekey_key_t, u_int8_t rekey_key[32] ); 171 | DEFINE_WPS_ELEMENT( wps_elem_key_lifetime_t, u_int32_t key_lifetime ); 172 | DEFINE_WPS_ELEMENT( wps_elem_permitted_config_methods_t, u_int16_t permitted_config_methods ); 173 | DEFINE_WPS_ELEMENT( wps_elem_sel_reg_config_methods_t, u_int8_t sel_reg_config_methods ); 174 | DEFINE_WPS_ELEMENT( wps_elem_primary_dev_type_t, struct wps_dev_type prime_dev_type ); 175 | DEFINE_WPS_ELEMENT( wps_elem_secondary_dev_type_list_t, u_int8_t secondary_dev_type_list[1] ); // <= 128B 176 | DEFINE_WPS_ELEMENT( wps_elem_portable_dev_t, u_int8_t portable_dev ); // bool? 177 | DEFINE_WPS_ELEMENT( wps_elem_ap_setup_locked_t, u_int8_t ap_setup_locked ); // bool? 178 | DEFINE_WPS_ELEMENT( wps_elem_app_list_t, u_int8_t app_list[1] ); // <= 512B 179 | DEFINE_WPS_ELEMENT( wps_elem_eap_type_t, u_int8_t eap_type[1] ); // <= 8B 180 | 181 | #define WPS_NEXT_ELEMENT( cast, cur_elm, len ) (cast)( (UInt8 *)(cur_elm) + sizeof( struct wps_msg_elem_hdr ) + ntohs( cur_elm->hdr.elem_len ) ); \ 182 | len+=( sizeof( struct wps_msg_elem_hdr ) + ntohs( cur_elm->hdr.elem_len ) ) 183 | #define WPS_NEXT_ELEMENT_IE( cast, cur_elm, len ) (cast)( (UInt8 *)(cur_elm) + sizeof( struct wps_msg_elem_hdr ) + ntohs( cur_elm->hdr.elem_len ) ); \ 184 | len-=( sizeof( struct wps_msg_elem_hdr ) + ntohs( cur_elm->hdr.elem_len ) ); 185 | #define WPS_ELEMENT_IS( elem, id ) ( ntohs( elem->hdr.elem_id ) == id ) 186 | #define WPS_ELEMENT_LEN_VAR( elem ) ( sizeof( struct wps_msg_elem_hdr ) + ntohs( elem->hdr.elem_len ) ) 187 | #define WPS_ELEMENT_LEN_FIXED( fixed ) ( sizeof( struct wps_msg_elem_hdr ) + sizeof( fixed ) ) 188 | #define WPS_ELEMENT_PARAM_LEN( elem ) ( ntohs( elem->hdr.elem_len ) ) 189 | 190 | // Messages 191 | #define WPS_MBUF_GET_MSG_PTR( m, type ) (type *)( (UInt8 *)mbuf_data( m ) + sizeof( struct ether_header ) + sizeof( struct wps_eap_hdr ) ) 192 | 193 | struct wps_msg_nack 194 | { 195 | wps_elem_version_t version; 196 | wps_elem_msg_type_t msg_type; 197 | wps_elem_enrl_nonce_t enrl_nonce; 198 | wps_elem_reg_nonce_t reg_nonce; 199 | wps_elem_config_error_t error; 200 | }PACKED; 201 | 202 | struct wps_msg_ack 203 | { 204 | wps_elem_version_t version; 205 | wps_elem_msg_type_t msg_type; 206 | wps_elem_enrl_nonce_t enrl_nonce; 207 | wps_elem_reg_nonce_t reg_nonce; 208 | }PACKED; 209 | 210 | struct wps_msg_done 211 | { 212 | wps_elem_version_t version; 213 | wps_elem_msg_type_t msg_type; 214 | }; 215 | 216 | // From RFC 3748 section 4.1 for identity 217 | struct wps_identity_msg 218 | { 219 | u_int8_t code; 220 | u_int8_t id; 221 | u_int16_t length; 222 | u_int8_t type; 223 | // u_int8_t type_data[1]; /* data follows */ 224 | }__attribute__((packed)); 225 | 226 | #define WPS_EAP_TYPE_IDENTITY 1 227 | 228 | // Data Element Definitions 229 | #define WPS_ID_AP_CHANNEL 0x1001 230 | #define WPS_ID_ASSOC_STATE 0x1002 231 | #define WPS_ID_AUTH_TYPE 0x1003 232 | #define WPS_ID_AUTH_TYPE_FLAGS 0x1004 233 | #define WPS_ID_AUTHENTICATOR 0x1005 234 | #define WPS_ID_CONFIG_METHODS 0x1008 235 | #define WPS_ID_CONFIG_ERROR 0x1009 236 | #define WPS_ID_CONF_URL4 0x100A 237 | #define WPS_ID_CONF_URL6 0x100B 238 | #define WPS_ID_CONN_TYPE 0x100C 239 | #define WPS_ID_CONN_TYPE_FLAGS 0x100D 240 | #define WPS_ID_CREDENTIAL 0x100E 241 | #define WPS_ID_DEVICE_NAME 0x1011 242 | #define WPS_ID_DEVICE_PWD_ID 0x1012 243 | #define WPS_ID_E_HASH1 0x1014 244 | #define WPS_ID_E_HASH2 0x1015 245 | #define WPS_ID_E_SNONCE1 0x1016 246 | #define WPS_ID_E_SNONCE2 0x1017 247 | #define WPS_ID_ENCR_SETTINGS 0x1018 248 | #define WPS_ID_ENCR_TYPE 0x100F 249 | #define WPS_ID_ENCR_TYPE_FLAGS 0x1010 250 | #define WPS_ID_ENROLLEE_NONCE 0x101A 251 | #define WPS_ID_FEATURE_ID 0x101B 252 | #define WPS_ID_IDENTITY 0x101C 253 | #define WPS_ID_IDENTITY_PROOF 0x101D 254 | #define WPS_ID_INIT_VECTOR 0x104B //this becomes 0x1060 later 255 | //#define WPS_ID_KEY_WRAP_AUTH WPS_ID_AUTHENTICATOR //this becomes 0x101E later 256 | #define WPS_ID_KEY_WRAP_AUTH 0x101E // HH changed for MS beta 2 testing 257 | #define WPS_ID_KEY_IDENTIFIER 0x101F 258 | #define WPS_ID_MAC_ADDR 0x1020 259 | #define WPS_ID_MANUFACTURER 0x1021 260 | #define WPS_ID_MSG_TYPE 0x1022 261 | #define WPS_ID_MODEL_NAME 0x1023 262 | #define WPS_ID_MODEL_NUMBER 0x1024 263 | #define WPS_ID_NW_INDEX 0x1026 264 | #define WPS_ID_NW_KEY 0x1027 265 | #define WPS_ID_NW_KEY_INDEX 0x1028 266 | #define WPS_ID_NEW_DEVICE_NAME 0x1029 267 | #define WPS_ID_NEW_PWD 0x102A 268 | #define WPS_ID_OOB_DEV_PWD 0x102C 269 | #define WPS_ID_OS_VERSION 0x102D 270 | #define WPS_ID_POWER_LEVEL 0x102F 271 | #define WPS_ID_PSK_CURRENT 0x1030 272 | #define WPS_ID_PSK_MAX 0x1031 273 | #define WPS_ID_PUBLIC_KEY 0x1032 274 | #define WPS_ID_RADIO_ENABLED 0x1033 275 | #define WPS_ID_REBOOT 0x1034 276 | #define WPS_ID_REGISTRAR_CURRENT 0x1035 277 | #define WPS_ID_REGISTRAR_ESTBLSHD 0x1036 278 | #define WPS_ID_REGISTRAR_LIST 0x1037 279 | #define WPS_ID_REGISTRAR_MAX 0x1038 280 | #define WPS_ID_REGISTRAR_NONCE 0x1039 281 | #define WPS_ID_REQ_TYPE 0x103A 282 | #define WPS_ID_RESP_TYPE 0x103B 283 | #define WPS_ID_RF_BAND 0x103C 284 | #define WPS_ID_R_HASH1 0x103D 285 | #define WPS_ID_R_HASH2 0x103E 286 | #define WPS_ID_R_SNONCE1 0x103F 287 | #define WPS_ID_R_SNONCE2 0x1040 288 | #define WPS_ID_SEL_REGISTRAR 0x1041 289 | #define WPS_ID_SERIAL_NUM 0x1042 290 | #define WPS_ID_SC_STATE 0x1044 291 | #define WPS_ID_SSID 0x1045 292 | #define WPS_ID_TOT_NETWORKS 0x1046 293 | #define WPS_ID_UUID_E 0x1047 294 | #define WPS_ID_UUID_R 0x1048 295 | #define WPS_ID_VENDOR_EXT 0x1049 296 | #define WPS_ID_VERSION 0x104A 297 | #define WPS_ID_X509_CERT_REQ 0x104B 298 | #define WPS_ID_X509_CERT 0x104C 299 | #define WPS_ID_EAP_IDENTITY 0x104D 300 | #define WPS_ID_MSG_COUNTER 0x104E 301 | #define WPS_ID_PUBKEY_HASH 0x104F 302 | #define WPS_ID_REKEY_KEY 0x1050 303 | #define WPS_ID_KEY_LIFETIME 0x1051 304 | #define WPS_ID_PERM_CFG_METHODS 0x1052 305 | #define WPS_ID_SEL_REG_CFG_METHODS_ORIGINAL 0x0153 // This was the original val in the spec, we must support both 306 | #define WPS_ID_SEL_REG_CFG_METHODS 0x1053 307 | #define WPS_ID_PRIM_DEV_TYPE 0x1054 308 | #define WPS_ID_SEC_DEV_TYPE_LIST 0x1055 309 | #define WPS_ID_PORTABLE_DEVICE 0x1056 310 | #define WPS_ID_AP_SETUP_LOCKED 0x1057 311 | #define WPS_ID_APP_LIST 0x1058 312 | #define WPS_ID_EAP_TYPE 0x1059 313 | 314 | // Association states 315 | #define WPS_ASSOC_NOT_ASSOCIATED 0 316 | #define WPS_ASSOC_CONN_SUCCESS 1 317 | #define WPS_ASSOC_CONFIG_FAIL 2 318 | #define WPS_ASSOC_ASSOC_FAIL 3 319 | #define WPS_ASSOC_IP_FAIL 4 320 | 321 | // Authentication types 322 | #define WPS_AUTHTYPE_OPEN 0x0001 323 | #define WPS_AUTHTYPE_WPAPSK 0x0002 324 | #define WPS_AUTHTYPE_SHARED 0x0004 325 | #define WPS_AUTHTYPE_WPA 0x0008 326 | #define WPS_AUTHTYPE_WPA2 0x0010 327 | #define WPS_AUTHTYPE_WPA2PSK 0x0020 328 | 329 | // Config methods 330 | #define WPS_CONFMET_USBA 0x0001 331 | #define WPS_CONFMET_ETHERNET 0x0002 332 | #define WPS_CONFMET_LABEL 0x0004 333 | #define WPS_CONFMET_DISPLAY 0x0008 334 | #define WPS_CONFMET_EXT_NFC_TOK 0x0010 335 | #define WPS_CONFMET_INT_NFC_TOK 0x0020 336 | #define WPS_CONFMET_NFC_INTF 0x0040 337 | #define WPS_CONFMET_PBC 0x0080 338 | #define WPS_CONFMET_KEYPAD 0x0100 339 | 340 | // WPS error messages 341 | #define WPS_ERROR_NO_ERROR 0 342 | #define WPS_ERROR_OOB_INT_READ_ERR 1 343 | #define WPS_ERROR_DECRYPT_CRC_FAIL 2 344 | #define WPS_ERROR_CHAN24_NOT_SUPP 3 345 | #define WPS_ERROR_CHAN50_NOT_SUPP 4 346 | #define WPS_ERROR_SIGNAL_WEAK 5 347 | #define WPS_ERROR_NW_AUTH_FAIL 6 348 | #define WPS_ERROR_NW_ASSOC_FAIL 7 349 | #define WPS_ERROR_NO_DHCP_RESP 8 350 | #define WPS_ERROR_FAILED_DHCP_CONF 9 351 | #define WPS_ERROR_IP_ADDR_CONFLICT 10 352 | #define WPS_ERROR_FAIL_CONN_REGISTRAR 11 353 | #define WPS_ERROR_MULTI_PBC_DETECTED 12 354 | #define WPS_ERROR_ROGUE_SUSPECTED 13 355 | #define WPS_ERROR_DEVICE_BUSY 14 356 | #define WPS_ERROR_SETUP_LOCKED 15 357 | #define WPS_ERROR_MSG_TIMEOUT 16 358 | #define WPS_ERROR_REG_SESSION_TIMEOUT 17 359 | #define WPS_ERROR_DEV_PWD_AUTH_FAIL 18 360 | 361 | #define WPS_ERROR_MAX WPS_ERROR_DEV_PWD_AUTH_FAIL 362 | 363 | // Connection types 364 | #define WPS_CONNTYPE_ESS 0x01 365 | #define WPS_CONNTYPE_IBSS 0x02 366 | 367 | // Device password ID 368 | #define WPS_DEVICEPWDID_DEFAULT 0x0000 369 | #define WPS_DEVICEPWDID_USER_SPEC 0x0001 370 | #define WPS_DEVICEPWDID_MACHINE_SPEC 0x0002 371 | #define WPS_DEVICEPWDID_REKEY 0x0003 372 | #define WPS_DEVICEPWDID_PUSH_BTN 0x0004 373 | #define WPS_DEVICEPWDID_REG_SPEC 0x0005 374 | 375 | /* 376 | // Device type 377 | #define WPS_DEVICETYPE_COMPUTER "Computer" 378 | #define WPS_DEVICETYPE_AP "Access_Point" 379 | #define WPS_DEVICETYPE_ROUTER_AP "Router_AP" 380 | #define WPS_DEVICETYPE_PRINTER "Printer" 381 | #define WPS_DEVICETYPE_PRINTER_BRIDGE "Printer_Brigde" 382 | #define WPS_DEVICETYPE_ELECT_PIC_FRAME "Electronic_Picture_Frame" 383 | #define WPS_DEVICETYPE_DIG_AUDIO_RECV "Digital_Audio_Receiver" 384 | #define WPS_DEVICETYPE_WIN_MCE "Windows_Media_Center_Extender" 385 | #define WPS_DEVICETYPE_WIN_MOBILE "Windows_Mobile" 386 | #define WPS_DEVICETYPE_PVR "Personal_Video_Recorder" 387 | #define WPS_DEVICETYPE_VIDEO_STB "Video_STB" 388 | #define WPS_DEVICETYPE_PROJECTOR "Projector" 389 | #define WPS_DEVICETYPE_IP_TV "IP_TV" 390 | #define WPS_DEVICETYPE_DIG_STILL_CAM "Digital_Still_Camera" 391 | #define WPS_DEVICETYPE_PHONE "Phone" 392 | #define WPS_DEVICETYPE_VOID_PHONE "VoIP_Phone" 393 | #define WPS_DEVICETYPE_GAME_CONSOLE "Game_console" 394 | #define WPS_DEVICETYPE_OTHER "Other" 395 | */ 396 | 397 | // Encryption type 398 | #define WPS_ENCRTYPE_NONE 0x0001 399 | #define WPS_ENCRTYPE_WEP 0x0002 400 | #define WPS_ENCRTYPE_TKIP 0x0004 401 | #define WPS_ENCRTYPE_AES 0x0008 402 | 403 | 404 | // WPS Message Types 405 | #define WPS_ID_BEACON 0x01 406 | #define WPS_ID_PROBE_REQ 0x02 407 | #define WPS_ID_PROBE_RESP 0x03 408 | #define WPS_ID_MESSAGE_M1 0x04 409 | #define WPS_ID_MESSAGE_M2 0x05 410 | #define WPS_ID_MESSAGE_M2D 0x06 411 | #define WPS_ID_MESSAGE_M3 0x07 412 | #define WPS_ID_MESSAGE_M4 0x08 413 | #define WPS_ID_MESSAGE_M5 0x09 414 | #define WPS_ID_MESSAGE_M6 0x0A 415 | #define WPS_ID_MESSAGE_M7 0x0B 416 | #define WPS_ID_MESSAGE_M8 0x0C 417 | #define WPS_ID_MESSAGE_ACK 0x0D 418 | #define WPS_ID_MESSAGE_NACK 0x0E 419 | #define WPS_ID_MESSAGE_DONE 0x0F 420 | 421 | //Device Type categories for primary and secondary device types 422 | #define WPS_DEVICE_TYPE_CAT_COMPUTER 1 423 | #define WPS_DEVICE_TYPE_CAT_INPUT_DEVICE 2 424 | #define WPS_DEVICE_TYPE_CAT_PRINTER 3 425 | #define WPS_DEVICE_TYPE_CAT_CAMERA 4 426 | #define WPS_DEVICE_TYPE_CAT_STORAGE 5 427 | #define WPS_DEVICE_TYPE_CAT_NW_INFRA 6 428 | #define WPS_DEVICE_TYPE_CAT_DISPLAYS 7 429 | #define WPS_DEVICE_TYPE_CAT_MM_DEVICES 8 430 | #define WPS_DEVICE_TYPE_CAT_GAME_DEVICES 9 431 | #define WPS_DEVICE_TYPE_CAT_TELEPHONE 10 432 | 433 | //Device Type sub categories for primary and secondary device types 434 | #define WPS_DEVICE_TYPE_SUB_CAT_COMP_PC 1 435 | #define WPS_DEVICE_TYPE_SUB_CAT_COMP_SERVER 2 436 | #define WPS_DEVICE_TYPE_SUB_CAT_COMP_MEDIA_CTR 3 437 | #define WPS_DEVICE_TYPE_SUB_CAT_PRTR_PRINTER 1 438 | #define WPS_DEVICE_TYPE_SUB_CAT_PRTR_SCANNER 2 439 | #define WPS_DEVICE_TYPE_SUB_CAT_CAM_DGTL_STILL 1 440 | #define WPS_DEVICE_TYPE_SUB_CAT_STOR_NAS 1 441 | #define WPS_DEVICE_TYPE_SUB_CAT_NW_AP 1 442 | #define WPS_DEVICE_TYPE_SUB_CAT_NW_ROUTER 2 443 | #define WPS_DEVICE_TYPE_SUB_CAT_NW_SWITCH 3 444 | #define WPS_DEVICE_TYPE_SUB_CAT_DISP_TV 1 445 | #define WPS_DEVICE_TYPE_SUB_CAT_DISP_PIC_FRAME 2 446 | #define WPS_DEVICE_TYPE_SUB_CAT_DISP_PROJECTOR 3 447 | #define WPS_DEVICE_TYPE_SUB_CAT_MM_DAR 1 448 | #define WPS_DEVICE_TYPE_SUB_CAT_MM_PVR 2 449 | #define WPS_DEVICE_TYPE_SUB_CAT_MM_MCX 3 450 | #define WPS_DEVICE_TYPE_SUB_CAT_GAM_XBOX 1 451 | #define WPS_DEVICE_TYPE_SUB_CAT_GAM_XBOX_360 2 452 | #define WPS_DEVICE_TYPE_SUB_CAT_GAM_PS 3 453 | #define WPS_DEVICE_TYPE_SUB_CAT_PHONE_WM 1 454 | 455 | // Device request/response type 456 | #define WPS_MSGTYPE_ENROLLEE_INFO_ONLY 0x00 457 | #define WPS_MSGTYPE_ENROLLEE_OPEN_8021X 0x01 458 | #define WPS_MSGTYPE_REGISTRAR 0x02 459 | #define WPS_MSGTYPE_AP_WLAN_MGR 0x03 460 | 461 | // RF Band 462 | #define WPS_RFBAND_24GHZ 0x01 463 | #define WPS_RFBAND_50GHZ 0x02 464 | 465 | // Simple Config state 466 | #define WPS_SCSTATE_UNCONFIGURED 0x01 467 | #define WPS_SCSTATE_CONFIGURED 0x02 468 | 469 | // State business 470 | #define WPS_RETRY_INTERVAL 5 /* seconds */ 471 | #define WPS_PACKET_TIMEOUT 15 /* seconds */ 472 | 473 | #define WPS_TIMEOUT_SECS 1 474 | 475 | enum WPSSupplicantState 476 | { 477 | WPS_S_INIT, 478 | WPS_S_EAPOL_START_TX, 479 | WPS_S_EAPOL_START_RX, 480 | WPS_S_IDENT_REQ_TX, 481 | WPS_S_IDENT_REQ_RX, 482 | WPS_S_IDENT_RESP_TX, 483 | WPS_S_IDENT_RESP_RX, 484 | WPS_S_START_TX, 485 | WPS_S_START_RX, 486 | WPS_S_M1_TX, 487 | WPS_S_M1_RX, 488 | WPS_S_M2_TX, 489 | WPS_S_M2_RX, 490 | WPS_S_M3_TX, 491 | WPS_S_M3_RX, 492 | WPS_S_M4_TX, 493 | WPS_S_M4_RX, 494 | WPS_S_M5_TX, 495 | WPS_S_M5_RX, 496 | WPS_S_M6_TX, 497 | WPS_S_M6_RX, 498 | WPS_S_M7_TX, 499 | WPS_S_M7_RX, 500 | WPS_S_M8_TX, 501 | WPS_S_M8_RX, 502 | WPS_S_DONE_TX, 503 | WPS_S_DONE_RX, 504 | WPS_S_FAIL_TX, 505 | WPS_S_FAIL_RX, 506 | WPS_S_MSG_TIMEOUT, 507 | WPS_S_SESSION_TIMEOUT, 508 | }; 509 | typedef enum WPSSupplicantState WPSSupplicantState; 510 | 511 | // Apple specific error codes 512 | 513 | #define WPSE_NOERR 0 // no error 514 | #define WPSE_ERR -1 // general error code 515 | #define WPSE_PROTO_ERR -2 // Problem with EAPOL handshake 516 | #define WPSE_IE_NOT_PRESENT -3 // No WPS IE present in IE list for ssid 517 | #define WPSE_IE_MALFORMED -4 // WPS IS missing required (for Apple) fields 518 | #define WPSE_SCAN_ERR -5 // Scan failed 519 | #define WPSE_NO_PIN_AT_REG -6 // No PIN configured at registrar 520 | #define WPSE_NO_PIN_AT_CLIENT -7 // No PIN configured at client 521 | #define WPSE_SSID_NOT_FOUND -8 // Scan did not find SSID 522 | #define WPSE_UNSUPPORTED_PW_ID -9 // Registrar reports that it is using an unsupported PW ID 523 | #define WPSE_ASSOC_FAILED -10 // Association attempt failed 524 | #define WPSE_API_REQ -11 // An apple80211 ioctl request failed 525 | #define WPSE_NOMEM -12 // memory error 526 | #define WPSE_WPA_RSN_NOT_SUP -13 // WPA/RSN not supported 527 | #define WPSE_TIMEOUT -14 // EAPOL timed out 528 | #define WPSE_NACKED -15 // NACKED by registrar 529 | #define WPSE_FAIL -16 // unexpected EAP-FAIL received 530 | 531 | #endif /* WPS_EAP_H */ 532 | 533 | -------------------------------------------------------------------------------- /Black80211/apple80211/catalina/apple80211_var.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * The contents of this file constitute Original Code as defined in and 7 | * are subject to the Apple Public Source License Version 1.1 (the 8 | * "License"). You may not use this file except in compliance with the 9 | * License. Please obtain a copy of the License at 10 | * http://www.apple.com/publicsource and read it before using this file. 11 | * 12 | * This Original Code and all software distributed under the License are 13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER 14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the 17 | * License for the specific language governing rights and limitations 18 | * under the License. 19 | * 20 | * @APPLE_LICENSE_HEADER_END@ 21 | */ 22 | 23 | #ifndef _APPLE80211_VAR_H_ 24 | #define _APPLE80211_VAR_H_ 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | // Sizes and limits 31 | #define APPLE80211_ADDR_LEN 6 32 | #define APPLE80211_MAX_RATES 15 33 | #define APPLE80211_MAX_SSID_LEN 32 34 | #define APPLE80211_MAX_ANTENNAE 4 35 | #define APPLE80211_MAX_RADIO 4 36 | #define APPLE80211_MAX_CHANNELS 64 37 | #define APPLE80211_MAX_STATIONS 128 38 | #define APPLE80211_MAX_VERSION_LEN 256 39 | #define APPLE80211_MAX_ROM_SIZE 32768 // 32 KB 40 | #define APPLE80211_MAX_RSN_IE_LEN 257 // 255 + type and length bytes 41 | #define APPLE80211_MAX_CC_LEN 3 42 | #define APPLE80211_MAX_MCS_INDEX 76 43 | #define APPLE80211_MAX_MPDU_FACTOR 3 44 | #define APPLE80211_MAX_MPDU_DENSITY 7 45 | #define APPLE80211_MAX_WOW_PAT_LEN 1500 // Max wake on wireless pattern length 46 | #define APPLE80211_MAX_WOW_PATTERNS 12 // Arbitrary..this can change 47 | 48 | #define APPLE80211_MAP_SIZE( _bits ) (roundup( _bits, NBBY )/NBBY) 49 | 50 | enum apple80211_phymode { 51 | APPLE80211_MODE_UNKNOWN = 0, 52 | APPLE80211_MODE_AUTO = 0x1, // autoselect 53 | APPLE80211_MODE_11A = 0x2, // 5GHz, OFDM 54 | APPLE80211_MODE_11B = 0x4, // 2GHz, CCK 55 | APPLE80211_MODE_11G = 0x8, // 2GHz, OFDM 56 | APPLE80211_MODE_11N = 0x10, // 2GHz/5GHz, OFDM 57 | APPLE80211_MODE_TURBO_A = 0x20, // 5GHz, OFDM, 2x clock 58 | APPLE80211_MODE_TURBO_G = 0x40, // 2GHz, OFDM, 2x clock 59 | }; 60 | 61 | enum apple80211_physubmode { 62 | APPLE80211_SUBMODE_UNKNOWN = 0x0, 63 | APPLE80211_SUBMODE_11N_AUTO = 0x1, // 11n mode determined by AP capabilities 64 | APPLE80211_SUBMODE_11N_LEGACY = 0x2, // legacy 65 | APPLE80211_SUBMODE_11N_LEGACY_DUP = 0x4, // legacy duplicate 66 | APPLE80211_SUBMODE_11N_HT = 0x8, // high throughput 67 | APPLE80211_SUBMODE_11N_HT_DUP = 0x10, // high throughput duplicate 68 | APPLE80211_SUBMODE_11N_GF = 0x20, // green field 69 | }; 70 | 71 | // flags 72 | enum apple80211_opmode { 73 | APPLE80211_M_NONE = 0x0, 74 | APPLE80211_M_STA = 0x1, // infrastructure station 75 | APPLE80211_M_IBSS = 0x2, // IBSS (adhoc) station 76 | APPLE80211_M_AHDEMO = 0x4, // Old lucent compatible adhoc demo 77 | APPLE80211_M_HOSTAP = 0x8, // Software Access Point 78 | APPLE80211_M_MONITOR = 0x10 // Monitor mode 79 | }; 80 | 81 | enum apple80211_apmode { 82 | APPLE80211_AP_MODE_UNKNOWN = 0, 83 | APPLE80211_AP_MODE_IBSS = 1, // IBSS (adhoc) station 84 | APPLE80211_AP_MODE_INFRA = 2, // Access Point 85 | APPLE80211_AP_MODE_ANY = 3, // Any supported mode 86 | }; 87 | 88 | enum apple80211_state { 89 | APPLE80211_S_INIT = 0, // default state 90 | APPLE80211_S_SCAN = 1, // scanning 91 | APPLE80211_S_AUTH = 2, // try to authenticate 92 | APPLE80211_S_ASSOC = 3, // try to assoc 93 | APPLE80211_S_RUN = 4, // associated 94 | }; 95 | 96 | enum apple80211_protmode { 97 | APPLE80211_PROTMODE_OFF = 0, // no protection 98 | APPLE80211_PROTMODE_AUTO = 1, // auto 99 | APPLE80211_PROTMODE_CTS = 2, // CTS to self 100 | APPLE80211_PROTMODE_RTSCTS = 3, // RTS-CTS 101 | APPLE80211_PROTMODE_DUAL_CTS = 4, // dual CTS 102 | }; 103 | 104 | enum apple80211_cipher_type { 105 | APPLE80211_CIPHER_NONE = 0, // open network 106 | APPLE80211_CIPHER_WEP_40 = 1, // 40 bit WEP 107 | APPLE80211_CIPHER_WEP_104 = 2, // 104 bit WEP 108 | APPLE80211_CIPHER_TKIP = 3, // TKIP (WPA) 109 | APPLE80211_CIPHER_AES_OCB = 4, // AES (OCB) 110 | APPLE80211_CIPHER_AES_CCM = 5, // AES (CCM) 111 | APPLE80211_CIPHER_PMK = 6, // PMK 112 | APPLE80211_CIPHER_PMKSA = 7, // PMK obtained from pre-authentication 113 | }; 114 | 115 | enum apple80211_cipher_key_type 116 | { 117 | APPLE80211_CIPHER_KEY_TYPE_UNICAST = 0, // unicast cipher key 118 | APPLE80211_CIPHER_KEY_TYPE_MULTICAST = 1 // multicast cipher key 119 | }; 120 | 121 | // Low level 802.11 authentication types 122 | 123 | enum apple80211_authtype_lower 124 | { 125 | APPLE80211_AUTHTYPE_OPEN = 1, // open 126 | APPLE80211_AUTHTYPE_SHARED = 2, // shared key 127 | APPLE80211_AUTHTYPE_CISCO = 3, // cisco net eap 128 | }; 129 | 130 | // Higher level authentication used after 802.11 association complete 131 | 132 | enum apple80211_authtype_upper 133 | { 134 | APPLE80211_AUTHTYPE_NONE = 0, // No upper auth 135 | APPLE80211_AUTHTYPE_WPA = 1, // WPA 136 | APPLE80211_AUTHTYPE_WPA_PSK = 2, // WPA PSK 137 | APPLE80211_AUTHTYPE_WPA2 = 3, // WPA2 138 | APPLE80211_AUTHTYPE_WPA2_PSK = 4, // WPA2 PSK 139 | APPLE80211_AUTHTYPE_LEAP = 5, // LEAP 140 | APPLE80211_AUTHTYPE_8021X = 6, // 802.1x 141 | APPLE80211_AUTHTYPE_WPS = 7, // WiFi Protected Setup 142 | }; 143 | 144 | // Unify association status code and deauth reason codes into a single enum describing 145 | // common error conditions 146 | enum apple80211_associate_result 147 | { 148 | APPLE80211_RESULT_UNAVAILABLE = 0, // No association/authentication result ready 149 | APPLE80211_RESULT_SUCCESS = 1, // APPLE80211_STATUS_SUCCESS and no deauth 150 | APPLE80211_RESULT_UNSPECIFIED_FAILURE = 2, // APPLE80211_STATUS_UNSPECIFIED_FAILURE 151 | APPLE80211_RESULT_UNSUPPORTED_CAPAPBILITIES = 3, // APPLE80211_STATUS_UNSUPPORTED_CAPABILITIES 152 | APPLE80211_RESULT_REASSOCIATION_DENIED = 4, // APPLE80211_STATUS_REASSOCIATION_DENIED 153 | APPLE80211_RESULT_ASSOCIATION_DENIED = 5, // APPLE80211_STATUS_ASSOCIATION_DENIED 154 | APPLE80211_RESULT_AUTH_ALG_UNSUPPORTED = 6, // APPLE80211_STATUS_AUTH_ALG_UNSUPPORTED 155 | APPLE80211_RESULT_INVALID_AUTH_SEQ_NUM = 7, // APPLE80211_STATUS_INVALID_AUTH_SEQ_NUM 156 | APPLE80211_RESULT_CHALLENGE_FAILURE = 8, // APPLE80211_STATUS_CHALLENGE_FAILURE 157 | APPLE80211_RESULT_TIMEOUT = 9, // APPLE80211_STATUS_TIMEOUT 158 | APPLE80211_RESULT_AP_FULL = 10, // APPLE80211_STATUS_AP_FULL 159 | APPLE80211_RESULT_UNSUPPORTED_RATE_SET = 11, // APPLE80211_STATUS_UNSUPPORTED_RATE_SET 160 | APPLE80211_RESULT_SHORT_SLOT_UNSUPPORTED = 12, // APPLE80211_STATUS_SHORT_SLOT_UNSUPPORTED 161 | APPLE80211_RESULT_DSSS_OFDM_UNSUPPORTED = 13, // APPLE80211_STATUS_DSSS_OFDM_UNSUPPORTED 162 | APPLE80211_RESULT_INVALID_IE = 14, // APPLE80211_STATUS_INVALID_IE 163 | APPLE80211_RESULT_INVALID_GROUP_CIPHER = 15, // APPLE80211_STATUS_INVALID_GROUP_CIPHER 164 | APPLE80211_RESULT_INVALID_PAIRWISE_CIPHER = 16, // APPLE80211_STATUS_INVALID_PAIRWISE_CIPHER 165 | APPLE80211_RESULT_INVALID_AKMP = 17, // APPLE80211_STATUS_INVALID_AKMP 166 | APPLE80211_RESULT_UNSUPPORTED_RSN_VERSION = 18, // APPLE80211_STATUS_UNSUPPORTED_RSN_VERSION 167 | APPLE80211_RESULT_INVALID_RSN_CAPABILITIES = 19, // APPLE80211_STATUS_INVALID_RSN_CAPABILITIES 168 | APPLE80211_RESULT_CIPHER_SUITE_REJECTED = 20, // APPLE80211_STATUS_CIPHER_SUIT_REJECTED 169 | APPLE80211_RESULT_INVALID_PMK = 21, // APPLE80211_REASON_PREV_AUTH_EXPIRED received 170 | APPLE80211_RESULT_SUPPLICANT_TIMEOUT = 22, // RSNSupplicant did not finish handshake 171 | APPLE80211_RESULT_UNKNOWN = 0xffff // Unrecognized error condition 172 | }; 173 | 174 | enum apple80211_unit 175 | { 176 | APPLE80211_UNIT_DBM = 0, // dBm 177 | APPLE80211_UNIT_MW = 1, // milliwatts 178 | APPLE80211_UNIT_PERCENT = 2, // value expressed as a percentage 179 | }; 180 | 181 | enum apple80211_power_state 182 | { 183 | APPLE80211_POWER_OFF = 0, // Chain disabled 184 | APPLE80211_POWER_ON = 1, // Chain powered on for tx and rx 185 | APPLE80211_POWER_TX = 2, // Chain powered on for tx only 186 | APPLE80211_POWER_RX = 3, // Chain powered on for rx only 187 | }; 188 | 189 | enum apple80211_locale 190 | { 191 | APPLE80211_LOCALE_UNKNOWN = 0, 192 | APPLE80211_LOCALE_FCC = 1, 193 | APPLE80211_LOCALE_ETSI = 2, 194 | APPLE80211_LOCALE_JAPAN = 3, 195 | APPLE80211_LOCALE_KOREA = 4, 196 | APPLE80211_LOCALE_APAC = 5, 197 | APPLE80211_LOCALE_ROW = 6, 198 | }; 199 | 200 | enum apple80211_scan_type 201 | { 202 | APPLE80211_SCAN_TYPE_NONE = 0, 203 | APPLE80211_SCAN_TYPE_ACTIVE = 1, 204 | APPLE80211_SCAN_TYPE_PASSIVE = 2, 205 | APPLE80211_SCAN_TYPE_FAST = 3, // Ok to return cached scan results 206 | APPLE80211_SCAN_TYPE_BACKGROUND = 4, // Initiate background scanning 207 | }; 208 | 209 | enum apple80211_int_mit { 210 | APPLE80211_INT_MIT_OFF = 0, 211 | APPLE80211_INT_MIT_AUTO = 1, 212 | }; 213 | 214 | enum apple80211_channel_flag 215 | { 216 | APPLE80211_C_FLAG_NONE = 0x0, // no flags 217 | APPLE80211_C_FLAG_10MHZ = 0x1, // 10 MHz wide 218 | APPLE80211_C_FLAG_20MHZ = 0x2, // 20 MHz wide 219 | APPLE80211_C_FLAG_40MHZ = 0x4, // 40 MHz wide 220 | APPLE80211_C_FLAG_2GHZ = 0x8, // 2.4 GHz 221 | APPLE80211_C_FLAG_5GHZ = 0x10, // 5 GHz 222 | APPLE80211_C_FLAG_IBSS = 0x20, // IBSS supported 223 | APPLE80211_C_FLAG_HOST_AP = 0x40, // HOST AP mode supported 224 | APPLE80211_C_FLAG_ACTIVE = 0x80, // active scanning supported 225 | APPLE80211_C_FLAG_DFS = 0x100, // DFS required 226 | APPLE80211_C_FLAG_EXT_ABV = 0x200, // If 40 Mhz, extension channel above. 227 | // If this flag is not set, then the 228 | // extension channel is below. 229 | }; 230 | 231 | enum apple80211_rate_flag 232 | { 233 | APPLE80211_RATE_FLAG_NONE = 0x0, // no flags 234 | APPLE80211_RATE_FLAG_BASIC = 0x1, // basic rate 235 | APPLE80211_RATE_FLAG_HT = 0x2, // HT rate computed from MCS index 236 | }; 237 | 238 | enum apple80211_short_slot_mode 239 | { 240 | APPLE80211_SHORT_SLOT_MODE_AUTO = 1, // Default behavior 241 | APPLE80211_SHORT_SLOT_MODE_LONG = 2, // long - short slot timing mode 242 | APPLE80211_SHORT_SLOT_MODE_SHORT = 3, // short - short slot timing mode 243 | }; 244 | 245 | enum apple80211_powersave_mode 246 | { 247 | // Standard modes 248 | APPLE80211_POWERSAVE_MODE_DISABLED = 0, 249 | APPLE80211_POWERSAVE_MODE_80211 = 1, 250 | APPLE80211_POWERSAVE_MODE_VENDOR = 2, // Vendor specific mode, there should be 251 | // more general apple modes in the future. 252 | // Vendor modes also likely require more info. 253 | // Mimo modes 254 | APPLE80211_POWERSAVE_MODE_MIMO_STATIC = 3, 255 | APPLE80211_POWERSAVE_MODE_MIMO_DYNAMIC = 4, 256 | APPLE80211_POWERSAVE_MODE_MIMO_MIMO = 5, 257 | 258 | // WOW 259 | APPLE80211_POWERSAVE_MODE_WOW = 6, 260 | 261 | // Vendor specific powersave mode, throughput is maximized 262 | APPLE80211_POWERSAVE_MODE_MAX_THROUGHPUT = 7, 263 | 264 | // Vendor specific powersave mode, power savings are maximized, possibly 265 | // at the expense of throughput/latency. 266 | APPLE80211_POWERSAVE_MODE_MAX_POWERSAVE = 8, 267 | }; 268 | 269 | enum apple80211_debug_flag 270 | { 271 | APPLE80211_DEBUG_FLAG_NONE = 0x0, // No logging 272 | APPLE80211_DEBUG_FLAG_INFORMATIVE = 0x1, // Log "interesting" events 273 | APPLE80211_DEBUG_FLAG_ERROR = 0x2, // Log errors 274 | APPLE80211_DEBUG_FLAG_RSN = 0x4, // Full RSN supplicant logging 275 | APPLE80211_DEBUG_FLAG_SCAN = 0x8, // Scan events and information 276 | }; 277 | 278 | enum apple80211_guard_interval 279 | { 280 | APPLE80211_GI_SHORT = 400, // ns 281 | APPLE80211_GI_LONG = 800, // ns 282 | }; 283 | 284 | #define APPLE80211_RSC_LEN 8 285 | #define APPLE80211_KEY_BUFF_LEN 32 286 | 287 | #define APPLE80211_KEY_FLAG_UNICAST 0x1 288 | #define APPLE80211_KEY_FLAG_MULTICAST 0x2 289 | #define APPLE80211_KEY_FLAG_TX 0x4 290 | #define APPLE80211_KEY_FLAG_RX 0x8 291 | 292 | struct apple80211_key 293 | { 294 | u_int32_t version; 295 | u_int32_t key_len; 296 | u_int32_t key_cipher_type; // apple80211_cipher_type 297 | u_int16_t key_flags; 298 | u_int16_t key_index; 299 | u_int8_t key[ APPLE80211_KEY_BUFF_LEN ]; 300 | u_int32_t key_rsc_len; 301 | u_int8_t key_rsc[ APPLE80211_RSC_LEN ]; // receive sequence counter 302 | struct ether_addr key_ea; // key applies to this bssid 303 | }; 304 | 305 | // Changing this affects any structure that contains a channel 306 | struct apple80211_channel 307 | { 308 | u_int32_t version; 309 | u_int32_t channel; // channel number 310 | u_int32_t flags; // apple80211_channel_flag vector 311 | }; 312 | 313 | struct apple80211_rate 314 | { 315 | u_int32_t version; 316 | u_int32_t rate; // rate mbps 317 | u_int32_t flags; // apple80211_rate_flag vector 318 | }; 319 | 320 | // Probe response capability flags, IEEE 7.3.1.4 321 | #define APPLE80211_CAPINFO_ESS 0x0001 322 | #define APPLE80211_CAPINFO_IBSS 0x0002 323 | #define APPLE80211_CAPINFO_CF_POLLABLE 0x0004 324 | #define APPLE80211_CAPINFO_CF_POLLREQ 0x0008 325 | #define APPLE80211_CAPINFO_PRIVACY 0x0010 326 | #define APPLE80211_CAPINFO_SHORT_PREAMBLE 0x0020 327 | #define APPLE80211_CAPINFO_PBCC 0x0040 328 | #define APPLE80211_CAPINFO_AGILITY 0x0080 329 | // 0x0100, 0x0200 reserved 330 | #define APPLE80211_CAPINFO_SHORT_SLOT_TIME 0x0400 331 | // 0x0800, 0x1000 reserved 332 | #define APPLE80211_CAPINFO_DSSS_OFDM 0X2000 333 | // 0x4000, 0x8000 reserved 334 | 335 | // Reason codes IEEE 7.3.1.7 336 | #define APPLE80211_REASON_UNSPECIFIED 1 337 | #define APPLE80211_REASON_PREV_AUTH_EXPIRED 2 338 | #define APPLE80211_REASON_AUTH_LEAVING 3 339 | #define APPLE80211_REASON_INACTIVE 4 340 | #define APPLE80211_REASON_AP_OVERLOAD 5 341 | #define APPLE80211_REASON_NOT_AUTHED 6 342 | #define APPLE80211_REASON_NOT_ASSOCED 7 343 | #define APPLE80211_REASON_ASSOC_LEAVING 8 344 | #define APPLE80211_REASON_ASSOC_NOT_AUTHED 9 345 | #define APPLE80211_REASON_POWER_CAP 10 346 | #define APPLE80211_REASON_SUPPORTED_CHANS 11 347 | 348 | #define APPLE80211_REASON_INVALID_IE 13 349 | #define APPLE80211_REASON_MIC_FAILURE 14 350 | #define APPLE80211_REASON_4_WAY_TIMEOUT 15 351 | #define APPLE80211_REASON_GROUP_KEY_TIMEOUT 16 352 | #define APPLE80211_REASON_DIFF_IE 17 353 | #define APPLE80211_REASON_INVALID_GROUP_KEY 18 354 | #define APPLE80211_REASON_INVALID_PAIR_KEY 19 355 | #define APPLE80211_REASON_INVALID_AKMP 20 356 | #define APPLE80211_REASON_UNSUPP_RSN_VER 21 357 | #define APPLE80211_REASON_INVALID_RSN_CAPS 22 358 | #define APPLE80211_REASON_8021X_AUTH_FAILED 23 359 | 360 | // Status codes IEEE 7.3.1.9 361 | #define APPLE80211_STATUS_SUCCESS 0 362 | #define APPLE80211_STATUS_UNSPECIFIED_FAILURE 1 363 | // 2-9 reserved 364 | #define APPLE80211_STATUS_UNSUPPORTED_CAPABILITIES 10 365 | #define APPLE80211_STATUS_REASSOCIATION_DENIED 11 366 | #define APPLE80211_STATUS_ASSOCIATION_DENIED 12 367 | #define APPLE80211_STATUS_AUTH_ALG_UNSUPPORTED 13 368 | #define APPLE80211_STATUS_INVALID_AUTH_SEQ_NUM 14 369 | #define APPLE80211_STATUS_CHALLENGE_FAILURE 15 370 | #define APPLE80211_STATUS_TIMEOUT 16 371 | #define APPLE80211_STATUS_AP_FULL 17 372 | #define APPLE80211_STATUS_UNSUPPORTED_RATE_SET 18 373 | // 22-24 reserved 374 | #define APPLE80211_STATUS_SHORT_SLOT_UNSUPPORTED 25 375 | #define APPLE80211_STATUS_DSSS_OFDM_UNSUPPORTED 26 376 | // 27-39 reserved 377 | #define APPLE80211_STATUS_INVALID_IE 40 378 | #define APPLE80211_STATUS_INVALID_GROUP_CIPHER 41 379 | #define APPLE80211_STATUS_INVALID_PAIRWISE_CIPHER 42 380 | #define APPLE80211_STATUS_INVALID_AKMP 43 381 | #define APPLE80211_STATUS_UNSUPPORTED_RSN_VERSION 44 382 | #define APPLE80211_STATUS_INVALID_RSN_CAPABILITIES 45 383 | #define APPLE80211_STATUS_CIPHER_SUITE_REJECTED 46 384 | // 47 - 65535 reserved 385 | #define APPLE80211_STATUS_UNAVAILABLE 0xffff 386 | 387 | // If mcs index is set to APPLE80211_MCS_INDEX_AUTO, the interface 388 | // should go to auto rate selection, and abandon any previously 389 | // configured static MCS indices 390 | #define APPLE80211_MCS_INDEX_AUTO 0xffffffff 391 | 392 | /* 393 | DSCP TOS/Traffic class values for WME access categories taken from 394 | WiFi WMM Test Plan v 1.3.1 Appendix C. 395 | 396 | TOS/Traffic class field looks like: 397 | 398 | 0 1 2 3 4 5 6 7 399 | +---+---+---+---+---+---+---+---+ 400 | | DSCP | ECN | 401 | +---+---+---+---+---+---+---+---+ 402 | 403 | These bits are numbered according to rfc 2474, but might be misleading. 404 | It looks like bit 0 is actually the high order bit. 405 | */ 406 | 407 | #define APPLE80211_DSCP_WME_BE 0x00 408 | #define APPLE80211_DSCP_WME_BK 0x08 409 | #define APPLE80211_DSCP_WME_VI 0x28 410 | #define APPLE80211_DSCP_WME_VO 0x38 411 | 412 | // Access category values set in the mbuf 413 | #define APPLE80211_WME_AC_BE 0 414 | #define APPLE80211_WME_AC_BK 1 415 | #define APPLE80211_WME_AC_VI 2 416 | #define APPLE80211_WME_AC_VO 3 417 | 418 | // Working within the limitations of the kpi mbuf routines, the receive interface pointer 419 | // is the best place to put this for now since it is not used on the output path. The mbuf 420 | // kpi doesn't allow us to access unused flags, or I would put the WME AC in there like 421 | // everyone else. 422 | 423 | #define APPLE80211_MBUF_SET_WME_AC( m, ac ) mbuf_pkthdr_setrcvif( m, (ifnet_t)ac ) 424 | #define APPLE80211_MBUF_WME_AC( m ) (int)mbuf_pkthdr_rcvif( m ) 425 | 426 | struct apple80211_scan_result 427 | { 428 | u_int32_t version; // 0x00 - 0x03 429 | struct apple80211_channel asr_channel; // 0x04 - 0x0f 430 | 431 | int16_t asr_unk; // 0x10 - 0x11 432 | 433 | int16_t asr_noise; // 0x12 - 0x13 434 | int16_t asr_snr; // 0x14 - 0x15 435 | int16_t asr_rssi; // 0x16 - 0x17 436 | u_int16_t asr_beacon_int; // 0x18 - 0x19 437 | 438 | u_int16_t asr_cap; // capabilities // 0x1a 0x1b 439 | 440 | u_int8_t asr_bssid[ APPLE80211_ADDR_LEN ]; // 0x1c 0x1d 0x1e 0x1f 0x20 0x21 441 | u_int8_t asr_nrates; // 0x22 442 | u_int8_t asr_nr_unk; // 0x23 443 | u_int32_t asr_rates[ APPLE80211_MAX_RATES ]; // 0x24 - 0x5f 444 | u_int8_t asr_ssid_len; // 0x60 445 | u_int8_t asr_ssid[ APPLE80211_MAX_SSID_LEN ]; // 0x61 - 0x80 446 | u_int16_t unk; 447 | uint8_t unk2; 448 | u_int32_t asr_age; // (ms) non-zero for cached scan result // 0x84 449 | 450 | u_int16_t asr_ie_len; 451 | void *asr_ie_data; 452 | }; 453 | 454 | struct apple80211_network_data 455 | { 456 | u_int32_t version; 457 | u_int16_t nd_mode; // apple80211_apmode 458 | u_int16_t nd_auth_lower; // apple80211_authtype_lower 459 | u_int16_t nd_auth_upper; // apple80211_authtype_upper 460 | struct apple80211_channel nd_channel; 461 | u_int32_t nd_ssid_len; 462 | u_int8_t nd_ssid[ APPLE80211_MAX_SSID_LEN ]; 463 | struct apple80211_key nd_key; 464 | u_int32_t nd_ie_len; 465 | void *nd_ie_data; 466 | }; 467 | 468 | #define APPLE80211_NETWORK_DATA_MAX_IE_LEN 1024 469 | 470 | // As hostap support improves, this will grow 471 | struct apple80211_station 472 | { 473 | u_int32_t version; 474 | struct ether_addr sta_mac; 475 | int32_t sta_rssi; 476 | }; 477 | 478 | // WOW structures and defines 479 | 480 | struct apple80211_wow_pattern 481 | { 482 | size_t len; 483 | u_int8_t * pattern; 484 | }; 485 | 486 | enum apple80211_wake_condition 487 | { 488 | APPLE80211_WAKE_COND_MAGIC_PATTERN = 0, 489 | APPLE80211_WAKE_COND_NET_PATTERN = 1, 490 | APPLE80211_WAKE_COND_DISASSOCIATED = 2, 491 | APPLE80211_WAKE_COND_DEAUTHED = 3, 492 | APPLE80211_WAKE_COND_RETROGRADE_TSF = 4, 493 | APPLE80211_WAKE_COND_BEACON_LOSS = 5, 494 | }; 495 | 496 | #define APPLE80211_MAX_WAKE_COND 5 497 | 498 | enum apple80211_card_capability 499 | { 500 | APPLE80211_CAP_WEP = 0, // CAPABILITY: WEP available 501 | APPLE80211_CAP_TKIP = 1, // CAPABILITY: TKIP available 502 | APPLE80211_CAP_AES = 2, // CAPABILITY: AES OCB avail 503 | APPLE80211_CAP_AES_CCM = 3, // CAPABILITY: AES CCM avail 504 | APPLE80211_CAP_CKIP = 4, // CAPABILITY: CKIP available 505 | APPLE80211_CAP_IBSS = 5, // CAPABILITY: IBSS available 506 | APPLE80211_CAP_PMGT = 6, // CAPABILITY: Power mgmt 507 | APPLE80211_CAP_HOSTAP = 7, // CAPABILITY: HOSTAP avail 508 | APPLE80211_CAP_TXPMGT = 8, // CAPABILITY: tx power mgmt 509 | APPLE80211_CAP_SHSLOT = 9, // CAPABILITY: short slottime 510 | APPLE80211_CAP_SHPREAMBLE = 10, // CAPABILITY: short preamble 511 | APPLE80211_CAP_MONITOR = 11, // CAPABILITY: monitor mode 512 | APPLE80211_CAP_TKIPMIC = 12, // CAPABILITY: TKIP MIC avail 513 | APPLE80211_CAP_WPA1 = 13, // CAPABILITY: WPA1 avail 514 | APPLE80211_CAP_WPA2 = 14, // CAPABILITY: WPA2 avail 515 | APPLE80211_CAP_WPA = 15, // CAPABILITY: WPA1+WPA2 avail 516 | APPLE80211_CAP_BURST = 16, // CAPABILITY: frame bursting 517 | APPLE80211_CAP_WME = 17, // CAPABILITY: WME avail 518 | APPLE80211_CAP_SHORT_GI_40MHZ = 18, // CAPABILITY: Short guard interval in 40 MHz 519 | APPLE80211_CAP_SHORT_GI_20MHZ = 19, // CAPABILITY: Short guard interval in 20 MHz 520 | APPLE80211_CAP_WOW = 20, // CAPABILITY: Wake on wireless 521 | APPLE80211_CAP_TSN = 21, // CAPABILITY: WPA with WEP group key 522 | }; 523 | #define APPLE80211_CAP_MAX 21 524 | 525 | enum apple80211_assoc_flags { 526 | APPLE80211_ASSOC_F_CLOSED = 1, // flag: scan was directed, needed to remember closed networks 527 | }; 528 | 529 | // Kernel messages 530 | 531 | struct apple80211_status_msg_hdr 532 | { 533 | u_int32_t msg_type; // type of message 534 | u_int32_t msg_len; // length of data (not including msg_type and msg_len) 535 | 536 | // data follows 537 | }; 538 | 539 | #define APPLE80211_M_MAX_LEN 2048 540 | 541 | #define APPLE80211_M_POWER_CHANGED 1 542 | #define APPLE80211_M_SSID_CHANGED 2 543 | #define APPLE80211_M_BSSID_CHANGED 3 544 | #define APPLE80211_M_LINK_CHANGED 4 545 | #define APPLE80211_M_MIC_ERROR_UCAST 5 546 | #define APPLE80211_M_MIC_ERROR_MCAST 6 547 | #define APPLE80211_M_INT_MIT_CHANGED 7 548 | #define APPLE80211_M_MODE_CHANGED 8 549 | #define APPLE80211_M_ASSOC_DONE 9 550 | #define APPLE80211_M_SCAN_DONE 10 551 | #define APPLE80211_M_COUNTRY_CODE_CHANGED 11 552 | #define APPLE80211_M_STA_ARRIVE 12 553 | #define APPLE80211_M_STA_LEAVE 13 554 | 555 | #define APPLE80211_M_MAX 13 556 | #define APPLE80211_M_BUFF_SIZE APPLE80211_MAP_SIZE( APPLE80211_M_MAX ) 557 | 558 | // Registry Information 559 | #define APPLE80211_REGKEY_HARDWARE_VERSION "IO80211HardwareVersion" 560 | //#define APPLE80211_REG_FIRMWARE_VERSION "IO80211FirmwareVersion" 561 | #define APPLE80211_REGKEY_DRIVER_VERSION "IO80211DriverVersion" 562 | #define APPLE80211_REGKEY_LOCALE "IO80211Locale" 563 | #define APPLE80211_REGKEY_SSID "IO80211SSID" 564 | #define APPLE80211_REGKEY_CHANNEL "IO80211Channel" 565 | #define APPLE80211_REGKEY_EXT_CHANNEL "IO80211ExtensionChannel" 566 | #define APPLE80211_REGKEY_BAND "IO80211Band" 567 | #define APPLE80211_BAND_2GHZ "2 GHz" 568 | #define APPLE80211_BAND_5GHZ "5 GHz" 569 | #define APPLE80211_REGKEY_COUNTRY_CODE "IO80211CountryCode" 570 | 571 | // Userland messages 572 | #define APPLE80211_M_RSN_AUTH_SUCCESS 254 573 | #define APPLE80211_M_RSN_AUTH_SUCCESS_TEMPLATE "com.apple.rsn.%s.auth.success" // string is interface name 574 | 575 | #define APPLE80211_M_RSN_AUTH_TIMEOUT 255 576 | #define APPLE80211_M_RSN_AUTH_TIMEOUT_TEMPLATE "com.apple.rsn.%s.auth.timeout" // string is interface name 577 | 578 | #define APPLE80211_M_RSN_MSG_MAX 2 579 | 580 | #endif // _APPLE80211_VAR_H_ 581 | 582 | -------------------------------------------------------------------------------- /Black80211/apple80211/catalina/apple80211_ioctl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. 3 | * 4 | * @APPLE_LICENSE_HEADER_START@ 5 | * 6 | * The contents of this file constitute Original Code as defined in and 7 | * are subject to the Apple Public Source License Version 1.1 (the 8 | * "License"). You may not use this file except in compliance with the 9 | * License. Please obtain a copy of the License at 10 | * http://www.apple.com/publicsource and read it before using this file. 11 | * 12 | * This Original Code and all software distributed under the License are 13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER 14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the 17 | * License for the specific language governing rights and limitations 18 | * under the License. 19 | * 20 | * @APPLE_LICENSE_HEADER_END@ 21 | */ 22 | #ifndef _APPLE80211_IOCTL_H_ 23 | #define _APPLE80211_IOCTL_H_ 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include "apple80211_var.h" 32 | 33 | struct apple80211req 34 | { 35 | char req_if_name[IFNAMSIZ]; // 16 bytes 36 | int req_type; // 4 bytes 37 | int req_val; // 4 bytes 38 | u_int32_t req_len; // 4 bytes 39 | void *req_data; // 4 bytes 40 | }; 41 | 42 | #define SIOCSA80211 2150656456 43 | #define SIOCGA80211 3224398281 44 | 45 | // req_type 46 | 47 | 48 | #define APPLE80211_IOC_SSID 1 // req_type 49 | 50 | #define APPLE80211_IOC_AUTH_TYPE 2 // req_type 51 | #define APPLE80211_AUTH_TYPE_UNICAST 1 // req_val, SIOCGA80211 only 52 | #define APPLE80211_AUTH_TYPE_MULTICAST 2 // req_val, SIOCGA80211 only 53 | 54 | #define APPLE80211_IOC_CIPHER_KEY 3 // req_type 55 | #define APPLE80211_CIPHER_KEY_UNICAST 1 // req_val 56 | #define APPLE80211_CIPHER_KEY_MULICAST 2 // req_val 57 | 58 | #define APPLE80211_IOC_CHANNEL 4 // req_type 59 | 60 | #define APPLE80211_IOC_POWERSAVE 5 // req_type 61 | 62 | #define APPLE80211_IOC_PROTMODE 6 // req_type 63 | 64 | #define APPLE80211_IOC_TXPOWER 7 // req_type 65 | #define APPLE80211_IOC_RATE 8 // req_type 66 | #define APPLE80211_IOC_BSSID 9 // req_type 67 | 68 | #define APPLE80211_IOC_SCAN_REQ 10 // req_type 69 | 70 | #define APPLE80211_IOC_SCAN_RESULT 11 // req_type 71 | 72 | #define APPLE80211_IOC_CARD_CAPABILITIES 12 // req_type 73 | 74 | #define APPLE80211_IOC_STATE 13 // req_type (apple80211_state) 75 | #define APPLE80211_IOC_PHY_MODE 14 // req_type (apple80211_phymode) 76 | 77 | #define APPLE80211_IOC_OP_MODE 15 // req_type (apple80211_opmode) 78 | #define APPLE80211_IOC_RSSI 16 // req_type 79 | #define APPLE80211_IOC_NOISE 17 // req_type 80 | 81 | #define APPLE80211_IOC_INT_MIT 18 82 | #define APPLE80211_IOC_INT_MIT_OFF 1 // req_val 83 | #define APPLE80211_IOC_INT_MIT_ON 2 // req_val 84 | 85 | // card power 86 | #define APPLE80211_IOC_POWER 19 // req_type 87 | 88 | #define APPLE80211_IOC_ASSOCIATE 20 // req_type 89 | #define APPLE80211_IOC_ASSOCIATE_RESULT 21 // req_type 90 | #define APPLE80211_IOC_DISASSOCIATE 22 // req_type 91 | #define APPLE80211_IOC_STATUS_DEV_NAME 23 // req_type 92 | 93 | #define APPLE80211_IOC_IBSS_MODE 24 // req_type 94 | #define APPLE80211_IOC_IBSS_MODE_START 1 // req_val 95 | #define APPLE80211_IOC_IBSS_MODE_STOP 2 // req_val 96 | 97 | #define APPLE80211_IOC_HOST_AP_MODE 25 // req_type 98 | #define APPLE80211_IOC_HOST_AP_MODE_START 1 // req_val 99 | #define APPLE80211_IOC_HOST_AP_MODE_STOP 2 // req_val 100 | 101 | #define APPLE80211_IOC_AP_MODE 26 // req_type (apple80211_apmode) 102 | #define APPLE80211_IOC_SUPPORTED_CHANNELS 27 // req_type 103 | #define APPLE80211_IOC_LOCALE 28 // req_type 104 | #define APPLE80211_IOC_DEAUTH 29 // req_type 105 | #define APPLE80211_IOC_COUNTERMEASURES 30 // req_type 106 | #define APPLE80211_IOC_FRAG_THRESHOLD 31 // req_type 107 | #define APPLE80211_IOC_RATE_SET 32 // req_type 108 | #define APPLE80211_IOC_SHORT_SLOT 33 // req_type 109 | #define APPLE80211_IOC_MULTICAST_RATE 34 // req_type 110 | #define APPLE80211_IOC_SHORT_RETRY_LIMIT 35 // req_type 111 | #define APPLE80211_IOC_LONG_RETRY_LIMIT 36 // req_type 112 | #define APPLE80211_IOC_TX_ANTENNA 37 // req_type 113 | #define APPLE80211_IOC_RX_ANTENNA 38 // req_type 114 | #define APPLE80211_IOC_ANTENNA_DIVERSITY 39 // req_type 115 | #define APPLE80211_IOC_ROM 40 // req_type 116 | #define APPLE80211_IOC_DTIM_INT 41 // req_type 117 | #define APPLE80211_IOC_STATION_LIST 42 // req_type 118 | #define APPLE80211_IOC_DRIVER_VERSION 43 // req_type 119 | #define APPLE80211_IOC_HARDWARE_VERSION 44 // req_type 120 | #define APPLE80211_IOC_RAND 45 // req_type 121 | #define APPLE80211_IOC_RSN_IE 46 // req_type 122 | #define APPLE80211_IOC_BACKGROUND_SCAN 47 // req_type 123 | #define APPLE80211_IOC_AP_IE_LIST 48 // req_type 124 | #define APPLE80211_IOC_STATS 49 // req_type 125 | #define APPLE80211_IOC_ASSOCIATION_STATUS 50 // req_type 126 | #define APPLE80211_IOC_COUNTRY_CODE 51 // req_type 127 | #define APPLE80211_IOC_DEBUG_FLAGS 52 // req_type 128 | #define APPLE80211_IOC_LAST_RX_PKT_DATA 53 // req_type 129 | #define APPLE80211_IOC_RADIO_INFO 54 // req_type 130 | #define APPLE80211_IOC_GUARD_INTERVAL 55 // req_type 131 | #define APPLE80211_IOC_MIMO_POWERSAVE 56 // req_type 132 | #define APPLE80211_IOC_MCS 57 // req_type 133 | #define APPLE80211_IOC_RIFS 58 // req_type 134 | #define APPLE80211_IOC_LDPC 59 // req_type 135 | #define APPLE80211_IOC_MSDU 60 // req_type 136 | #define APPLE80211_IOC_MPDU 61 // req_type 137 | #define APPLE80211_IOC_BLOCK_ACK 62 // req_type 138 | #define APPLE80211_IOC_PLS 63 // req_type 139 | #define APPLE80211_IOC_PSMP 64 // req_type 140 | #define APPLE80211_IOC_PHY_SUB_MODE 65 // req_type 141 | #define APPLE80211_IOC_MCS_INDEX_SET 66 // req_type 142 | #define APPLE80211_IOC_CACHE_THRESH_BCAST 67 // req_type 143 | #define APPLE80211_IOC_CACHE_THRESH_DIRECT 68 // req_type 144 | #define APPLE80211_IOC_WOW_PARAMETERS 69 // req_type 145 | #define APPLE80211_IOC_WOW_ENABLED 70 // req_type 146 | #define APPLE80211_IOC_40MHZ_INTOLERANT 71 // req_type 147 | 148 | #define APPLE80211_IOC_PID_LOCK 72 149 | #define APPLE80211_IOC_STA_IE_LIST 73 150 | #define APPLE80211_IOC_STA_AUTHORIZE 74 151 | #define APPLE80211_IOC_STA_DISASSOCIATE 75 152 | #define APPLE80211_IOC_STA_DEAUTH 76 153 | #define APPLE80211_IOC_RSN_CONF 77 154 | #define APPLE80211_IOC_KEY_RSC 78 155 | #define APPLE80211_IOC_STA_STATS 79 156 | #define APPLE80211_IOC_ROAM_THRESH 80 157 | #define APPLE80211_IOC_VENDOR_DBG_FLAGS 81 158 | #define APPLE80211_IOC_CACHE_AGE_THRESH 82 159 | #define APPLE80211_IOC_PMK_CACHE 83 160 | #define APPLE80211_IOC_LINK_QUAL_EVENT_PARAMS 84 161 | #define APPLE80211_IOC_IE 85 162 | #define APPLE80211_IOC_SCAN_REQ_MULTIPLE 86 163 | #define APPLE80211_IOC_BTCOEX_MODE 87 164 | #define APPLE80211_IOC_WOW_TEST 88 165 | #define APPLE80211_IOC_CLEAR_PMK_CACHE 89 166 | #define APPLE80211_IOC_SCANCACHE_CLEAR 90 167 | #define APPLE80211_IOC_P2P_ENABLE 91 168 | #define APPLE80211_IOC_P2P_LISTEN 92 169 | #define APPLE80211_IOC_P2P_SCAN 93 170 | #define APPLE80211_IOC_VIRTUAL_IF_CREATE 94 171 | #define APPLE80211_IOC_VIRTUAL_IF_DELETE 95 172 | #define APPLE80211_IOC_VIRTUAL_IF_ROLE 96 173 | #define APPLE80211_IOC_VIRTUAL_IF_PARENT 97 174 | #define APPLE80211_IOC_P2P_GO_CONF 98 175 | #define APPLE80211_IOC_P2P_NOA_LIST 99 176 | #define APPLE80211_IOC_P2P_OPP_PS 100 177 | #define APPLE80211_IOC_P2P_CT_WINDOW 101 178 | #define APPLE80211_IOC_BT_COEX_FLAGS 102 179 | #define APPLE80211_IOC_CURRENT_NETWORK 103 180 | #define APPLE80211_IOC_BT_POWER 104 181 | #define APPLE80211_IOC_AVAILABILITY 105 182 | #define APPLE80211_IOC_RSSI_BOUNDS 106 183 | #define APPLE80211_IOC_ROAM 107 184 | #define APPLE80211_IOC_TX_CHAIN_POWER 108 185 | #define APPLE80211_IOC_CDD_MODE 109 186 | #define APPLE80211_IOC_LAST_BCAST_SCAN_TIME 110 187 | #define APPLE80211_IOC_THERMAL_THROTTLING 111 188 | #define APPLE80211_IOC_FACTORY_MODE 112 189 | #define APPLE80211_IOC_REASSOCIATE 113 190 | 191 | #define APPLE80211_IOC_POWER_DEBUG_INFO 115 192 | #define APPLE80211_IOC_AWDL_SYNC_PARAMS 116 193 | #define APPLE80211_IOC_AWDL_SYNC_ENABLED 117 194 | #define APPLE80211_IOC_AWDL_EXTENSION_STATE_MACHINE_PARAMETERS 118 195 | #define APPLE80211_IOC_AWDL_SERVICE_PARAMS 119 196 | #define APPLE80211_IOC_AWDL_PEER_SERVICE_REQUEST 120 197 | #define APPLE80211_IOC_AWDL_ELECTION_ALGORITHM_ENABLED 121 198 | #define APPLE80211_IOC_AWDL_ELECTION_ID 122 199 | #define APPLE80211_IOC_AWDL_MAX_TREE_DEPTH 123 200 | #define APPLE80211_IOC_AWDL_GUARD_TIME 124 201 | #define APPLE80211_IOC_AWDL_BSSID 125 202 | #define APPLE80211_IOC_AWDL_ELECTION_METRIC 126 203 | #define APPLE80211_IOC_AWDL_AVAILABILITY_WINDOW_AP_ALIGNMENT 127 204 | #define APPLE80211_IOC_AWDL_SYNC_FRAME_AP_BEACON_ALIGNMENT 128 205 | #define APPLE80211_IOC_AWDL_SYNCHRONIZATION_CHANNEL_SEQUENCE 129 206 | #define APPLE80211_IOC_PEER_CACHE_MAXIMUM_SIZE 130 207 | #define APPLE80211_IOC_AWDL_OUI 131 208 | #define APPLE80211_IOC_AWDL_MASTER_CHANNEL 132 209 | #define APPLE80211_IOC_AWDL_TOP_MASTER 133 210 | #define APPLE80211_IOC_AWDL_SYNC_STATE 134 211 | #define APPLE80211_IOC_AWDL_ELECTION_RSSI_THRESHOLDS 135 212 | #define APPLE80211_IOC_AWDL_PRESENCE_MODE 136 213 | #define APPLE80211_IOC_AWDL_ELECTION_MASTER_COUNTS 137 214 | #define APPLE80211_IOC_AWDL_PERIODIC_SYNC_FRAME_PACKET_LIFETIME 138 215 | #define APPLE80211_IOC_AWDL_MASTER_MODE_SYNC_FRAME_PERIOD 139 216 | #define APPLE80211_IOC_AWDL_NON_ELECTION_MASTER_MODE_SYNC_FRAME_PERIOD 140 217 | #define APPLE80211_IOC_AWDL_EXPLICIT_AVAILABILITY_WINDOW_EXTENSION_OPT_OUT 141 218 | #define APPLE80211_IOC_AWDL_GET_AWDL_MASTER_DATABASE 142 219 | #define APPLE80211_IOC_PEER_CACHE_CONTROL 143 220 | #define APPLE80211_IOC_AWDL_BATTERY_LEVEL 144 221 | #define APPLE80211_IOC_AWDL_BT_COEX_AW_PROTECTED_PERIOD_LENGTH 145 222 | #define APPLE80211_IOC_AWDL_BT_COEX_AGREEMENT 146 223 | #define APPLE80211_IOC_AWDL_BT_COEX_AGREEMENT_ENABLED 147 224 | #define APPLE80211_IOC_AWDL_STRATEGY 148 225 | #define APPLE80211_IOC_AWDL_OOB_REQUEST 149 226 | #define APPLE80211_IOC_AWDL_MAX_NO_MASTER_PERIODS 150 227 | #define APPLE80211_IOC_AWDL_SYNC_FRAME_TEMPLATE 151 228 | #define APPLE80211_IOC_LOG_FLAGS 152 229 | #define APPLE80211_IOC_PEER_STATS 153 230 | #define APPLE80211_IOC_HT_CAPABILITY 154 231 | #define APPLE80211_IOC_AWDL_ELECTION_PARAMS 155 232 | #define APPLE80211_IOC_LINK_CHANGED_EVENT_DATA 156 233 | #define APPLE80211_IOC_GET_DEBUG_INFO 157 234 | #define APPLE80211_IOC_AWDL_DEVICE_CAPABILITIES 158 235 | #define APPLE80211_IOC_AWDL_RSSI_MEASUREMENT_REQUEST 159 236 | #define APPLE80211_IOC_AWDL_AES_KEY 160 237 | #define APPLE80211_IOC_AWDL_SCAN_RESERVED_TIME 161 238 | #define APPLE80211_IOC_AWDL_CTL 162 239 | #define APPLE80211_IOC_AWDL_SOCIAL_TIME_SLOTS 163 240 | #define APPLE80211_IOC_AWDL_PEER_TRAFFIC_REGISTRATION 164 241 | #define APPLE80211_IOC_EXTENDED_STATS 165 242 | #define APPLE80211_IOC_BEACON_PERIOD 166 243 | #define APPLE80211_IOC_AWDL_FORCED_ROAM_CONFIG 167 244 | #define APPLE80211_IOC_AWDL_QUIET 168 245 | #define APPLE80211_IOC_ACL_POLICY 169 246 | #define APPLE80211_IOC_ACL_ADD 170 247 | #define APPLE80211_IOC_ACL_REMOVE 171 248 | #define APPLE80211_IOC_ACL_FLUSH 172 249 | #define APPLE80211_IOC_ACL_LIST 173 250 | #define APPLE80211_IOC_CHAIN_ACK 174 251 | #define APPLE80211_IOC_DESENSE 175 252 | #define APPLE80211_IOC_OFFLOAD_SCANNING 176 253 | #define APPLE80211_IOC_OFFLOAD_RSN 177 254 | #define APPLE80211_IOC_OFFLOAD_COUNTRY_CODE 178 255 | #define APPLE80211_IOC_OFFLOAD_KEEPALIVE_L2 179 256 | #define APPLE80211_IOC_OFFLOAD_ARP_NDP 180 257 | #define APPLE80211_IOC_VHT_MCS_INDEX_SET 181 258 | #define APPLE80211_IOC_DWDS 182 259 | #define APPLE80211_IOC_INTERRUPT_STATS 183 260 | #define APPLE80211_IOC_INTERRUPT_STATS_RESET 184 261 | #define APPLE80211_IOC_TIMER_STATS 185 262 | #define APPLE80211_IOC_TIMER_STATS_RESET 186 263 | #define APPLE80211_IOC_OFFLOAD_STATS 187 264 | #define APPLE80211_IOC_OFFLOAD_STATS_RESET 188 265 | #define APPLE80211_IOC_OFFLOAD_BEACONS 189 266 | #define APPLE80211_IOC_ROAMING 190 267 | #define APPLE80211_IOC_OFFLOAD_ARP 191 268 | #define APPLE80211_IOC_OFFLOAD_NDP 192 269 | #define APPLE80211_IOC_OFFLOAD_SCAN 193 270 | #define APPLE80211_IOC_DESENSE_LEVEL 194 271 | #define APPLE80211_IOC_MCS_VHT 195 272 | #define APPLE80211_IOC_TX_NSS 196 273 | #define APPLE80211_IOC_GAS_REQ 197 274 | #define APPLE80211_IOC_GAS_START 198 275 | #define APPLE80211_IOC_GAS_SET_PEER 199 276 | #define APPLE80211_IOC_GAS_RESULTS 200 277 | #define APPLE80211_IOC_AWDL_BTLE_PEER_INDICATION 201 278 | #define APPLE80211_IOC_AWDL_BTLE_STATE_PARAMS 202 279 | #define APPLE80211_IOC_AWDL_PEER_DATABASE 203 280 | #define APPLE80211_IOC_AWDL_BTLE_ENABLE_SYNC_WITH_PARAMS 204 281 | #define APPLE80211_IOC_AWDL_SECONDARY_MASTER_CHANNEL 205 282 | #define APPLE80211_IOC_PHY_STATS 206 283 | #define APPLE80211_IOC_CHANNELS_INFO 207 284 | #define APPLE80211_IOC_AWDL_AF_TX_MODE 208 285 | #define APPLE80211_IOC_ERROR_STRING 209 286 | #define APPLE80211_IOC_ERROR_NO 210 287 | #define APPLE80211_IOC_AWDL_PIGGYBACK_SCAN_REQ 211 288 | #define APPLE80211_IOC_AWDL_PRIVATE_ELECTION_ID 212 289 | #define APPLE80211_IOC_AWDL_MIN_RATE 213 290 | #define APPLE80211_IOC_VHT_CAPABILITY 214 291 | #define APPLE80211_IOC_BGSCAN_CACHE_RESULTS 215 292 | #define APPLE80211_IOC_ROAM_PROFILE 216 293 | #define APPLE80211_IOC_AWDL_OPER_MODE 217 294 | #define APPLE80211_IOC_RESTORE_DEFAULTS 218 295 | #define APPLE80211_IOC_AWDL_ENCRYPTION_KEYS 219 296 | #define APPLE80211_IOC_AWDL_ENCRYPTION_TYPE 220 297 | #define APPLE80211_IOC_BTCOEX_PROFILES 221 298 | #define APPLE80211_IOC_BTCOEX_CONFIG 222 299 | #define APPLE80211_IOC_AWDL_STATISTICS 223 300 | #define APPLE80211_IOC_AWDL_ENABLE_ROAMING 224 301 | #define APPLE80211_IOC_AWDL_OOB_AUTO_REQUEST 225 302 | #define APPLE80211_IOC_AWDL_TXCAL_PERIOD 226 303 | #define APPLE80211_IOC_CHIP_COUNTER_STATS 227 304 | #define APPLE80211_IOC_DBG_GUARD_TIME_PARAMS 228 305 | #define APPLE80211_IOC_AWDL_AWDL_ADVERTISERS 229 306 | #define APPLE80211_IOC_LEAKY_AP_STATS_MODE 230 307 | #define APPLE80211_IOC_CAPTURE 231 308 | #define APPLE80211_IOC_LEAKY_AP_STATS 232 309 | #define APPLE80211_IOC_AWDL_BLOCK_SET_COMMANDS 233 310 | #define APPLE80211_IOC_LEAKY_AP_AWD_MODE 234 311 | #define APPLE80211_IOC_BTCOEX_OPTIONS 235 312 | #define APPLE80211_IOC_FORCE_SYNC_TO_PEER 236 313 | #define APPLE80211_IOC_COUNTRY_CHANNELS 237 314 | #define APPLE80211_IOC_PRIVATE_MAC 238 315 | #define APPLE80211_IOC_RESET_CHIP 239 316 | #define APPLE80211_IOC_CRASH 240 317 | #define APPLE80211_IOC_RANGING_ENABLE 241 318 | #define APPLE80211_IOC_RANGING_START 242 319 | #define APPLE80211_IOC_RANGING_AUTHENTICATE 243 320 | #define APPLE80211_IOC_AWDL_PREFERRED_CHANNELS 244 321 | #define APPLE80211_IOC_LEAKY_AP_SSID_STATS 245 322 | #define APPLE80211_IOC_AWDL_RSDB_CAPS 246 323 | #define APPLE80211_IOC_AWDL_DEV_STATS 247 324 | #define APPLE80211_IOC_LAST_ASSOC_HISTORY 248 325 | #define APPLE80211_IOC_AWDL_COMMON_CHANNEL 249 326 | #define APPLE80211_IOC_AWDL_PEERS_INFO 250 327 | #define APPLE80211_IOC_TKO_PARAMS 251 328 | #define APPLE80211_IOC_TKO_DUMP 252 329 | #define APPLE80211_IOC_AWDL_NEARBY_LOG_TRIGGER 253 330 | #define APPLE80211_IOC_HW_SUPPORTED_CHANNELS 254 331 | #define APPLE80211_IOC_BTCOEX_PROFILE 255 332 | #define APPLE80211_IOC_BTCOEX_PROFILE_ACTIVE 256 333 | #define APPLE80211_IOC_TRAP_INFO 257 334 | #define APPLE80211_IOC_THERMAL_INDEX 258 335 | #define APPLE80211_IOC_MAX_NSS_FOR_AP 259 336 | #define APPLE80211_IOC_BTCOEX_2G_CHAIN_DISABLE 260 337 | #define APPLE80211_IOC_POWER_BUDGET 261 338 | #define APPLE80211_IOC_AWDL_DFSP_CONFIG 262 339 | #define APPLE80211_IOC_AWDL_DFSP_UCSA_CONFIG 263 340 | #define APPLE80211_IOC_SCAN_BACKOFF_REPORT 264 341 | #define APPLE80211_IOC_OFFLOAD_TCPKA_ENABLE 265 342 | #define APPLE80211_IOC_RANGING_CAPS 266 343 | #define APPLE80211_IOC_PER_CORE_RSSI_REPORT 267 344 | #define APPLE80211_IOC_NSS 345 | 346 | #define APPLE80211_IOC_CARD_SPECIFIC 0xffffffff // req_type 347 | 348 | // Kernel interface 349 | 350 | // Bump this value when structures change 351 | #define APPLE80211_VERSION 1 352 | 353 | struct apple80211_ssid_data 354 | { 355 | u_int32_t version; 356 | u_int32_t ssid_len; 357 | u_int8_t ssid_bytes[APPLE80211_MAX_SSID_LEN]; 358 | }; 359 | 360 | struct apple80211_channel_data 361 | { 362 | u_int32_t version; 363 | struct apple80211_channel channel; 364 | }; 365 | 366 | struct apple80211_bssid_data 367 | { 368 | u_int32_t version; 369 | struct ether_addr bssid; 370 | }; 371 | 372 | struct apple80211_capability_data 373 | { 374 | u_int32_t version; 375 | u_int8_t capabilities[APPLE80211_MAP_SIZE( APPLE80211_CAP_MAX + 1 )]; 376 | }; 377 | 378 | struct apple80211_state_data 379 | { 380 | u_int32_t version; 381 | u_int32_t state; 382 | }; 383 | 384 | struct apple80211_rssi_data 385 | { 386 | u_int32_t version; 387 | u_int32_t num_radios; 388 | u_int32_t rssi_unit; 389 | int32_t rssi[APPLE80211_MAX_RADIO]; // control channel 390 | int32_t aggregate_rssi; // aggregate control channel rssi 391 | int32_t rssi_ext[APPLE80211_MAX_RADIO]; // extension channel rssi 392 | int32_t aggregate_rssi_ext; // aggregate extension channel rssi 393 | }; 394 | 395 | struct apple80211_power_data 396 | { 397 | u_int32_t version; 398 | u_int32_t num_radios; 399 | u_int32_t power_state[APPLE80211_MAX_RADIO]; 400 | }; 401 | 402 | struct apple80211_assoc_result_data 403 | { 404 | u_int32_t version; 405 | u_int32_t result; 406 | }; 407 | 408 | struct apple80211_assoc_status_data 409 | { 410 | u_int32_t version; 411 | u_int32_t status; 412 | }; 413 | 414 | struct apple80211_rate_data 415 | { 416 | u_int32_t version; 417 | u_int32_t num_radios; 418 | u_int32_t rate[APPLE80211_MAX_RADIO]; 419 | }; 420 | 421 | struct apple80211_status_dev_data 422 | { 423 | u_int32_t version; 424 | u_int8_t dev_name[MAXPATHLEN]; 425 | }; 426 | 427 | struct apple80211_powersave_data 428 | { 429 | u_int32_t version; 430 | u_int32_t powersave_level; 431 | }; 432 | 433 | struct apple80211_protmode_data 434 | { 435 | u_int32_t version; 436 | u_int32_t protmode; 437 | u_int32_t threshold; // bytes 438 | }; 439 | 440 | struct apple80211_txpower_data 441 | { 442 | u_int32_t version; 443 | u_int32_t txpower_unit; 444 | int32_t txpower; 445 | }; 446 | 447 | struct apple80211_phymode_data 448 | { 449 | u_int32_t version; 450 | u_int32_t phy_mode; // vector of supported phy modes 451 | u_int32_t active_phy_mode; // current active phy mode 452 | }; 453 | 454 | struct apple80211_opmode_data 455 | { 456 | u_int32_t version; 457 | u_int32_t op_mode; 458 | }; 459 | 460 | struct apple80211_noise_data 461 | { 462 | u_int32_t version; 463 | u_int32_t num_radios; 464 | u_int32_t noise_unit; 465 | int32_t noise[APPLE80211_MAX_RADIO]; // control channel 466 | int32_t aggregate_noise; // aggregate control channel noise 467 | int32_t noise_ext[APPLE80211_MAX_RADIO]; // extension channel noise 468 | int32_t aggregate_noise_ext; // aggregate extension channel noise 469 | }; 470 | 471 | struct apple80211_intmit_data 472 | { 473 | u_int32_t version; 474 | u_int32_t int_mit; 475 | }; 476 | 477 | struct apple80211_authtype_data 478 | { 479 | u_int32_t version; 480 | u_int32_t authtype_lower; // apple80211_authtype_lower 481 | u_int32_t authtype_upper; // apple80211_authtype_upper 482 | }; 483 | 484 | struct apple80211_sup_channel_data 485 | { 486 | u_int32_t version; 487 | u_int32_t num_channels; 488 | struct apple80211_channel supported_channels[APPLE80211_MAX_CHANNELS]; 489 | }; 490 | 491 | 492 | struct apple80211_roam_threshold_data 493 | { 494 | u_int32_t threshold; 495 | u_int32_t count; 496 | }; 497 | 498 | struct apple80211_locale_data 499 | { 500 | u_int32_t version; 501 | u_int32_t locale; 502 | }; 503 | 504 | struct apple80211_scan_data 505 | { 506 | u_int32_t version; 507 | u_int32_t bss_type; // apple80211_apmode 508 | struct ether_addr bssid; // target BSSID 509 | u_int32_t ssid_len; // length of the SSID 510 | u_int8_t ssid[APPLE80211_MAX_SSID_LEN]; 511 | u_int32_t scan_type; // apple80211_scan_type 512 | u_int32_t phy_mode; // apple80211_phymode vector 513 | u_int16_t dwell_time; // time to spend on each channel (ms) 514 | u_int32_t rest_time; // time between scanning each channel (ms) 515 | u_int32_t num_channels; // 0 if not passing in channels 516 | struct apple80211_channel channels[APPLE80211_MAX_CHANNELS]; // channel list 517 | }; 518 | 519 | struct apple80211_apmode_data 520 | { 521 | u_int32_t version; 522 | u_int32_t apmode; 523 | }; 524 | 525 | struct apple80211_assoc_data 526 | { 527 | u_int32_t version; 528 | u_int16_t ad_mode; // apple80211_apmode 529 | u_int16_t ad_auth_lower; // apple80211_authtype_lower 530 | u_int16_t ad_auth_upper; // apple80211_authtype_upper 531 | u_int32_t ad_ssid_len; 532 | u_int8_t ad_ssid[ APPLE80211_MAX_SSID_LEN ]; 533 | struct ether_addr ad_bssid; // prefer over ssid if not zeroed 534 | struct apple80211_key ad_key; 535 | u_int16_t ad_rsn_ie_len; 536 | u_int8_t ad_rsn_ie[ APPLE80211_MAX_RSN_IE_LEN ]; 537 | u_int32_t ad_flags; // apple80211_assoc_flags 538 | }; 539 | 540 | struct apple80211_deauth_data 541 | { 542 | u_int32_t version; 543 | u_int32_t deauth_reason; // reason code 544 | struct ether_addr deauth_ea; // BSSID of AP 545 | }; 546 | 547 | struct apple80211_countermeasures_data 548 | { 549 | u_int32_t version; 550 | u_int32_t enabled; 551 | }; 552 | 553 | struct apple80211_frag_threshold_data 554 | { 555 | u_int32_t version; 556 | u_int32_t threshold; // bytes 557 | }; 558 | 559 | struct apple80211_rate_set_data 560 | { 561 | u_int32_t version; 562 | u_int16_t num_rates; 563 | struct apple80211_rate rates[APPLE80211_MAX_RATES]; 564 | }; 565 | 566 | struct apple80211_short_slot_data 567 | { 568 | u_int32_t version; 569 | u_int8_t mode; 570 | }; 571 | 572 | struct apple80211_retry_limit_data 573 | { 574 | u_int32_t version; 575 | u_int32_t limit; 576 | }; 577 | 578 | struct apple80211_antenna_data 579 | { 580 | u_int32_t version; 581 | u_int32_t num_radios; 582 | int32_t antenna_index[APPLE80211_MAX_RADIO]; 583 | }; 584 | 585 | struct apple80211_dtim_int_data 586 | { 587 | u_int32_t version; 588 | u_int32_t interval; 589 | }; 590 | 591 | struct apple80211_sta_data 592 | { 593 | u_int32_t version; 594 | u_int32_t num_stations; 595 | struct apple80211_station station_list[APPLE80211_MAX_STATIONS]; 596 | }; 597 | 598 | struct apple80211_version_data 599 | { 600 | u_int32_t version; 601 | u_int16_t string_len; 602 | char string[APPLE80211_MAX_VERSION_LEN]; 603 | }; 604 | 605 | struct apple80211_rom_data 606 | { 607 | u_int32_t version; 608 | u_int32_t rom_len; 609 | u_int8_t rom[1]; // variable length 610 | }; 611 | 612 | struct apple80211_rand_data 613 | { 614 | u_int32_t version; 615 | u_int32_t rand; 616 | }; 617 | 618 | struct apple80211_rsn_ie_data 619 | { 620 | u_int32_t version; 621 | u_int16_t len; 622 | u_int8_t ie[ APPLE80211_MAX_RSN_IE_LEN ]; 623 | }; 624 | 625 | struct apple80211_ap_ie_data 626 | { 627 | u_int32_t version; 628 | u_int32_t len; 629 | u_int8_t *ie_data; 630 | }; 631 | 632 | struct apple80211_stats_data 633 | { 634 | u_int32_t version; 635 | u_int32_t tx_frame_count; 636 | u_int32_t tx_errors; 637 | u_int32_t rx_frame_count; 638 | u_int32_t rx_errors; 639 | }; 640 | 641 | struct apple80211_country_code_data 642 | { 643 | u_int32_t version; 644 | u_int8_t cc[APPLE80211_MAX_CC_LEN]; 645 | }; 646 | 647 | struct apple80211_last_rx_pkt_data 648 | { 649 | u_int32_t version; 650 | u_int32_t rate; 651 | int32_t rssi; 652 | u_int32_t num_streams; // number of spatial streams 653 | struct ether_addr sa; // source address 654 | }; 655 | 656 | struct apple80211_radio_info_data 657 | { 658 | u_int32_t version; 659 | u_int32_t count; // number of rf chains 660 | }; 661 | 662 | struct apple80211_guard_interval_data 663 | { 664 | u_int32_t version; 665 | u_int32_t interval; // apple80211_guard_interval 666 | }; 667 | 668 | struct apple80211_mcs_data 669 | { 670 | u_int32_t version; 671 | u_int32_t index; // 0 to APPLE80211_MAX_MCS_INDEX 672 | }; 673 | 674 | struct apple80211_rifs_data 675 | { 676 | u_int32_t version; 677 | u_int32_t enabled; 678 | }; 679 | 680 | struct apple80211_ldpc_data 681 | { 682 | u_int32_t version; 683 | u_int32_t enabled; 684 | }; 685 | 686 | struct apple80211_msdu_data 687 | { 688 | u_int32_t version; 689 | u_int32_t max_length; // 3839 or 7935 bytes 690 | }; 691 | 692 | struct apple80211_mpdu_data 693 | { 694 | u_int32_t version; 695 | u_int32_t max_factor; // 0 - APPLE80211_MAX_MPDU_FACTOR 696 | u_int32_t max_density; // 0 - APPLE80211_MAX_MPDU_DENSITY 697 | }; 698 | 699 | struct apple80211_block_ack_data 700 | { 701 | u_int32_t version; 702 | u_int8_t ba_enabled; // block ack enabled 703 | u_int8_t immediate_ba_enabled; // immediate block ack enabled 704 | u_int8_t cbba_enabled; // compressed bitmap block ack enabled 705 | u_int8_t implicit_ba_enabled; // implicit block ack enabled 706 | }; 707 | 708 | struct apple80211_pls_data 709 | { 710 | u_int32_t version; 711 | u_int32_t enabled; // phy level spoofing enabled 712 | }; 713 | 714 | struct apple80211_psmp_data 715 | { 716 | u_int32_t version; 717 | u_int32_t enabled; 718 | }; 719 | 720 | struct apple80211_physubmode_data 721 | { 722 | u_int32_t version; 723 | u_int32_t phy_mode; // one apple80211_phymode 724 | u_int32_t phy_submode; // one apple80211_physubmode 725 | u_int32_t flags; // apple80211_channel_flag vector 726 | }; 727 | 728 | struct apple80211_mcs_index_set_data 729 | { 730 | u_int32_t version; 731 | u_int8_t mcs_set_map[APPLE80211_MAP_SIZE( APPLE80211_MAX_MCS_INDEX + 1 )]; 732 | }; 733 | 734 | struct apple80211_wow_parameter_data 735 | { 736 | u_int32_t version; 737 | u_int8_t wake_cond_map[APPLE80211_MAP_SIZE( APPLE80211_MAX_WAKE_COND + 1 )]; 738 | u_int32_t beacon_loss_time; 739 | u_int32_t pattern_count; 740 | struct apple80211_wow_pattern patterns[APPLE80211_MAX_WOW_PATTERNS]; 741 | }; 742 | 743 | struct apple80211_40mhz_intolerant_data 744 | { 745 | u_int32_t version; 746 | u_int32_t enabled; // bit enabled or not 747 | }; 748 | 749 | #endif // _APPLE80211_IOCTL_H_ 750 | 751 | -------------------------------------------------------------------------------- /Black80211.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6811BAE023E36DB00004FF34 /* IONetworkController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BAD623E36DB00004FF34 /* IONetworkController.h */; }; 11 | 6811BAE123E36DB00004FF34 /* IOSkywalkEthernetInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BAD723E36DB00004FF34 /* IOSkywalkEthernetInterface.h */; }; 12 | 6811BAE223E36DB00004FF34 /* IO80211Interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BAD823E36DB00004FF34 /* IO80211Interface.h */; }; 13 | 6811BAE323E36DB00004FF34 /* IO80211Controller.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BAD923E36DB00004FF34 /* IO80211Controller.h */; }; 14 | 6811BAE423E36DB00004FF34 /* IO80211SkywalkInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BADA23E36DB00004FF34 /* IO80211SkywalkInterface.h */; }; 15 | 6811BAE523E36DB00004FF34 /* apple80211_var.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BADB23E36DB00004FF34 /* apple80211_var.h */; }; 16 | 6811BAE623E36DB00004FF34 /* apple80211_wps.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BADC23E36DB00004FF34 /* apple80211_wps.h */; }; 17 | 6811BAE723E36DB00004FF34 /* IO80211WorkLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BADD23E36DB00004FF34 /* IO80211WorkLoop.h */; }; 18 | 6811BAE823E36DB00004FF34 /* IOEthernetController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BADE23E36DB00004FF34 /* IOEthernetController.h */; }; 19 | 6811BAE923E36DB00004FF34 /* apple80211_ioctl.h in Headers */ = {isa = PBXBuildFile; fileRef = 6811BADF23E36DB00004FF34 /* apple80211_ioctl.h */; }; 20 | 6863647623E36CDF00549C37 /* FakeDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6E361AF209F924400794572 /* FakeDevice.cpp */; }; 21 | 6863647723E36CDF00549C37 /* Black80211Control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A612723C203A1079009DD95B /* Black80211Control.cpp */; }; 22 | 6863647823E36CDF00549C37 /* Black80211Control_ioctl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A632F0D620E8230700AAC444 /* Black80211Control_ioctl.cpp */; }; 23 | 6863648523E36CDF00549C37 /* Black80211Control.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A61272252039FD13009DD95B /* Black80211Control.hpp */; }; 24 | 6863648623E36CDF00549C37 /* FakeDevice.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A6E361B0209F924400794572 /* FakeDevice.hpp */; }; 25 | A61272262039FD13009DD95B /* Black80211Control.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A61272252039FD13009DD95B /* Black80211Control.hpp */; }; 26 | A612723D203A1079009DD95B /* Black80211Control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A612723C203A1079009DD95B /* Black80211Control.cpp */; }; 27 | A632F0D720E8230700AAC444 /* Black80211Control_ioctl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A632F0D620E8230700AAC444 /* Black80211Control_ioctl.cpp */; }; 28 | A632F0D820E8230700AAC444 /* Black80211Control_ioctl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A632F0D620E8230700AAC444 /* Black80211Control_ioctl.cpp */; }; 29 | A6350424209A344100C82B59 /* Black80211Control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A612723C203A1079009DD95B /* Black80211Control.cpp */; }; 30 | A635042B209A344900C82B59 /* Black80211Control.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A61272252039FD13009DD95B /* Black80211Control.hpp */; }; 31 | A688015420EDA58B00590651 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = A688015320EDA58B00590651 /* debug.h */; }; 32 | A6E361B1209F924400794572 /* FakeDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6E361AF209F924400794572 /* FakeDevice.cpp */; }; 33 | A6E361B2209F924400794572 /* FakeDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A6E361AF209F924400794572 /* FakeDevice.cpp */; }; 34 | A6E361B3209F924400794572 /* FakeDevice.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A6E361B0209F924400794572 /* FakeDevice.hpp */; }; 35 | A6E361B4209F924400794572 /* FakeDevice.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A6E361B0209F924400794572 /* FakeDevice.hpp */; }; 36 | /* End PBXBuildFile section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 6811BAD623E36DB00004FF34 /* IONetworkController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkController.h; sourceTree = ""; }; 40 | 6811BAD723E36DB00004FF34 /* IOSkywalkEthernetInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSkywalkEthernetInterface.h; sourceTree = ""; }; 41 | 6811BAD823E36DB00004FF34 /* IO80211Interface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IO80211Interface.h; sourceTree = ""; }; 42 | 6811BAD923E36DB00004FF34 /* IO80211Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IO80211Controller.h; sourceTree = ""; }; 43 | 6811BADA23E36DB00004FF34 /* IO80211SkywalkInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IO80211SkywalkInterface.h; sourceTree = ""; }; 44 | 6811BADB23E36DB00004FF34 /* apple80211_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apple80211_var.h; sourceTree = ""; }; 45 | 6811BADC23E36DB00004FF34 /* apple80211_wps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apple80211_wps.h; sourceTree = ""; }; 46 | 6811BADD23E36DB00004FF34 /* IO80211WorkLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IO80211WorkLoop.h; sourceTree = ""; }; 47 | 6811BADE23E36DB00004FF34 /* IOEthernetController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOEthernetController.h; sourceTree = ""; }; 48 | 6811BADF23E36DB00004FF34 /* apple80211_ioctl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apple80211_ioctl.h; sourceTree = ""; }; 49 | 6863648D23E36CDF00549C37 /* Black80211.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Black80211.kext; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 6863648E23E36CDF00549C37 /* Black80211_Sierra copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Black80211_Sierra copy-Info.plist"; path = "/Users/hatf0/Projects/black80211/Black80211_Sierra copy-Info.plist"; sourceTree = ""; }; 51 | A61272222039FD13009DD95B /* Black80211.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Black80211.kext; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | A61272252039FD13009DD95B /* Black80211Control.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Black80211Control.hpp; sourceTree = ""; }; 53 | A61272292039FD13009DD95B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | A612723C203A1079009DD95B /* Black80211Control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Black80211Control.cpp; sourceTree = ""; }; 55 | A632F0D620E8230700AAC444 /* Black80211Control_ioctl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Black80211Control_ioctl.cpp; sourceTree = ""; }; 56 | A635043B209A3CC700C82B59 /* apple80211.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = apple80211.h; sourceTree = ""; }; 57 | A688015320EDA58B00590651 /* debug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; }; 58 | A6881FF7209A29A3009B1576 /* Black80211.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Black80211.kext; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | A6E361AF209F924400794572 /* FakeDevice.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FakeDevice.cpp; sourceTree = ""; }; 60 | A6E361B0209F924400794572 /* FakeDevice.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = FakeDevice.hpp; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 6863647923E36CDF00549C37 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | A612721E2039FD13009DD95B /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | A6881FF3209A29A3009B1576 /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | /* End PBXFrameworksBuildPhase section */ 86 | 87 | /* Begin PBXGroup section */ 88 | 6863647323E36C8700549C37 /* catalina */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 6811BADF23E36DB00004FF34 /* apple80211_ioctl.h */, 92 | 6811BADB23E36DB00004FF34 /* apple80211_var.h */, 93 | 6811BADC23E36DB00004FF34 /* apple80211_wps.h */, 94 | 6811BAD923E36DB00004FF34 /* IO80211Controller.h */, 95 | 6811BAD823E36DB00004FF34 /* IO80211Interface.h */, 96 | 6811BADA23E36DB00004FF34 /* IO80211SkywalkInterface.h */, 97 | 6811BADD23E36DB00004FF34 /* IO80211WorkLoop.h */, 98 | 6811BADE23E36DB00004FF34 /* IOEthernetController.h */, 99 | 6811BAD623E36DB00004FF34 /* IONetworkController.h */, 100 | 6811BAD723E36DB00004FF34 /* IOSkywalkEthernetInterface.h */, 101 | ); 102 | path = catalina; 103 | sourceTree = ""; 104 | }; 105 | A61272182039FD13009DD95B = { 106 | isa = PBXGroup; 107 | children = ( 108 | A61272242039FD13009DD95B /* Black80211 */, 109 | A61272232039FD13009DD95B /* Products */, 110 | 6863648E23E36CDF00549C37 /* Black80211_Sierra copy-Info.plist */, 111 | ); 112 | sourceTree = ""; 113 | }; 114 | A61272232039FD13009DD95B /* Products */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | A61272222039FD13009DD95B /* Black80211.kext */, 118 | A6881FF7209A29A3009B1576 /* Black80211.kext */, 119 | 6863648D23E36CDF00549C37 /* Black80211.kext */, 120 | ); 121 | name = Products; 122 | sourceTree = ""; 123 | }; 124 | A61272242039FD13009DD95B /* Black80211 */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | A612722F2039FFC1009DD95B /* apple80211 */, 128 | A61272252039FD13009DD95B /* Black80211Control.hpp */, 129 | A612723C203A1079009DD95B /* Black80211Control.cpp */, 130 | A632F0D620E8230700AAC444 /* Black80211Control_ioctl.cpp */, 131 | A61272292039FD13009DD95B /* Info.plist */, 132 | A635043B209A3CC700C82B59 /* apple80211.h */, 133 | A6E361AF209F924400794572 /* FakeDevice.cpp */, 134 | A6E361B0209F924400794572 /* FakeDevice.hpp */, 135 | A688015320EDA58B00590651 /* debug.h */, 136 | ); 137 | path = Black80211; 138 | sourceTree = ""; 139 | }; 140 | A612722F2039FFC1009DD95B /* apple80211 */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 6863647323E36C8700549C37 /* catalina */, 144 | ); 145 | path = apple80211; 146 | sourceTree = ""; 147 | }; 148 | /* End PBXGroup section */ 149 | 150 | /* Begin PBXHeadersBuildPhase section */ 151 | 6863647A23E36CDF00549C37 /* Headers */ = { 152 | isa = PBXHeadersBuildPhase; 153 | buildActionMask = 2147483647; 154 | files = ( 155 | 6811BAE923E36DB00004FF34 /* apple80211_ioctl.h in Headers */, 156 | 6811BAE123E36DB00004FF34 /* IOSkywalkEthernetInterface.h in Headers */, 157 | 6811BAE823E36DB00004FF34 /* IOEthernetController.h in Headers */, 158 | 6811BAE623E36DB00004FF34 /* apple80211_wps.h in Headers */, 159 | 6811BAE723E36DB00004FF34 /* IO80211WorkLoop.h in Headers */, 160 | 6811BAE023E36DB00004FF34 /* IONetworkController.h in Headers */, 161 | 6811BAE423E36DB00004FF34 /* IO80211SkywalkInterface.h in Headers */, 162 | 6811BAE223E36DB00004FF34 /* IO80211Interface.h in Headers */, 163 | 6811BAE323E36DB00004FF34 /* IO80211Controller.h in Headers */, 164 | 6863648523E36CDF00549C37 /* Black80211Control.hpp in Headers */, 165 | 6811BAE523E36DB00004FF34 /* apple80211_var.h in Headers */, 166 | 6863648623E36CDF00549C37 /* FakeDevice.hpp in Headers */, 167 | ); 168 | runOnlyForDeploymentPostprocessing = 0; 169 | }; 170 | A612721F2039FD13009DD95B /* Headers */ = { 171 | isa = PBXHeadersBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | A61272262039FD13009DD95B /* Black80211Control.hpp in Headers */, 175 | A6E361B3209F924400794572 /* FakeDevice.hpp in Headers */, 176 | ); 177 | runOnlyForDeploymentPostprocessing = 0; 178 | }; 179 | A6881FF4209A29A3009B1576 /* Headers */ = { 180 | isa = PBXHeadersBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | A688015420EDA58B00590651 /* debug.h in Headers */, 184 | A6E361B4209F924400794572 /* FakeDevice.hpp in Headers */, 185 | A635042B209A344900C82B59 /* Black80211Control.hpp in Headers */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXHeadersBuildPhase section */ 190 | 191 | /* Begin PBXNativeTarget section */ 192 | 6863647423E36CDF00549C37 /* Black80211_Catalina */ = { 193 | isa = PBXNativeTarget; 194 | buildConfigurationList = 6863648A23E36CDF00549C37 /* Build configuration list for PBXNativeTarget "Black80211_Catalina" */; 195 | buildPhases = ( 196 | 6863647523E36CDF00549C37 /* Sources */, 197 | 6863647923E36CDF00549C37 /* Frameworks */, 198 | 6863647A23E36CDF00549C37 /* Headers */, 199 | 6863648923E36CDF00549C37 /* Resources */, 200 | ); 201 | buildRules = ( 202 | ); 203 | dependencies = ( 204 | ); 205 | name = Black80211_Catalina; 206 | productName = Black80211; 207 | productReference = 6863648D23E36CDF00549C37 /* Black80211.kext */; 208 | productType = "com.apple.product-type.kernel-extension"; 209 | }; 210 | A61272212039FD13009DD95B /* Black80211_Sierra */ = { 211 | isa = PBXNativeTarget; 212 | buildConfigurationList = A612722C2039FD13009DD95B /* Build configuration list for PBXNativeTarget "Black80211_Sierra" */; 213 | buildPhases = ( 214 | A612721D2039FD13009DD95B /* Sources */, 215 | A612721E2039FD13009DD95B /* Frameworks */, 216 | A612721F2039FD13009DD95B /* Headers */, 217 | A61272202039FD13009DD95B /* Resources */, 218 | ); 219 | buildRules = ( 220 | ); 221 | dependencies = ( 222 | ); 223 | name = Black80211_Sierra; 224 | productName = Black80211; 225 | productReference = A61272222039FD13009DD95B /* Black80211.kext */; 226 | productType = "com.apple.product-type.kernel-extension"; 227 | }; 228 | A6881FF6209A29A3009B1576 /* Black80211_HighSierra */ = { 229 | isa = PBXNativeTarget; 230 | buildConfigurationList = A6881FFE209A29A4009B1576 /* Build configuration list for PBXNativeTarget "Black80211_HighSierra" */; 231 | buildPhases = ( 232 | A6881FF2209A29A3009B1576 /* Sources */, 233 | A6881FF3209A29A3009B1576 /* Frameworks */, 234 | A6881FF4209A29A3009B1576 /* Headers */, 235 | A6881FF5209A29A3009B1576 /* Resources */, 236 | ); 237 | buildRules = ( 238 | ); 239 | dependencies = ( 240 | ); 241 | name = Black80211_HighSierra; 242 | productName = Black80211_HighSierra; 243 | productReference = A6881FF7209A29A3009B1576 /* Black80211.kext */; 244 | productType = "com.apple.product-type.kernel-extension"; 245 | }; 246 | /* End PBXNativeTarget section */ 247 | 248 | /* Begin PBXProject section */ 249 | A61272192039FD13009DD95B /* Project object */ = { 250 | isa = PBXProject; 251 | attributes = { 252 | LastUpgradeCheck = 0930; 253 | ORGANIZATIONNAME = "Roman Peshkov"; 254 | TargetAttributes = { 255 | A61272212039FD13009DD95B = { 256 | CreatedOnToolsVersion = 9.2; 257 | }; 258 | A6881FF6209A29A3009B1576 = { 259 | CreatedOnToolsVersion = 9.2; 260 | ProvisioningStyle = Manual; 261 | }; 262 | }; 263 | }; 264 | buildConfigurationList = A612721C2039FD13009DD95B /* Build configuration list for PBXProject "Black80211" */; 265 | compatibilityVersion = "Xcode 8.0"; 266 | developmentRegion = en; 267 | hasScannedForEncodings = 0; 268 | knownRegions = ( 269 | en, 270 | ); 271 | mainGroup = A61272182039FD13009DD95B; 272 | productRefGroup = A61272232039FD13009DD95B /* Products */; 273 | projectDirPath = ""; 274 | projectRoot = ""; 275 | targets = ( 276 | A61272212039FD13009DD95B /* Black80211_Sierra */, 277 | A6881FF6209A29A3009B1576 /* Black80211_HighSierra */, 278 | 6863647423E36CDF00549C37 /* Black80211_Catalina */, 279 | ); 280 | }; 281 | /* End PBXProject section */ 282 | 283 | /* Begin PBXResourcesBuildPhase section */ 284 | 6863648923E36CDF00549C37 /* Resources */ = { 285 | isa = PBXResourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | A61272202039FD13009DD95B /* Resources */ = { 292 | isa = PBXResourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | A6881FF5209A29A3009B1576 /* Resources */ = { 299 | isa = PBXResourcesBuildPhase; 300 | buildActionMask = 2147483647; 301 | files = ( 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | /* End PBXResourcesBuildPhase section */ 306 | 307 | /* Begin PBXSourcesBuildPhase section */ 308 | 6863647523E36CDF00549C37 /* Sources */ = { 309 | isa = PBXSourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | 6863647623E36CDF00549C37 /* FakeDevice.cpp in Sources */, 313 | 6863647723E36CDF00549C37 /* Black80211Control.cpp in Sources */, 314 | 6863647823E36CDF00549C37 /* Black80211Control_ioctl.cpp in Sources */, 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | }; 318 | A612721D2039FD13009DD95B /* Sources */ = { 319 | isa = PBXSourcesBuildPhase; 320 | buildActionMask = 2147483647; 321 | files = ( 322 | A6E361B1209F924400794572 /* FakeDevice.cpp in Sources */, 323 | A612723D203A1079009DD95B /* Black80211Control.cpp in Sources */, 324 | A632F0D720E8230700AAC444 /* Black80211Control_ioctl.cpp in Sources */, 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | }; 328 | A6881FF2209A29A3009B1576 /* Sources */ = { 329 | isa = PBXSourcesBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | A6E361B2209F924400794572 /* FakeDevice.cpp in Sources */, 333 | A6350424209A344100C82B59 /* Black80211Control.cpp in Sources */, 334 | A632F0D820E8230700AAC444 /* Black80211Control_ioctl.cpp in Sources */, 335 | ); 336 | runOnlyForDeploymentPostprocessing = 0; 337 | }; 338 | /* End PBXSourcesBuildPhase section */ 339 | 340 | /* Begin XCBuildConfiguration section */ 341 | 6863648B23E36CDF00549C37 /* Debug */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | CLANG_WARN_DOCUMENTATION_COMMENTS = NO; 345 | CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/Catalina/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; 346 | CURRENT_PROJECT_VERSION = 1.0.0d1; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "__PRIVATE_SPI__=1", 350 | "$(inherited)", 351 | "CATALINA=1", 352 | ); 353 | INFOPLIST_FILE = Black80211/Info.plist; 354 | MACOSX_DEPLOYMENT_TARGET = 10.15; 355 | MODULE_NAME = net.rpeshkov.Black80211; 356 | MODULE_VERSION = 1.0.0d1; 357 | ONLY_ACTIVE_ARCH = YES; 358 | PRODUCT_BUNDLE_IDENTIFIER = net.rpeshkov.Black80211; 359 | PRODUCT_NAME = Black80211; 360 | SDKROOT = macosx; 361 | WARNING_CFLAGS = "-Wno-inconsistent-missing-override"; 362 | WRAPPER_EXTENSION = kext; 363 | }; 364 | name = Debug; 365 | }; 366 | 6863648C23E36CDF00549C37 /* Release */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | CLANG_WARN_DOCUMENTATION_COMMENTS = NO; 370 | CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/Catalina/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; 371 | CURRENT_PROJECT_VERSION = 1.0.0d1; 372 | GCC_PREPROCESSOR_DEFINITIONS = ( 373 | "__PRIVATE_SPI__=1", 374 | "CATALINA=1", 375 | ); 376 | INFOPLIST_FILE = Black80211/Info.plist; 377 | MACOSX_DEPLOYMENT_TARGET = 10.15; 378 | MODULE_NAME = net.rpeshkov.Black80211; 379 | MODULE_VERSION = 1.0.0d1; 380 | ONLY_ACTIVE_ARCH = YES; 381 | PRODUCT_BUNDLE_IDENTIFIER = net.rpeshkov.Black80211; 382 | PRODUCT_NAME = Black80211; 383 | SDKROOT = macosx; 384 | WARNING_CFLAGS = ( 385 | "-Wno-inconsistent-missing-override", 386 | "-D__PRIVATE_SPI__", 387 | ); 388 | WRAPPER_EXTENSION = kext; 389 | }; 390 | name = Release; 391 | }; 392 | A612722A2039FD13009DD95B /* Debug */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ALWAYS_SEARCH_USER_PATHS = NO; 396 | CLANG_ANALYZER_NONNULL = YES; 397 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 398 | CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; 399 | CLANG_CXX_LIBRARY = "compiler-default"; 400 | CLANG_ENABLE_MODULES = YES; 401 | CLANG_ENABLE_OBJC_ARC = YES; 402 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 403 | CLANG_WARN_BOOL_CONVERSION = YES; 404 | CLANG_WARN_COMMA = YES; 405 | CLANG_WARN_CONSTANT_CONVERSION = YES; 406 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 407 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 408 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 409 | CLANG_WARN_EMPTY_BODY = YES; 410 | CLANG_WARN_ENUM_CONVERSION = YES; 411 | CLANG_WARN_INFINITE_RECURSION = YES; 412 | CLANG_WARN_INT_CONVERSION = YES; 413 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 414 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 415 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 416 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 417 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 418 | CLANG_WARN_STRICT_PROTOTYPES = YES; 419 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 420 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 421 | CLANG_WARN_UNREACHABLE_CODE = YES; 422 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 423 | CODE_SIGN_IDENTITY = "-"; 424 | COPY_PHASE_STRIP = NO; 425 | DEBUG_INFORMATION_FORMAT = dwarf; 426 | ENABLE_STRICT_OBJC_MSGSEND = YES; 427 | ENABLE_TESTABILITY = YES; 428 | GCC_C_LANGUAGE_STANDARD = gnu99; 429 | GCC_DYNAMIC_NO_PIC = NO; 430 | GCC_NO_COMMON_BLOCKS = YES; 431 | GCC_OPTIMIZATION_LEVEL = 0; 432 | GCC_PREPROCESSOR_DEFINITIONS = ( 433 | "DEBUG=1", 434 | "__PRIVATE_SPI__=1", 435 | "$(inherited)", 436 | ); 437 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 438 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 439 | GCC_WARN_UNDECLARED_SELECTOR = YES; 440 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 441 | GCC_WARN_UNUSED_FUNCTION = YES; 442 | GCC_WARN_UNUSED_VARIABLE = YES; 443 | MACOSX_DEPLOYMENT_TARGET = 10.13; 444 | MTL_ENABLE_DEBUG_INFO = YES; 445 | ONLY_ACTIVE_ARCH = YES; 446 | SDKROOT = macosx; 447 | }; 448 | name = Debug; 449 | }; 450 | A612722B2039FD13009DD95B /* Release */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | ALWAYS_SEARCH_USER_PATHS = NO; 454 | CLANG_ANALYZER_NONNULL = YES; 455 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 456 | CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; 457 | CLANG_CXX_LIBRARY = "compiler-default"; 458 | CLANG_ENABLE_MODULES = YES; 459 | CLANG_ENABLE_OBJC_ARC = YES; 460 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 461 | CLANG_WARN_BOOL_CONVERSION = YES; 462 | CLANG_WARN_COMMA = YES; 463 | CLANG_WARN_CONSTANT_CONVERSION = YES; 464 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 465 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 466 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 467 | CLANG_WARN_EMPTY_BODY = YES; 468 | CLANG_WARN_ENUM_CONVERSION = YES; 469 | CLANG_WARN_INFINITE_RECURSION = YES; 470 | CLANG_WARN_INT_CONVERSION = YES; 471 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 472 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 473 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 474 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 475 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 476 | CLANG_WARN_STRICT_PROTOTYPES = YES; 477 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 478 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 479 | CLANG_WARN_UNREACHABLE_CODE = YES; 480 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 481 | CODE_SIGN_IDENTITY = "-"; 482 | COPY_PHASE_STRIP = NO; 483 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 484 | ENABLE_NS_ASSERTIONS = NO; 485 | ENABLE_STRICT_OBJC_MSGSEND = YES; 486 | GCC_C_LANGUAGE_STANDARD = gnu99; 487 | GCC_NO_COMMON_BLOCKS = YES; 488 | GCC_PREPROCESSOR_DEFINITIONS = "__PRIVATE_SPI__=1"; 489 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 490 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 491 | GCC_WARN_UNDECLARED_SELECTOR = YES; 492 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 493 | GCC_WARN_UNUSED_FUNCTION = YES; 494 | GCC_WARN_UNUSED_VARIABLE = YES; 495 | MACOSX_DEPLOYMENT_TARGET = 10.13; 496 | MTL_ENABLE_DEBUG_INFO = NO; 497 | ONLY_ACTIVE_ARCH = YES; 498 | SDKROOT = macosx; 499 | }; 500 | name = Release; 501 | }; 502 | A612722D2039FD13009DD95B /* Debug */ = { 503 | isa = XCBuildConfiguration; 504 | buildSettings = { 505 | CLANG_WARN_DOCUMENTATION_COMMENTS = NO; 506 | CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/Sierra/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; 507 | CURRENT_PROJECT_VERSION = 1.0.0d1; 508 | GCC_PREPROCESSOR_DEFINITIONS = ( 509 | "DEBUG=1", 510 | "__PRIVATE_SPI__=1", 511 | "$(inherited)", 512 | "SIERRA=1", 513 | ); 514 | INFOPLIST_FILE = Black80211/Info.plist; 515 | MACOSX_DEPLOYMENT_TARGET = 10.12; 516 | MODULE_NAME = net.rpeshkov.Black80211; 517 | MODULE_VERSION = 1.0.0d1; 518 | PRODUCT_BUNDLE_IDENTIFIER = net.rpeshkov.Black80211; 519 | PRODUCT_NAME = Black80211; 520 | SDKROOT = macosx; 521 | WARNING_CFLAGS = "-Wno-inconsistent-missing-override"; 522 | WRAPPER_EXTENSION = kext; 523 | }; 524 | name = Debug; 525 | }; 526 | A612722E2039FD13009DD95B /* Release */ = { 527 | isa = XCBuildConfiguration; 528 | buildSettings = { 529 | CLANG_WARN_DOCUMENTATION_COMMENTS = NO; 530 | CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/Sierra/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; 531 | CURRENT_PROJECT_VERSION = 1.0.0d1; 532 | GCC_PREPROCESSOR_DEFINITIONS = ( 533 | "__PRIVATE_SPI__=1", 534 | "SIERRA=1", 535 | ); 536 | INFOPLIST_FILE = Black80211/Info.plist; 537 | MACOSX_DEPLOYMENT_TARGET = 10.12; 538 | MODULE_NAME = net.rpeshkov.Black80211; 539 | MODULE_VERSION = 1.0.0d1; 540 | PRODUCT_BUNDLE_IDENTIFIER = net.rpeshkov.Black80211; 541 | PRODUCT_NAME = Black80211; 542 | SDKROOT = macosx; 543 | WARNING_CFLAGS = ( 544 | "-Wno-inconsistent-missing-override", 545 | "-D__PRIVATE_SPI__", 546 | ); 547 | WRAPPER_EXTENSION = kext; 548 | }; 549 | name = Release; 550 | }; 551 | A6881FFF209A29A4009B1576 /* Debug */ = { 552 | isa = XCBuildConfiguration; 553 | buildSettings = { 554 | CODE_SIGN_STYLE = Manual; 555 | COMBINE_HIDPI_IMAGES = YES; 556 | CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/HighSierra/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; 557 | CURRENT_PROJECT_VERSION = 1.0.0d1; 558 | DEVELOPMENT_TEAM = ""; 559 | GCC_PREPROCESSOR_DEFINITIONS = ( 560 | "DEBUG=1", 561 | "__PRIVATE_SPI__=1", 562 | "$(inherited)", 563 | "HIGH_SIERRA=1", 564 | ); 565 | INFOPLIST_FILE = Black80211/Info.plist; 566 | MACOSX_DEPLOYMENT_TARGET = 10.13; 567 | MODULE_NAME = net.rpeshkov.Black80211; 568 | MODULE_VERSION = 1.0.0d1; 569 | PRODUCT_BUNDLE_IDENTIFIER = net.rpeshkov.Black80211; 570 | PRODUCT_NAME = Black80211; 571 | PROVISIONING_PROFILE_SPECIFIER = ""; 572 | WARNING_CFLAGS = "-Wno-inconsistent-missing-override"; 573 | WRAPPER_EXTENSION = kext; 574 | }; 575 | name = Debug; 576 | }; 577 | A6882000209A29A4009B1576 /* Release */ = { 578 | isa = XCBuildConfiguration; 579 | buildSettings = { 580 | CODE_SIGN_STYLE = Manual; 581 | COMBINE_HIDPI_IMAGES = YES; 582 | CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/HighSierra/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; 583 | CURRENT_PROJECT_VERSION = 1.0.0d1; 584 | DEVELOPMENT_TEAM = ""; 585 | GCC_PREPROCESSOR_DEFINITIONS = ( 586 | "__PRIVATE_SPI__=1", 587 | "HIGH_SIERRA=1", 588 | ); 589 | INFOPLIST_FILE = Black80211/Info.plist; 590 | MACOSX_DEPLOYMENT_TARGET = 10.13; 591 | MODULE_NAME = net.rpeshkov.Black80211; 592 | MODULE_VERSION = 1.0.0d1; 593 | PRODUCT_BUNDLE_IDENTIFIER = net.rpeshkov.Black80211; 594 | PRODUCT_NAME = Black80211; 595 | PROVISIONING_PROFILE_SPECIFIER = ""; 596 | WARNING_CFLAGS = ( 597 | "-Wno-inconsistent-missing-override", 598 | "-D__PRIVATE_SPI__", 599 | ); 600 | WRAPPER_EXTENSION = kext; 601 | }; 602 | name = Release; 603 | }; 604 | /* End XCBuildConfiguration section */ 605 | 606 | /* Begin XCConfigurationList section */ 607 | 6863648A23E36CDF00549C37 /* Build configuration list for PBXNativeTarget "Black80211_Catalina" */ = { 608 | isa = XCConfigurationList; 609 | buildConfigurations = ( 610 | 6863648B23E36CDF00549C37 /* Debug */, 611 | 6863648C23E36CDF00549C37 /* Release */, 612 | ); 613 | defaultConfigurationIsVisible = 0; 614 | defaultConfigurationName = Release; 615 | }; 616 | A612721C2039FD13009DD95B /* Build configuration list for PBXProject "Black80211" */ = { 617 | isa = XCConfigurationList; 618 | buildConfigurations = ( 619 | A612722A2039FD13009DD95B /* Debug */, 620 | A612722B2039FD13009DD95B /* Release */, 621 | ); 622 | defaultConfigurationIsVisible = 0; 623 | defaultConfigurationName = Release; 624 | }; 625 | A612722C2039FD13009DD95B /* Build configuration list for PBXNativeTarget "Black80211_Sierra" */ = { 626 | isa = XCConfigurationList; 627 | buildConfigurations = ( 628 | A612722D2039FD13009DD95B /* Debug */, 629 | A612722E2039FD13009DD95B /* Release */, 630 | ); 631 | defaultConfigurationIsVisible = 0; 632 | defaultConfigurationName = Release; 633 | }; 634 | A6881FFE209A29A4009B1576 /* Build configuration list for PBXNativeTarget "Black80211_HighSierra" */ = { 635 | isa = XCConfigurationList; 636 | buildConfigurations = ( 637 | A6881FFF209A29A4009B1576 /* Debug */, 638 | A6882000209A29A4009B1576 /* Release */, 639 | ); 640 | defaultConfigurationIsVisible = 0; 641 | defaultConfigurationName = Release; 642 | }; 643 | /* End XCConfigurationList section */ 644 | }; 645 | rootObject = A61272192039FD13009DD95B /* Project object */; 646 | } 647 | --------------------------------------------------------------------------------