libwifi 0.0.3
An 802.11 Frame Parsing and Generation library in C
probe_request.h File Reference
#include <stdint.h>
#include "../../core/frame/management/probe_request.h"

Go to the source code of this file.

Functions

size_t libwifi_get_probe_req_length (struct libwifi_probe_req *probe_req)
 Calculate the length of a given libwifi_probe_req. More...
 
int libwifi_create_probe_req (struct libwifi_probe_req *probe_req, 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_req. More...
 
size_t libwifi_dump_probe_req (struct libwifi_probe_req *probe_req, unsigned char *buf, size_t buf_len)
 Dump a libwifi_probe_req into a raw format for packet injection. More...
 
void libwifi_free_probe_req (struct libwifi_probe_req *probe_req)
 Free any memory claimed by a libwifi_probe_req back to the system. More...
 

Function Documentation

◆ libwifi_create_probe_req()

int libwifi_create_probe_req ( struct libwifi_probe_req probe_req,
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_req.

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

Parameters
probe_reqA libwifi_probe_req
receiverThe receiver MAC address, aka address 1
transmitterThe source MAC address, aka address 2
address3The address 3 frame field value, typically the BSSID
ssidThe probe request SSID
channelThe probe request channel
Returns
Zero on success, or negative error

Generate a populated libwifi probe_req.

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

Definition at line 34 of file probe_request.c.

◆ libwifi_dump_probe_req()

size_t libwifi_dump_probe_req ( struct libwifi_probe_req probe_req,
unsigned char *  buf,
size_t  buf_len 
)

Dump a libwifi_probe_req into a raw format for packet injection.

Parameters
probe_reqA libwifi_probe_req
bufThe output buffer for the frame data
buf_lenThe length of the output buffer
Returns
The length of the dumped probe_req, or negative error

Dump a libwifi_probe_req into a raw format for packet injection.

This is useful when injecting generated libwifi frames.

Definition at line 62 of file probe_request.c.

◆ libwifi_free_probe_req()

void libwifi_free_probe_req ( struct libwifi_probe_req probe_req)

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

Parameters
probe_reqA libwifi_probe_req

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

Definition at line 82 of file probe_request.c.

◆ libwifi_get_probe_req_length()

size_t libwifi_get_probe_req_length ( struct libwifi_probe_req probe_req)

Calculate the length of a given libwifi_probe_req.

Parameters
probe_reqA libwifi_probe_req
Returns
The length of the given probe_req, or negative error

Calculate the length of a given libwifi_probe_req.

Definition at line 26 of file probe_request.c.