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

Go to the source code of this file.

Functions

size_t libwifi_get_disassoc_length (struct libwifi_disassoc *disassoc)
 Calculate the length of a given libwifi_disassoc. More...
 
int libwifi_create_disassoc (struct libwifi_disassoc *disassoc, const unsigned char receiver[6], const unsigned char transmitter[6], const unsigned char address3[6], uint16_t reason_code)
 Generate a populated libwifi disassoc. More...
 
size_t libwifi_dump_disassoc (struct libwifi_disassoc *disassoc, unsigned char *buf, size_t buf_len)
 Dump a libwifi_disassoc into a raw format for packet injection. More...
 
void libwifi_free_disassoc (struct libwifi_disassoc *disassoc)
 Free any memory claimed by a libwifi_disassoc back to the system. More...
 

Function Documentation

◆ libwifi_create_disassoc()

int libwifi_create_disassoc ( struct libwifi_disassoc disassoc,
const unsigned char  receiver[6],
const unsigned char  transmitter[6],
const unsigned char  address3[6],
uint16_t  reason_code 
)

Generate a populated libwifi disassoc.

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

Parameters
disassocA libwifi_disassoc
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 disassoc reason code
Returns
Zero on success, or negative error

Generate a populated libwifi disassoc.

Definition at line 36 of file disassociation.c.

◆ libwifi_dump_disassoc()

size_t libwifi_dump_disassoc ( struct libwifi_disassoc disassoc,
unsigned char *  buf,
size_t  buf_len 
)

Dump a libwifi_disassoc into a raw format for packet injection.

Parameters
disassocA libwifi_disassoc
bufThe output buffer for the frame data
buf_lenThe length of the output buffer
Returns
The length of the dumped disassoc, or negative error

Dump a libwifi_disassoc into a raw format for packet injection.

This is useful when injecting generated libwifi frames.

Definition at line 60 of file disassociation.c.

◆ libwifi_free_disassoc()

void libwifi_free_disassoc ( struct libwifi_disassoc disassoc)

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

Parameters
disassocA libwifi_disassoc

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

Definition at line 83 of file disassociation.c.

◆ libwifi_get_disassoc_length()

size_t libwifi_get_disassoc_length ( struct libwifi_disassoc disassoc)

Calculate the length of a given libwifi_disassoc.

Parameters
disassocA libwifi_disassoc
Returns
The length of the given disassoc, or negative error

Calculate the length of a given libwifi_disassoc.

Definition at line 27 of file disassociation.c.