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

Go to the source code of this file.

Functions

size_t libwifi_get_deauth_length (struct libwifi_deauth *deauth)
 Calculate the length of a given libwifi_deauth. More...
 
int libwifi_create_deauth (struct libwifi_deauth *deauth, const unsigned char receiver[6], const unsigned char transmitter[6], const unsigned char address3[6], uint16_t reason_code)
 Generate a populated libwifi deauth. More...
 
size_t libwifi_dump_deauth (struct libwifi_deauth *deauth, unsigned char *buf, size_t buf_len)
 Dump a libwifi_deauth into a raw format for packet injection. More...
 
void libwifi_free_deauth (struct libwifi_deauth *deauth)
 Free any memory claimed by a libwifi_deauth back to the system. More...
 

Function Documentation

◆ libwifi_create_deauth()

int libwifi_create_deauth ( struct libwifi_deauth deauth,
const unsigned char  receiver[6],
const unsigned char  transmitter[6],
const unsigned char  address3[6],
uint16_t  reason_code 
)

Generate a populated libwifi deauth.

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

Parameters
deauthA libwifi_deauth
receiverThe receiver MAC address, aka address 1
transmitterThe source MAC address, aka address 2
address3The address 3 frame field value, typically the BSSID
reason_codeThe deauth reason code
Returns
Zero on success, or negative error

Generate a populated libwifi deauth.

Definition at line 36 of file deauthentication.c.

◆ libwifi_dump_deauth()

size_t libwifi_dump_deauth ( struct libwifi_deauth deauth,
unsigned char *  buf,
size_t  buf_len 
)

Dump a libwifi_deauth into a raw format for packet injection.

Parameters
deauthA libwifi_deauth
bufThe output buffer for the frame data
buf_lenThe length of the output buffer
Returns
The length of the dumped deauth, or negative error

Dump a libwifi_deauth into a raw format for packet injection.

This is useful when injecting generated libwifi frames.

Definition at line 60 of file deauthentication.c.

◆ libwifi_free_deauth()

void libwifi_free_deauth ( struct libwifi_deauth deauth)

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

Parameters
deauthA libwifi_deauth

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

Definition at line 83 of file deauthentication.c.

◆ libwifi_get_deauth_length()

size_t libwifi_get_deauth_length ( struct libwifi_deauth deauth)

Calculate the length of a given libwifi_deauth.

Parameters
deauthA libwifi_deauth
Returns
The length of the given deauth

Calculate the length of a given libwifi_deauth.

Definition at line 27 of file deauthentication.c.