worked on wifi-scanner for linux

new time-grouping for vap grouper
adjusted test-cases
minor changes/fixes/improvements
This commit is contained in:
2017-10-11 14:00:24 +02:00
parent 628be72e1f
commit da477866c1
13 changed files with 649 additions and 223 deletions

View File

@@ -0,0 +1,47 @@
#ifndef INDOOR_WIFIRAW_H
#define INDOOR_WIFIRAW_H
#include <iostream>
/**
* parse raw binary wifi packets as defined within the standard
*/
class WiFiRAW {
public:
enum Tags {
TAG_SSID = 0x00
};
struct TaggedParams {
std::string ssid;
};
/** parsed tagged params within wifi packets: [tag][len][len-bytes][tag][len][len-bytes]... */
static TaggedParams parseTaggedParams(const uint8_t* data, const size_t len) {
TaggedParams res;
int pos = 0;
while(pos < len) {
const int tag = data[pos+0]; // the tag-ID
const int len = data[pos+1]; // the lenght of the following data
switch(tag) {
case TAG_SSID: res.ssid = std::string( (const char*) &(data[pos+2]), len); break;
}
// position at the start of the next tag
pos += 1 + 1 + len;
}
return res;
}
};
#endif // INDOOR_WIFIRAW_H