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

Go to the source code of this file.

Functions

int libwifi_set_probe_resp_ssid (struct libwifi_probe_resp *probe_resp, const char *ssid)
 Set the SSID of a libwifi_probe_resp. More...
 
int libwifi_set_probe_resp_channel (struct libwifi_probe_resp *probe_resp, uint8_t channel)
 Set the channel of a libwifi_probe_resp. More...
 
size_t libwifi_get_probe_resp_length (struct libwifi_probe_resp *probe_resp)
 Calculate the length of a given libwifi_probe_resp. More...
 
int libwifi_create_probe_resp (struct libwifi_probe_resp *probe_resp, 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 probe_resp. More...
 
size_t libwifi_dump_probe_resp (struct libwifi_probe_resp *probe_resp, unsigned char *buf, size_t buf_len)
 Dump a libwifi_probe_resp into a raw format for packet injection. More...
 
void libwifi_free_probe_resp (struct libwifi_probe_resp *probe_resp)
 Free any memory claimed by a libwifi_probe_resp back to the system. More...
 

Function Documentation

◆ libwifi_create_probe_resp()

int libwifi_create_probe_resp ( struct libwifi_probe_resp probe_resp,
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 probe_resp.

A generated libwifi probe_resp can be "dumped" into a buffer for packet injection via the libwifi_dump_probe_resp.

Parameters
probe_respA libwifi_probe_resp
receiverThe receiver MAC address, aka address 1
transmitterThe source MAC address, aka address 2
address3The address 3 frame field value, typically the BSSID
ssidThe SSID of the probe_resp. Maximum length is 32 characters
channelThe desired channel of the probe_resp
Returns
Zero on success, or negative error

Generate a populated libwifi probe_resp.

Two tagged parameters are also added to the probe response: SSID and Channel.

Definition at line 81 of file probe_response.c.

◆ libwifi_dump_probe_resp()

size_t libwifi_dump_probe_resp ( struct libwifi_probe_resp probe_resp,
unsigned char *  buf,
size_t  buf_len 
)

Dump a libwifi_probe_resp into a raw format for packet injection.

Parameters
probe_respA libwifi_probe_resp
bufThe output buffer for the frame data
buf_lenThe length of the output buffer
Returns
The length of the dumped probe_resp, or negative error

Dump a libwifi_probe_resp into a raw format for packet injection.

This is useful when injecting generated libwifi frames.

Definition at line 115 of file probe_response.c.

◆ libwifi_free_probe_resp()

void libwifi_free_probe_resp ( struct libwifi_probe_resp probe_resp)

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

Parameters
probe_respA libwifi_probe_resp

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

Definition at line 138 of file probe_response.c.

◆ libwifi_get_probe_resp_length()

size_t libwifi_get_probe_resp_length ( struct libwifi_probe_resp probe_resp)

Calculate the length of a given libwifi_probe_resp.

Parameters
probe_respA libwifi_probe_resp struct
Returns
The length of the given probe_resp, or negative error

Calculate the length of a given libwifi_probe_resp.

Definition at line 33 of file probe_response.c.

◆ libwifi_set_probe_resp_channel()

int libwifi_set_probe_resp_channel ( struct libwifi_probe_resp probe_resp,
uint8_t  channel 
)

Set the channel of a libwifi_probe_resp.

Parameters
probe_respA libwifi_probe_resp struct
channelThe new channel
Returns
Zero on success, or negative error

Set the channel of a libwifi_probe_resp.

Definition at line 60 of file probe_response.c.

◆ libwifi_set_probe_resp_ssid()

int libwifi_set_probe_resp_ssid ( struct libwifi_probe_resp probe_resp,
const char *  ssid 
)

Set the SSID of a libwifi_probe_resp.

Parameters
probe_respA libwifi_probe_resp struct
ssidThe new SSID
Returns
Zero on success, or negative error

Set the SSID of a libwifi_probe_resp.

Definition at line 42 of file probe_response.c.