-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring_utils.cpp
More file actions
62 lines (53 loc) · 1.58 KB
/
Copy pathstring_utils.cpp
File metadata and controls
62 lines (53 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "sdk_structs.h"
#include "ieee80211_structs.h"
//Returns a human-readable string from a binary MAC address.
void mac2str(const uint8_t* ptr, char* string)
{
sprintf(string, "%02x:%02x:%02x:%02x:%02x:%02x", ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5]);
return;
}
//Parses 802.11 packet type-subtype pair into a human-readable string
const char* wifi_pkt_type2str(wifi_promiscuous_frame_type_t type, wifi_mgmt_subtypes_t subtype)
{
switch(type)
{
case WIFI_PKT_MGMT:
switch(subtype)
{
case ASSOCIATION_REQ:
return "Mgmt: Association request";
case ASSOCIATION_RES:
return "Mgmt: Association response";
case REASSOCIATION_REQ:
return "Mgmt: Reassociation request";
case REASSOCIATION_RES:
return "Mgmt: Reassociation response";
case PROBE_REQ:
return "Mgmt: Probe request";
case PROBE_RES:
return "Mgmt: Probe response";
case BEACON:
return "Mgmt: Beacon frame";
case ATIM:
return "Mgmt: ATIM";
case DISASSOCIATION:
return "Mgmt: Dissasociation";
case AUTHENTICATION:
return "Mgmt: Authentication";
case DEAUTHENTICATION:
return "Mgmt: Deauthentication";
case ACTION:
return "Mgmt: Action";
case ACTION_NACK:
return "Mgmt: Action no ack";
default:
return "Mgmt: Unsupported/error";
}
case WIFI_PKT_CTRL:
return "Control";
case WIFI_PKT_DATA:
return "Data";
default:
return "Unsupported/error";
}
}