-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* optimizied by removing redundant requests * fixed number of hosts calculation * added mac identification * added oui query by mac to identify manufacturer * option scanPorts renamed to host info
- Loading branch information
Showing
2 changed files
with
122 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
#include <WiFi.h> | ||
#include <ESPping.h> | ||
#include <WiFi.h> | ||
#include <esp_log.h> | ||
|
||
#include "lwip/etharp.h" | ||
// sets number of maximum of pending requests to table size | ||
#define ARP_MAXPENDING ARP_TABLE_SIZE | ||
|
||
struct Host { | ||
Host(ip4_addr_t* ip, eth_addr* eth) : ip(ip->addr){ | ||
char macStr[18]; | ||
snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x", | ||
eth->addr[0], eth->addr[1], eth->addr[2], | ||
eth->addr[3], eth->addr[4], eth->addr[5]); | ||
mac = macStr; | ||
} | ||
IPAddress ip; | ||
String mac; | ||
}; | ||
|
||
void local_scan_setup(); | ||
|
||
void scanPorts(IPAddress host); | ||
void hostInfo(const Host& host); | ||
|
||
void afterScanOptions(IPAddress ip); | ||
void afterScanOptions(const Host& ip); |