libwifi 0.0.3
An 802.11 Frame Parsing and Generation library in C
|
#include "../../core/frame/management/beacon.h"
Go to the source code of this file.
Functions | |
int | libwifi_set_beacon_ssid (struct libwifi_beacon *beacon, const char *ssid) |
Set the SSID of a struct libwifi_beacon. More... | |
int | libwifi_set_beacon_channel (struct libwifi_beacon *beacon, uint8_t channel) |
Set the channel of a struct libwifi_beacon. More... | |
size_t | libwifi_get_beacon_length (struct libwifi_beacon *beacon) |
Calculate the length of a given struct libwifi_beacon. More... | |
int | libwifi_create_beacon (struct libwifi_beacon *beacon, const unsigned char receiver[6], const unsigned char transmitter[6], const unsigned char address3[6], const char *ssid, uint8_t channel) |
Generate a populated libwifi beacon. More... | |
size_t | libwifi_dump_beacon (struct libwifi_beacon *beacon, unsigned char *buf, size_t buf_len) |
Dump a struct libwifi_beacon into a raw format for packet injection. More... | |
void | libwifi_free_beacon (struct libwifi_beacon *beacon) |
Free any memory claimed by a struct libwifi_beacon back to the system. More... | |
int libwifi_create_beacon | ( | struct libwifi_beacon * | beacon, |
const unsigned char | receiver[6], | ||
const unsigned char | transmitter[6], | ||
const unsigned char | address3[6], | ||
const char * | ssid, | ||
uint8_t | channel | ||
) |
Generate a populated libwifi beacon.
A generated libwifi beacon can be "dumped" into a buffer for packet injection via the libwifi_dump_beacon.
beacon | A struct libwifi_beacon |
receiver | The receiver MAC address, aka address 1 |
transmitter | The source MAC address, aka address 2 |
address3 | The address 3 frame field value, typically the BSSID |
ssid | The SSID of the beacon. Maximum length is 32 characters |
channel | The desired channel of the beacon |
Generate a populated libwifi beacon.
Two tagged parameters are also added to the beacon: SSID and Channel.
size_t libwifi_dump_beacon | ( | struct libwifi_beacon * | beacon, |
unsigned char * | buf, | ||
size_t | buf_len | ||
) |
Dump a struct libwifi_beacon into a raw format for packet injection.
beacon | A struct libwifi_beacon |
buf | The output buffer for the frame data |
buf_len | The length of the output buffer |
Dump a struct libwifi_beacon into a raw format for packet injection.
This is useful when injecting generated libwifi frames.
void libwifi_free_beacon | ( | struct libwifi_beacon * | beacon | ) |
Free any memory claimed by a struct libwifi_beacon back to the system.
beacon | A struct libwifi_beacon |
Free any memory claimed by a struct libwifi_beacon back to the system.
size_t libwifi_get_beacon_length | ( | struct libwifi_beacon * | beacon | ) |
Calculate the length of a given struct libwifi_beacon.
beacon | A libwifi_beacon struct |
Calculate the length of a given struct libwifi_beacon.
int libwifi_set_beacon_channel | ( | struct libwifi_beacon * | beacon, |
uint8_t | channel | ||
) |
Set the channel of a struct libwifi_beacon.
beacon | A struct libwifi_beacon |
channel | The new channel |
Set the channel of a struct libwifi_beacon.
int libwifi_set_beacon_ssid | ( | struct libwifi_beacon * | beacon, |
const char * | ssid | ||
) |
Set the SSID of a struct libwifi_beacon.
beacon | A struct libwifi_beacon |
ssid | The new SSID |
Set the SSID of a struct libwifi_beacon.