Compare commits

...

2 Commits

Author SHA1 Message Date
ca1b59e4c6 Choose and set addresses to packet 2021-11-22 12:43:16 +01:00
5ecc7ed383 Added bssid to packet 2021-11-22 12:39:51 +01:00
2 changed files with 10 additions and 1 deletions

View File

@ -8,6 +8,7 @@ struct Packet {
std::string srcMac;
std::string dstMac;
std::string bssid;
unsigned int payloadSize;

View File

@ -54,7 +54,15 @@ void textPacketHandler(std::vector<std::string> textPacket){
int raIndex = findContains(headerData, "RA:", 1);
std::string rAddr = (raIndex != -1) ? headerData[raIndex].substr("RA:"s.length()) : "";
// Depending of when which address-fields are actually set, choose which ones to use
if(sAddr == "" && tAddr != "") sAddr = tAddr;
if(dAddr == "" && rAddr != "") dAddr = rAddr;
// Set addresses to packet
packet.srcMac = sAddr;
packet.dstMac = dAddr;
packet.bssid = bssidAddr;
}
#endif /* EE781A91_6D07_47AC_B3C4_F99E29F3731F */