CocoaDev

Edit AllPages

Apple80211.framework is private APIs relating to the wireless link. The header is available at http://www.macstumbler.com/Apple80211.h and copied here for posterity:

/*

/* ChangeLog:

2002-05-14 ragge
Changed argument types and count to procedures
Added WirelessScan
Changed name of unknown field to beaconInterval
Added error values and error return types

2002-05-15 korben
Combined ragge's changes with jason's

2002-05-17 korben
fixed adhoc and mangaged WINetworkInfoFlags per ragge's request
Added WirelessEncrypt and WirelessKey declarations
Updated WirelessJoinWEP and WirelessMakeIBSS comments regarding keys

*/

#ifndef APPLE_80211 #define APPLE_80211

#include <CoreFoundation/CoreFoundation.h>

/* A WirelessContext should be created using WirelessAttach before any other Wireless functions are called. WirelessDetach is used to dispose of a WirelessContext. */ typedef struct __WirelessContext *WirelessContextPtr;

struct WirelessInfo { UInt16 link_qual; /* Link quality, percent? / UInt16 comms_qual; / Communication Quality / UInt16 signal; / Signal level / UInt16 noise; / Noise level / UInt16 port_stat; / HERMES_RID_PORTSTAT? (Uncertain about the meaning of this! 1=off? 2=connetion bad? 3=AdHoc Create? 4=BSS (Client)? 5=BSS+OutOfRange?) / UInt16 client_mode; / 1 = BSS, 4 = Create IBSS / UInt16 u7; / ? / UInt16 power; / Power on flag / UInt16 u9; / 0=bad?, 1=ok?, 2=wrong key? / UInt8 macAddress[6]; / MAC address of wireless access point. / SInt8 name[34]; / Name of current (or wanted?) network. / }; typedef struct WirelessInfo WirelessInfo; / I’m not sure what most of the values in the WirelessInfo structure are for, but here are some examples of the numbers returned:

With Airport Off: 0 0 0 0 1 1 0 0 1 With Airport On: 72 22 31 9 4 1 0 1 1 With Computer to Computer Network: 0 0 0 0 3 4 0 1 1 - jason

*/

/* WINetworkInfoFlags are used in the WirelessNetworkInfo struct returned by the WirelessScanSplit function.

I filled in the rest of this list from the netstumbler FAQ: http://www.netstumbler.com/modules.php?op=modload&name=FAQ&file=index&myfaq=yes&id_cat=1&categories=Official+NetStumbler+Version+0.3+FAQ These are aparrently also defined in section 7.3.1.4 of the 802.11b spec

*/ typedef UInt16 WINetworkInfoFlags; enum { kWINetworkManagedFlag = 0x0001, kWINetworkAdhocFlag = 0x0002, kWINetworkCFPollable = 0x0004, kWINetworkCFPollRequest = 0x0008, kWINetworkEncryptedFlag = 0x0010, kWINetworkShortPreamble = 0x0020, kWINetworkPBCC = 0x0040, kWINetworkChannelAgility = 0x0080, kWINetworkReserved = 0xFF00

};

typedef SInt32 WIErr; enum { airpParamErr = -2013261823, /* 0x88001001 / airpNoIOServiceErr = -2013261822, / 0x88001002 / airpInternalErr = -2013261821, / 0x88001003 / airpUnk4Err = -2013261820, / 0x88001004 / airpOutOfMemErr = -2013261819, / 0x88001005 / airpInternal2Err = -2013261818, / 0x88001006 / airpUnk7Err = -2013261817, / 0x88001007 / airpUnk8Err = -2013261816, / 0x88001008 / airpUnk9Err = -2013261815, / 0x88001009 / airpUnkaErr = -2013261814, / 0x8800100a / airpNoPowerErr = -2013261813 / 0x8800100b / }; / The meaning of these error codes can be wrong, and the list is not

struct WirelessNetworkInfo { UInt16 channel; /* Channel for the network. / UInt16 noise; / Noise for the network. 0 for Adhoc. / UInt16 signal; / Signal strength of the network. 0 for Adhoc. / UInt8 macAddress[6]; / MAC address of the wireless access point. / UInt16 beaconInterval; / beacon interval in milliseconds / WINetworkInfoFlags flags; / Flags for the network. */ UInt16 nameLen; SInt8 name[32]; }; typedef struct WirelessNetworkInfo WirelessNetworkInfo;

typedef UInt8 WirelessKey[13]; // For use with WirelessEncrypt

/*

/*

/*

/*

/*

/*

/*

/*

/*

extern WIErr WirelessScan( WirelessContextPtr inContext, CFArrayRef *apList, const UInt32 stripDups);

/*

/*

/*

/*

/*

/*

/*

/* *** MISSING FUNCTIONS ***

These functions are used to configure an Access Point (Base Station). Most of these are used by the Airport Admin Utility.app, and some like WirelessAP_GetStatus are even used by Internet Connect.app. - jason WirelessAP_BinaryCurrentVersion WirelessAP_BinaryCurrentVersion2 WirelessAP_BinaryIsCurrent WirelessAP_BinaryUpload WirelessAP_BinaryUploadACP WirelessAP_BinaryVersion WirelessAP_Dial WirelessAP_DialDynamic WirelessAP_Explore WirelessAP_ForceIPAddress WirelessAP_GetBridgeStatus WirelessAP_GetCommonVariables WirelessAP_GetCommonVariablesACP WirelessAP_GetFullStatus WirelessAP_GetModemVersion WirelessAP_GetModemVersionACP WirelessAP_GetStatus WirelessAP_GetType WirelessAP_GetVersion WirelessAP_Hangup WirelessAP_IsConnected WirelessAP_Read WirelessAP_ReadACP WirelessAP_ResetNVRAM WirelessAP_Restart WirelessAP_RestartACP WirelessAP_Write WirelessAP_WriteACP I can’t find any apps that use these functions. - jason WirelessAccessPoint WirelessConfigure WirelessDownloadFW WirelessSetKey

*/

#endif // APPLE_80211


I’ve got some code to let the driver call arbitrary ioctls on the card. I’ll dig it up and upload it. – themacuser