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

Go to the source code of this file.

Functions

size_t libwifi_get_auth_length (struct libwifi_auth *auth)
 Calculate the length of a given libwifi_auth. More...
 
int libwifi_create_auth (struct libwifi_auth *auth, const unsigned char receiver[6], const unsigned char transmitter[6], const unsigned char address3[6], uint16_t algorithm_number, uint16_t transaction_sequence, uint16_t status_code)
 Generate a populated libwifi auth. More...
 
size_t libwifi_dump_auth (struct libwifi_auth *auth, unsigned char *buf, size_t buf_len)
 Dump a libwifi_auth into a raw format for packet injection. More...
 
void libwifi_free_auth (struct libwifi_auth *auth)
 Free any memory claimed by a libwifi_auth back to the system. More...
 

Function Documentation

◆ libwifi_create_auth()

int libwifi_create_auth ( struct libwifi_auth auth,
const unsigned char  receiver[6],
const unsigned char  transmitter[6],
const unsigned char  address3[6],
uint16_t  algorithm_number,
uint16_t  transaction_sequence,
uint16_t  status_code 
)

Generate a populated libwifi auth.

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

Parameters
authA libwifi_auth
receiverThe receiver MAC address, aka address 1
transmitterThe source MAC address, aka address 2
address3The address 3 frame field value, typically the BSSID
algorithm_numberAlgorithm type to use, as defined in the IEEE802.11 spec
transaction_sequenceTransaction sequence value to use
status_codeStatus code to use, as defined in the IEEE802.11 spec
Returns
Zero on success, or negative error

Generate a populated libwifi auth.

Definition at line 35 of file authentication.c.

◆ libwifi_dump_auth()

size_t libwifi_dump_auth ( struct libwifi_auth auth,
unsigned char *  buf,
size_t  buf_len 
)

Dump a libwifi_auth into a raw format for packet injection.

Parameters
authA libwifi_auth
bufThe output buffer for the frame data
buf_lenThe length of the output buffer
Returns
The length of the dumped auth, or negative error

Dump a libwifi_auth into a raw format for packet injection.

This is useful when injecting generated libwifi frames.

Definition at line 62 of file authentication.c.

◆ libwifi_free_auth()

void libwifi_free_auth ( struct libwifi_auth auth)

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

Parameters
authA libwifi_auth

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

Definition at line 85 of file authentication.c.

◆ libwifi_get_auth_length()

size_t libwifi_get_auth_length ( struct libwifi_auth auth)

Calculate the length of a given libwifi_auth.

Parameters
authA libwifi_auth
Returns
The length of the given auth

Calculate the length of a given libwifi_auth.

Definition at line 27 of file authentication.c.