libwifi 0.0.3
An 802.11 Frame Parsing and Generation library in C
|
#include <stdint.h>
#include <sys/types.h>
Go to the source code of this file.
Functions | |
uint32_t | libwifi_crc32 (const unsigned char *message, int message_len) |
Calculate the CRC32 sum of a given buffer. More... | |
uint32_t | libwifi_calculate_fcs (const unsigned char *frame, size_t frame_len) |
Calculate the frame checksum for an 802.11 frame. More... | |
int | libwifi_frame_verify (void *frame, size_t frame_len) |
Check if the given raw 802.11 frame has a valid FCS. More... | |
uint32_t libwifi_calculate_fcs | ( | const unsigned char * | frame, |
size_t | frame_len | ||
) |
uint32_t libwifi_crc32 | ( | const unsigned char * | message, |
int | message_len | ||
) |
int libwifi_frame_verify | ( | void * | frame, |
size_t | frame_len | ||
) |
Check if the given raw 802.11 frame has a valid FCS.
This function relies on an assumption that the last 4 bytes of the supplied frame is the CRC, as stated in the Radiotap specification.
You can check if the frame data has this field by using libwifi_get_wifi_frame() and then checking if the libwifi_frame's flags has the LIBWIFI_FLAGS_FCS_PRESENT bit set.
frame | An 802.11 frame with an FCS |
frame_len | Length of the frame |