libwifi 0.0.3
An 802.11 Frame Parsing and Generation library in C
probe_request.c File Reference
#include "probe_request.h"
#include "../../core/misc/byteswap.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

size_t libwifi_get_probe_req_length (struct libwifi_probe_req *probe_req)
 The length of a probe request frame is the sum of the header length plus the tagged parameters length. 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)
 The generated probe request frame is made with sane defaults defined in common.h. More...
 
size_t libwifi_dump_probe_req (struct libwifi_probe_req *probe_req, unsigned char *buf, size_t buf_len)
 Copy a libwifi_probe_req into a regular unsigned char buffer. More...
 
void libwifi_free_probe_req (struct libwifi_probe_req *probe_req)
 Because the tagged parameters memory is managed inside of the library, the library must be the one to free it, too. 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 
)

The generated probe request frame is made with sane defaults defined in common.h.

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 
)

Copy a libwifi_probe_req into a regular unsigned char buffer.

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)

Because the tagged parameters memory is managed inside of the library, the library must be the one to free it, too.

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)

The length of a probe request frame is the sum of the header length plus the tagged parameters length.

Calculate the length of a given libwifi_probe_req.

Definition at line 26 of file probe_request.c.