⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wps_wlandrv.h

📁 WiFi Protected Setup (WPS) 又叫Simple config。 是无线局域网领域推出的新协议
💻 H
字号:
/*
 *  WPS_WLANDRV.H : WPS WLAN Driver Interface
 * 
 *  ver       date        author      comment
 *  0.0.1     07/12/25    Gao Hua     First
 */

#ifndef _WPS_WLANDRV_H
#define _WPS_WLANDRV_H

#include "wps_types.h"


#define MAX_WPS_IE_DATA_LENGTH		200
typedef struct _tag_wps_ie {
    WPS_u8     elementID;        /* 1 byte element ID */
    WPS_u8     length;           /* Length field */
    WPS_u8     oui[4];
    WPS_u8     data[MAX_WPS_IE_DATA_LENGTH];
}WPS_IE;

typedef struct _tag_wps_ap_desc {
    WPS_char     ssid[33];    /* Variable size 0-32 array of characters */
    WPS_u8       bssid[6];
    WPS_u8       isPrivacyBitSet;
    WPS_IE       wpsIE;
}WPS_AP_DESC;

typedef struct _tag_wlandrv_info {
    WPS_u8       mac[6];
	WPS_u8       manufacturer[64];
	WPS_u8       modelName[32];
	WPS_u8       modelNumber[32];
	WPS_u8       serialNumber[32];
	WPS_u8       deviceName[32];
}WLANDRV_INFO;

typedef enum _tag_eapol_event {
	EAPOL_EVENT_RECV_PACKET	= 0x0001,
	EAPOL_EVENT_CONNECT		= 0x0002,
	EAPOL_EVENT_DISCONNECT	= 0x0003,
}EAPOL_EVENT;

/*
 *  If 'event' is EAPOL_EVENT_RECV_PACKET, 'data' points to the EAP packet data, 'data_len' is EAP packet length (including EAP head length).
 *  If 'event' is EAPOL_EVENT_CONNECT or EAPOL_EVENT_DISCONNECT, 'data' and 'data_len' is ignored.
*/
typedef void (*EAPOL_LISTENER)(EAPOL_EVENT event, const void *data, int data_len);


/* Function:
 *  Gets the list of AP which supports WPS from the WLAN driver, the WLAN driver may need to scan before give a result.
 * Parameter:
 *  apDescArray: Start pointer of a WPS_AP_DESC array which is to receive AP list
 *       nCount: Number of elements the array has
 * Return value:
 *  -1: Error occurred
 *   n: Number of APs returned (n = 0,1,2...)
*/
int Wlan_GetWpsApList(WPS_AP_DESC *apDescArray, int nCount);


/* Function:
 *  Associates with the specified AP
 * Parameter:
 *  apDesc: An AP descriptor specifying the AP to associate with
 * Return value:
 *  -1: Error occurred
 *   0: Associated successfully
*/
int Wlan_Associate(WPS_AP_DESC *apDesc);


/* Function: 
 *  Disassociates from the current AP
 * Parameter:
 *  NULL
 * Return value:
 *  -1: Error occurred
 *   0: Disassociated successfully
*/
int Wlan_Disassociate(void);


/* Function: 
 *  Checks if the WLAN driver is currently associated with an AP
 * Parameter:
 *  NULL
 * Return value:
 *  1: Is associated
 *  0: Not associated
*/
WPS_u8 Wlan_IsAssociated(void);


/* Function: 
 *  Get the current AP's SSID. If not associated, return ERROR.
 * Parameter:
 *   SsidBuff: Pointer of a buffer which is to receive the SSID string
 *    BuffLen: Length of the buffer
 * Return value:
 *  -1: Error occurred
 *   n: Length of SSID string
*/
int Wlan_GetApSsid(WPS_u8 *SsidBuff, WPS_s32 BuffLen);


/* Function: 
 *  Gets the information of WLAN driver
 * Parameter:
 *   infoBuff: Pointer of a buffer which is to receive WLAN driver information
 * Return value:
 *  -1: Error occurred
 *   0: Successful
*/
int Wlan_GetWlanDrvInfo(WLANDRV_INFO *infoBuff);


#if 0
/* Function: 
 *  Sets WPS IEs to be placed in 802.11 management packets
 * Parameter:
 *  type: Type of management packet (probe request, AssocReassoc request...)
 *    ie: Pointer to a WPS IE struct
 * Return value:
 *  NULL
*/
void Wlan_SetWpsIE(WPS_IE_TYPE type, WPS_IE *ie);
#endif


/* Function: 
 *  Sends an EAP packet through WLAN interface
 * Parameter:
 *  dataBuf: EAP data starting from the EAP header
 *  dataLen: EAP data length (including EAP head length)
 * Return value:
 *  -1: Error occured
 *   0: Successful
*/
int Wlan_SendEapPacket(WPS_u8 *dataBuf, int dataLen);


/* Function: 
 *  Adds a listener for EAPOL events
 * Parameter:
 *  listener: Pointer to a function which is called by WLAN module when a event occurs
 * Return value:
 *  -1: Error occured
 *   0: Successful
*/
int Wlan_AddEapolListener(EAPOL_LISTENER listener);


/* Function: 
 *  Removes the previously added listener
 * Parameter:
 *  NULL
 * Return value:
 *  -1: Error occured
 *   0: Successful
*/
int Wlan_RemoveEapolListener(void);


#endif /* _WPS_WLANDRV_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -