-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathutils.h
More file actions
137 lines (107 loc) · 2.13 KB
/
Copy pathutils.h
File metadata and controls
137 lines (107 loc) · 2.13 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#ifndef _UTILS_H
#define _UTILS_H
#include <esp_system.h>
#include "sniffer.h"
/**
* @brief Check if a MAC Address is broadcast
*
* @param mac
* @return true
* @return false
*/
bool isMacBroadcast(const uint8_t *mac);
/**
* @brief Check if a MAC Address is Zero
*
* @param mac
* @return true
* @return false
*/
bool isMacZero(uint8_t *mac);
/**
* @brief Check if two MAC Addresses are equal
*
* @param mac1
* @param mac2
* @return true
* @return false
*/
bool isMacEqual(const uint8_t *mac1, const uint8_t *mac2);
/**
* @brief Convert MAC String to byte array
*
* @param mac_str MAC String char array
* @param mac_out Pointer to byte array
*/
bool macstr_to_bytes(const char *mac_str, uint8_t *mac_out);
/**
* @brief Print packet bytes
*
* @param data
* @param len
*/
void print_packet(uint8_t *data, size_t len);
/**
* @brief Print buffer data
*
* @param buffer
* @param len
*/
void print_buffer(uint8_t *buffer, size_t len);
/**
* @brief Print handshake information
*
* @param handshake
*/
void print_handshake(handshake_info_t *handshake);
/**
* @brief Get the Next Wifi Channel
*
* @param current_channel
* @return uint8_t
*/
uint8_t getNextChannel(uint8_t current_channel);
/**
* @brief Convert wifi_auth_mode_t to string
*
* @param m
* @return const char*
*/
const char *authmode_to_str(wifi_auth_mode_t m);
/**
* @brief Convert wifi_phy_rate_t to string
*
* @param rate
* @return const char*
*/
const char *wifi_rate_to_str(wifi_phy_rate_t rate);
/**
* @brief Convert wifi deauth reason to string
*
* @param reason
* @return const char*
*/
const char *wifi_deauth_reason_to_str(uint16_t reason);
/**
* @brief Hex dump bytes
*
* @param tag
* @param buf
* @param len
*/
void hex_dump_bytes(const char *tag, const uint8_t *buf, size_t len);
/**
* @brief Resolve MAC OUI to Vendor Name
*
* @param mac
* @return const char*
*/
const char* resolve_mac_oui(const uint8_t mac[6]);
/**
* @brief Check if a WiFi channel is valid for the current hardware
*
* @param channel
* @return true
*/
bool wifi_is_valid_channel(uint8_t channel);
#endif