salt logic modified

This commit is contained in:
Klaus K Wilting 2018-04-01 20:56:18 +02:00
parent 7c906c5d6b
commit 39022e2340
3 changed files with 6 additions and 5 deletions

View File

@ -35,7 +35,7 @@ extern osjob_t sendjob;
extern uint16_t macnum, blenum, salt;
extern int countermode, screensaver, adrmode, lorasf, txpower, rlim;
extern bool joinstate;
extern std::set<uint32_t> macs;
extern std::set<uint16_t> macs;
#ifdef HAS_DISPLAY
extern HAS_DISPLAY u8x8;

View File

@ -46,7 +46,7 @@ uint16_t macnum = 0, blenum = 0, salt;
uint64_t uptimecounter = 0;
bool joinstate = false;
std::set<uint32_t> macs; // associative container holds filtered MAC adresses
std::set<uint16_t> macs; // associative container holds filtered MAC adresses
// this variable will be changed in the ISR, and read in main loop
static volatile bool ButtonTriggered = false;

View File

@ -62,8 +62,9 @@ void wifi_sniffer_packet_handler(void* buff, wifi_promiscuous_pkt_type_t type) {
char counter [6]; // uint16_t -> 2 byte -> 5 decimals + '0' terminator -> 6 chars
char macbuf [21]; // uint64_t -> 8 byte -> 20 decimals + '0' terminator -> 21 chars
uint64_t addr2int;
uint32_t vendor2int, hashedmac;
std::pair<std::set<uint32_t>::iterator, bool> newmac;
uint32_t vendor2int;
uint16_t hashedmac;
std::pair<std::set<uint16_t>::iterator, bool> newmac;
if (( cfg.rssilimit == 0 ) || (ppkt->rx_ctrl.rssi > cfg.rssilimit )) { // rssi is negative value
addr2int = ( (uint64_t)hdr->addr2[0] ) | ( (uint64_t)hdr->addr2[1] << 8 ) | ( (uint64_t)hdr->addr2[2] << 16 ) | \
@ -84,7 +85,7 @@ void wifi_sniffer_packet_handler(void* buff, wifi_promiscuous_pkt_type_t type) {
macnum++; // increment MAC counter
itoa(macnum, counter, 10); // base 10 decimal counter value
u8x8.draw2x2String(0, 0, counter);
ESP_LOGI(TAG, "#%05i: RSSI %04d -> Salt %04x -> Hash %08x", macnum, ppkt->rx_ctrl.rssi, salt, hashedmac);
ESP_LOGI(TAG, "#%05i: RSSI %04d -> Salt %04x -> Hash %04x", macnum, ppkt->rx_ctrl.rssi, salt, hashedmac);
}
#ifdef VENDORFILTER