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

Go to the source code of this file.

Functions

int libwifi_create_timing_advert (struct libwifi_timing_advert *adv, const unsigned char receiver[6], const unsigned char transmitter[6], const unsigned char address3[6], struct libwifi_timing_advert_fields *adv_fields, const char country[3], uint16_t max_reg_power, uint8_t max_tx_power, uint8_t tx_power_used, uint8_t noise_floor)
 Create a populated libwifi_timing_advert struct. More...
 
size_t libwifi_get_timing_advert_length (struct libwifi_timing_advert *adv)
 Get the length of the specified libwifi_timing_advert struct. More...
 
size_t libwifi_dump_timing_advert (struct libwifi_timing_advert *adv, unsigned char *buf, size_t buf_len)
 Dump a libwifi_timing_advert into a raw format for packet injection. More...
 
void libwifi_free_timing_advert (struct libwifi_timing_advert *adv)
 Free any memory claimed by a libwifi_timing_advert back to the system. More...
 

Function Documentation

◆ libwifi_create_timing_advert()

int libwifi_create_timing_advert ( struct libwifi_timing_advert adv,
const unsigned char  receiver[6],
const unsigned char  transmitter[6],
const unsigned char  address3[6],
struct libwifi_timing_advert_fields adv_fields,
const char  country[3],
uint16_t  max_reg_power,
uint8_t  max_tx_power,
uint8_t  tx_power_used,
uint8_t  noise_floor 
)

Create a populated libwifi_timing_advert struct.

A generated libwifi timing advert can be "dumped" into a buffer for packet injection via the libwifi_dump_timing_advert function.

Parameters
advA new libwifi_timing_advert struct
receiverThe receiver MAC address, aka address 1
transmitterThe source MAC address, aka address 2
address3The address 3 frame field value, typically the BSSID
adv_fieldsA libwifi_timing_advert_fields struct
countryThe ISO 3166-1 country code field value
max_reg_powerMaximum Regulatory Power value
max_tx_powerMaximum Transmit Power value
tx_power_usedTransmit Power Used value
noise_floorNoise Floor value
Returns
Zero on success, or negative errno

Definition at line 26 of file timing_ad.c.

◆ libwifi_dump_timing_advert()

size_t libwifi_dump_timing_advert ( struct libwifi_timing_advert adv,
unsigned char *  buf,
size_t  buf_len 
)

Dump a libwifi_timing_advert into a raw format for packet injection.

Parameters
advA libwifi_timing_advert
bufThe output buffer for the frame data
buf_lenThe length of the output buffer
Returns
The length of the dumped timing advert, or negative error

Definition at line 100 of file timing_ad.c.

◆ libwifi_free_timing_advert()

void libwifi_free_timing_advert ( struct libwifi_timing_advert adv)

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

Parameters
advA libwifi_timing_advert struct

Definition at line 119 of file timing_ad.c.

◆ libwifi_get_timing_advert_length()

size_t libwifi_get_timing_advert_length ( struct libwifi_timing_advert adv)

Get the length of the specified libwifi_timing_advert struct.

Returns
Length of the specified timing advert, or negative error

Definition at line 94 of file timing_ad.c.