libwifi 0.0.3
An 802.11 Frame Parsing and Generation library in C
reassoc_request.h File Reference

Go to the source code of this file.

Functions

int libwifi_create_reassoc_req (struct libwifi_reassoc_req *reassoc_req, const unsigned char receiver[6], const unsigned char transmitter[6], const unsigned char address3[6], const unsigned char current_ap[6], const char *ssid, uint8_t channel)
 Create a new libwifi reassociation request. More...
 
size_t libwifi_get_reassoc_req_length (struct libwifi_reassoc_req *reassoc_req)
 Get the length of a given libwifi_reassoc_req. More...
 
size_t libwifi_dump_reassoc_req (struct libwifi_reassoc_req *reassoc_req, unsigned char *buf, size_t buf_len)
 Dump a libwifi_reassoc_req into a raw format for packet injection. More...
 
void libwifi_free_reassoc_req (struct libwifi_reassoc_req *reassoc_req)
 Free any memory claimed by a libwifi_reassoc_req back to the system. More...
 

Function Documentation

◆ libwifi_create_reassoc_req()

int libwifi_create_reassoc_req ( struct libwifi_reassoc_req reassoc_req,
const unsigned char  receiver[6],
const unsigned char  transmitter[6],
const unsigned char  address3[6],
const unsigned char  current_ap[6],
const char *  ssid,
uint8_t  channel 
)

Create a new libwifi reassociation request.

Parameters
reassoc_reqA new libwifi_reassoc_req struct
receiverThe receiver MAC address
transmitterThe transmitter MAC address
address3The address 3 frame field value, typically the BSSID
current_apThe current AP BSSID
ssidThe desired BSS SSID
channelThe desired channel
Returns
Zero on success, or negative error

Create a new libwifi reassociation request.

Two tagged parameters are also added to the reassociation frame: SSID and Channel

Definition at line 37 of file reassoc_request.c.

◆ libwifi_dump_reassoc_req()

size_t libwifi_dump_reassoc_req ( struct libwifi_reassoc_req reassoc_req,
unsigned char *  buf,
size_t  buf_len 
)

Dump a libwifi_reassoc_req into a raw format for packet injection.

Parameters
reassoc_reqA libwifi_reassoc_req struct
bufThe buffer to dump into
buf_lenThe length of the supplied buffer
Returns
The amount of bytes dumped, or negative error

Dump a libwifi_reassoc_req into a raw format for packet injection.

This is useful when injecting generated libwifi frames.

Definition at line 71 of file reassoc_request.c.

◆ libwifi_free_reassoc_req()

void libwifi_free_reassoc_req ( struct libwifi_reassoc_req reassoc_req)

Free any memory claimed by a libwifi_reassoc_req back to the system.

Parameters
reassoc_reqA libwifi_reassoc_req

Free any memory claimed by a libwifi_reassoc_req back to the system.

Definition at line 94 of file reassoc_request.c.

◆ libwifi_get_reassoc_req_length()

size_t libwifi_get_reassoc_req_length ( struct libwifi_reassoc_req reassoc_req)

Get the length of a given libwifi_reassoc_req.

Parameters
reassoc_reqA libwifi_reassoc_req struct
Returns
The length of the given libwifi_reassoc_req, or negative error

Get the length of a given libwifi_reassoc_req.

Definition at line 27 of file reassoc_request.c.