2018-07-31 10:05:32 +02:00
|
|
|
#ifndef _WIFISCAN_H
|
|
|
|
#define _WIFISCAN_H
|
|
|
|
|
|
|
|
// ESP32 Functions
|
|
|
|
#include <esp_wifi.h>
|
|
|
|
|
|
|
|
// Hash function for scrambling MAC addresses
|
|
|
|
#include "hash.h"
|
|
|
|
|
|
|
|
#define MAC_SNIFF_WIFI 0
|
|
|
|
#define MAC_SNIFF_BLE 1
|
|
|
|
|
2018-11-25 11:48:03 +01:00
|
|
|
/*
|
2018-07-31 10:05:32 +02:00
|
|
|
typedef struct {
|
|
|
|
unsigned frame_ctrl : 16;
|
|
|
|
unsigned duration_id : 16;
|
2018-11-25 11:48:03 +01:00
|
|
|
uint8_t addr1[6]; // receiver address
|
|
|
|
uint8_t addr2[6]; // sender address
|
|
|
|
uint8_t addr3[6]; // filtering address
|
2018-07-31 10:05:32 +02:00
|
|
|
unsigned sequence_ctrl : 16;
|
2018-11-25 11:48:03 +01:00
|
|
|
uint8_t addr4[6]; // optional
|
2018-07-31 10:05:32 +02:00
|
|
|
} wifi_ieee80211_mac_hdr_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
wifi_ieee80211_mac_hdr_t hdr;
|
2018-11-25 11:48:03 +01:00
|
|
|
uint8_t payload[0]; // network data ended with 4 bytes csum (CRC32)
|
2018-07-31 10:05:32 +02:00
|
|
|
} wifi_ieee80211_packet_t;
|
2018-11-25 11:48:03 +01:00
|
|
|
*/
|
2018-07-31 10:05:32 +02:00
|
|
|
|
|
|
|
void wifi_sniffer_init(void);
|
2018-09-30 15:08:00 +02:00
|
|
|
void IRAM_ATTR wifi_sniffer_packet_handler(void *buff, wifi_promiscuous_pkt_type_t type);
|
2018-09-27 14:01:23 +02:00
|
|
|
void switchWifiChannel(void * parameter);
|
2018-07-31 10:05:32 +02:00
|
|
|
|
|
|
|
#endif
|