2011-11-13 17:56:26 +01:00
|
|
|
/*
|
|
|
|
* Common driver-related functions
|
|
|
|
* Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
|
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2011-11-13 17:56:26 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "includes.h"
|
|
|
|
#include "utils/common.h"
|
|
|
|
#include "driver.h"
|
|
|
|
|
|
|
|
void wpa_scan_results_free(struct wpa_scan_results *res)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
if (res == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < res->num; i++)
|
|
|
|
os_free(res->res[i]);
|
|
|
|
os_free(res->res);
|
|
|
|
os_free(res);
|
|
|
|
}
|
2011-11-13 18:01:38 +01:00
|
|
|
|
|
|
|
|
|
|
|
const char * event_to_string(enum wpa_event_type event)
|
|
|
|
{
|
2011-11-13 18:06:37 +01:00
|
|
|
#define E2S(n) case EVENT_ ## n: return #n
|
2011-11-13 18:01:38 +01:00
|
|
|
switch (event) {
|
2011-11-13 18:06:37 +01:00
|
|
|
E2S(ASSOC);
|
|
|
|
E2S(DISASSOC);
|
|
|
|
E2S(MICHAEL_MIC_FAILURE);
|
|
|
|
E2S(SCAN_RESULTS);
|
|
|
|
E2S(ASSOCINFO);
|
|
|
|
E2S(INTERFACE_STATUS);
|
|
|
|
E2S(PMKID_CANDIDATE);
|
|
|
|
E2S(STKSTART);
|
|
|
|
E2S(TDLS);
|
|
|
|
E2S(FT_RESPONSE);
|
|
|
|
E2S(IBSS_RSN_START);
|
|
|
|
E2S(AUTH);
|
|
|
|
E2S(DEAUTH);
|
|
|
|
E2S(ASSOC_REJECT);
|
|
|
|
E2S(AUTH_TIMED_OUT);
|
|
|
|
E2S(ASSOC_TIMED_OUT);
|
|
|
|
E2S(FT_RRB_RX);
|
|
|
|
E2S(WPS_BUTTON_PUSHED);
|
|
|
|
E2S(TX_STATUS);
|
|
|
|
E2S(RX_FROM_UNKNOWN);
|
|
|
|
E2S(RX_MGMT);
|
|
|
|
E2S(RX_ACTION);
|
|
|
|
E2S(REMAIN_ON_CHANNEL);
|
|
|
|
E2S(CANCEL_REMAIN_ON_CHANNEL);
|
|
|
|
E2S(MLME_RX);
|
|
|
|
E2S(RX_PROBE_REQ);
|
|
|
|
E2S(NEW_STA);
|
|
|
|
E2S(EAPOL_RX);
|
|
|
|
E2S(SIGNAL_CHANGE);
|
|
|
|
E2S(INTERFACE_ENABLED);
|
|
|
|
E2S(INTERFACE_DISABLED);
|
|
|
|
E2S(CHANNEL_LIST_CHANGED);
|
|
|
|
E2S(INTERFACE_UNAVAILABLE);
|
|
|
|
E2S(BEST_CHANNEL);
|
|
|
|
E2S(UNPROT_DEAUTH);
|
|
|
|
E2S(UNPROT_DISASSOC);
|
|
|
|
E2S(STATION_LOW_ACK);
|
|
|
|
E2S(P2P_DEV_FOUND);
|
|
|
|
E2S(P2P_GO_NEG_REQ_RX);
|
|
|
|
E2S(P2P_GO_NEG_COMPLETED);
|
|
|
|
E2S(P2P_PROV_DISC_REQUEST);
|
|
|
|
E2S(P2P_PROV_DISC_RESPONSE);
|
|
|
|
E2S(P2P_SD_REQUEST);
|
|
|
|
E2S(P2P_SD_RESPONSE);
|
|
|
|
E2S(IBSS_PEER_LOST);
|
|
|
|
E2S(DRIVER_GTK_REKEY);
|
|
|
|
E2S(SCHED_SCAN_STOPPED);
|
|
|
|
E2S(DRIVER_CLIENT_POLL_OK);
|
2011-11-19 12:00:30 +01:00
|
|
|
E2S(EAPOL_TX_STATUS);
|
2012-06-25 13:45:14 +02:00
|
|
|
E2S(CH_SWITCH);
|
2012-02-26 16:22:02 +01:00
|
|
|
E2S(WNM);
|
2013-02-07 14:24:53 +01:00
|
|
|
E2S(CONNECT_FAILED_REASON);
|
2013-05-09 18:54:18 +02:00
|
|
|
E2S(DFS_RADAR_DETECTED);
|
|
|
|
E2S(DFS_CAC_FINISHED);
|
|
|
|
E2S(DFS_CAC_ABORTED);
|
|
|
|
E2S(DFS_NOP_FINISHED);
|
2011-11-13 18:01:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return "UNKNOWN";
|
2011-11-13 18:06:37 +01:00
|
|
|
#undef E2S
|
2011-11-13 18:01:38 +01:00
|
|
|
}
|