17#include "../../parse/misc/radiotap.h"
18#include "../misc/byteswap.h"
19#include "../radiotap/radiotap.h"
38 size_t header_len = 0;
39 size_t frame_data_len = frame_len;
40 unsigned char *frame_data = malloc(frame_data_len);
41 memcpy(frame_data, (
unsigned char *) frame, frame_data_len);
48 frame_data_len -= rtap_info.
length;
49 unsigned char *new_data = malloc(frame_data_len);
50 memcpy(new_data, frame_data + rtap_info.
length, frame_data_len);
52 frame_data = new_data;
57 frame_data_len -=
sizeof(uint32_t);
58 frame_data = realloc(frame_data, frame_data_len);
59 if (frame_data == NULL) {
87 if (frame_data_len < header_len) {
104 if (frame_data_len < header_len) {
111 if (frame_data_len < header_len) {
120 if (frame_data_len < header_len) {
131 fi->
len = frame_data_len;
@ IEEE80211_RADIOTAP_F_FCS
void libwifi_free_wifi_frame(struct libwifi_frame *fi)
Free any dynamically allocated data inside a libwifi_frame.
int libwifi_get_wifi_frame(struct libwifi_frame *fi, const unsigned char *frame, size_t frame_len, int radiotap)
Convert a sniffed 802.11 frame into a libwifi_frame.
@ SUBTYPE_DATA_QOS_CF_ACK_CF_POLL
@ SUBTYPE_DATA_QOS_CF_POLL
@ SUBTYPE_DATA_QOS_DATA_CF_POLL
@ SUBTYPE_DATA_QOS_DATA_CF_ACK
@ SUBTYPE_DATA_QOS_DATA_CF_ACK_CF_POLL
#define LIBWIFI_FLAGS_IS_ORDERED
struct libwifi_frame_ctrl frame_control
#define LIBWIFI_FLAGS_FCS_PRESENT
#define LIBWIFI_FLAGS_IS_QOS
int libwifi_parse_radiotap_info(struct libwifi_radiotap_info *info, const unsigned char *frame, size_t frame_len)
The libwifi radiotap parser uses the usual ieee80211_radiotap_iterator to parse incoming radiotap hea...
struct libwifi_frame_ctrl_flags flags
union libwifi_frame_header header
struct libwifi_frame_ctrl frame_control