Beispiel #1
0
void ieee802_11_mgmt_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
                        u16 stype, int ok)
{
    struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) buf;

    switch (stype) {
    case WLAN_FC_STYPE_AUTH:
        HOSTAPD_DEBUG(HOSTAPD_DEBUG_MINIMAL, "mgmt::auth cb\n");
        handle_auth_cb(hapd, mgmt, len, ok);
        break;
    case WLAN_FC_STYPE_ASSOC_RESP:
        HOSTAPD_DEBUG(HOSTAPD_DEBUG_MINIMAL,
                      "mgmt::assoc_resp cb\n");
        handle_assoc_cb(hapd, mgmt, len, 0, ok);
        break;
    case WLAN_FC_STYPE_REASSOC_RESP:
        HOSTAPD_DEBUG(HOSTAPD_DEBUG_MINIMAL,
                      "mgmt::reassoc_resp cb\n");
        handle_assoc_cb(hapd, mgmt, len, 1, ok);
        break;
    default:
        printf("unknown mgmt cb frame subtype %d\n", stype);
        break;
    }
}
Beispiel #2
0
/**
 * ieee802_11_mgmt_cb - Process management frame TX status callback
 * @hapd: hostapd BSS data structure (the BSS from which the management frame
 * was sent from)
 * @buf: management frame data (starting from IEEE 802.11 header)
 * @len: length of frame data in octets
 * @stype: management frame subtype from frame control field
 * @ok: Whether the frame was ACK'ed
 */
void ieee802_11_mgmt_cb(struct hostapd_data *hapd, const u8 *buf, size_t len,
			u16 stype, int ok)
{
	const struct ieee80211_mgmt *mgmt;
	mgmt = (const struct ieee80211_mgmt *) buf;

	switch (stype) {
	case WLAN_FC_STYPE_AUTH:
		wpa_printf(MSG_DEBUG, "mgmt::auth cb");
		handle_auth_cb(hapd, mgmt, len, ok);
		break;
	case WLAN_FC_STYPE_ASSOC_RESP:
		wpa_printf(MSG_DEBUG, "mgmt::assoc_resp cb");
		handle_assoc_cb(hapd, mgmt, len, 0, ok);
		break;
	case WLAN_FC_STYPE_REASSOC_RESP:
		wpa_printf(MSG_DEBUG, "mgmt::reassoc_resp cb");
		handle_assoc_cb(hapd, mgmt, len, 1, ok);
		break;
	case WLAN_FC_STYPE_PROBE_RESP:
		wpa_printf(MSG_DEBUG, "mgmt::proberesp cb");
		break;
	case WLAN_FC_STYPE_DEAUTH:
		/* ignore */
		break;
	case WLAN_FC_STYPE_ACTION:
		wpa_printf(MSG_DEBUG, "mgmt::action cb");
		break;
	default:
		printf("unknown mgmt cb frame subtype %d\n", stype);
		break;
	}
}