MCPcopy Create free account
hub / github.com/BruceDevices/firmware / processResponseQueue

Function processResponseQueue

src/modules/wifi/karma_attack.cpp:1428–1476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1426}
1427
1428void processResponseQueue() {
1429 unsigned long now = millis();
1430 while (!responseQueue.empty()) {
1431 ProbeResponseTask &task = responseQueue.front();
1432 if (now - task.timestamp > RESPONSE_TIMEOUT_MS) {
1433 responseQueue.pop();
1434 continue;
1435 }
1436 uint8_t responseFrame[256];
1437 size_t frameLen = buildEnhancedProbeResponse(
1438 responseFrame, task.ssid, task.targetMAC, task.channel, task.rsn, false
1439 );
1440 if (sendRawFrameOnAp(responseFrame, frameLen, task.channel)) {
1441 karmaResponsesSent++;
1442 if (networkHistory.size() < MAX_NETWORK_HISTORY) {
1443 auto it = networkHistory.find(task.ssid);
1444 if (it == networkHistory.end()) {
1445 NetworkHistory history;
1446 history.ssid = task.ssid;
1447 history.responsesSent = 1;
1448 history.lastResponse = now;
1449 history.successfulConnections = 0;
1450 networkHistory[task.ssid] = history;
1451 } else {
1452 it->second.responsesSent++;
1453 it->second.lastResponse = now;
1454 }
1455 }
1456 bool found = false;
1457 for (auto &net : activeNetworks) {
1458 if (net.ssid == task.ssid) {
1459 found = true;
1460 net.lastActivity = now;
1461 break;
1462 }
1463 }
1464 if (!found && activeNetworks.size() < MAX_CONCURRENT_SSIDS) {
1465 ActiveNetwork net;
1466 net.ssid = task.ssid;
1467 net.channel = task.channel;
1468 net.rsn = task.rsn;
1469 net.lastActivity = now;
1470 net.lastBeacon = 0;
1471 activeNetworks.push_back(net);
1472 }
1473 }
1474 responseQueue.pop();
1475 }
1476}
1477
1478void processQueuedProbeEvents() {
1479 if (!karmaQueue) return;

Callers 2

queueProbeResponseFunction · 0.85
karma_setupFunction · 0.85

Calls 5

millisFunction · 0.85
sendRawFrameOnApFunction · 0.85
sizeMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected