libwifi 0.0.3
An 802.11 Frame Parsing and Generation library in C
disassociation.c File Reference
#include "disassociation.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_disassoc_length (struct libwifi_disassoc *disassoc)
 The length of a disassoc frame is the sum of the header length, the fixed parameters length, and the tagged parameters length. 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)
 The generated disassociation frame contains only the supplied receiver, transmitter and reason_code by default. More...
 
size_t libwifi_dump_disassoc (struct libwifi_disassoc *disassoc, unsigned char *buf, size_t buf_len)
 Copy a libwifi_disassoc into a regular unsigned char buffer. More...
 
void libwifi_free_disassoc (struct libwifi_disassoc *disassoc)
 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_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 
)

The generated disassociation frame contains only the supplied receiver, transmitter and reason_code by default.

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 
)

Copy a libwifi_disassoc into a regular unsigned char buffer.

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)

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_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)

The length of a disassoc frame is the sum of the header length, the fixed parameters length, and the tagged parameters length.

Calculate the length of a given libwifi_disassoc.

Definition at line 27 of file disassociation.c.