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

Go to the source code of this file.

Functions

size_t libwifi_add_action_detail (struct libwifi_action_detail *detail, const unsigned char *data, size_t data_len)
 Create a detail for an action frame by supplying raw data and it's length. More...
 
void libwifi_free_action_detail (struct libwifi_action_detail *detail)
 Free all memory in a given libwifi_action_detail. More...
 
int libwifi_create_action (struct libwifi_action *action, const unsigned char receiver[6], const unsigned char transmitter[6], const unsigned char address3[6], uint8_t category)
 Create a new action frame with a specified action and category. More...
 
int libwifi_create_action_no_ack (struct libwifi_action *action, const unsigned char receiver[6], const unsigned char transmitter[6], const unsigned char address3[6], uint8_t category)
 
size_t libwifi_get_action_length (struct libwifi_action *action)
 Get the length of a given libwifi_action. More...
 
size_t libwifi_dump_action (struct libwifi_action *action, unsigned char *buf, size_t buf_len)
 Dump a given libwifi_action to a raw buffer. More...
 
void libwifi_free_action (struct libwifi_action *action)
 Free data associated to a given libwifi_action. More...
 

Function Documentation

◆ libwifi_add_action_detail()

size_t libwifi_add_action_detail ( struct libwifi_action_detail detail,
const unsigned char *  data,
size_t  data_len 
)

Create a detail for an action frame by supplying raw data and it's length.

New data can be added to an existing libwifi_action_detail.

Parameters
detailA libwifi_action_detail struct
dataRaw data to be added to the libwifi_action_detail
data_lenLength of the raw data
Returns
Length of the action, or negative error

Definition at line 22 of file action.c.

◆ libwifi_create_action()

int libwifi_create_action ( struct libwifi_action action,
const unsigned char  receiver[6],
const unsigned char  transmitter[6],
const unsigned char  address3[6],
uint8_t  category 
)

Create a new action frame with a specified action and category.

Parameters
actionA new libwifi_action struct
receiverThe receiver MAC address
transmitterThe transmitter MAC address
address3The address 3 frame field value, typically the BSSID
categoryThe action frame category
Returns
Zero on success, or negative error

Definition at line 49 of file action.c.

◆ libwifi_create_action_no_ack()

int libwifi_create_action_no_ack ( struct libwifi_action action,
const unsigned char  receiver[6],
const unsigned char  transmitter[6],
const unsigned char  address3[6],
uint8_t  category 
)

Definition at line 69 of file action.c.

◆ libwifi_dump_action()

size_t libwifi_dump_action ( struct libwifi_action action,
unsigned char *  buf,
size_t  buf_len 
)

Dump a given libwifi_action to a raw buffer.

Parameters
actionA used libwifi_action struct
bufA buffer receiver
buf_lenThe length of the given buf
Returns
Bytes written to the buf, or negative error

Definition at line 94 of file action.c.

◆ libwifi_free_action()

void libwifi_free_action ( struct libwifi_action action)

Free data associated to a given libwifi_action.

Parameters
actionA used libwifi_action struct

Definition at line 114 of file action.c.

◆ libwifi_free_action_detail()

void libwifi_free_action_detail ( struct libwifi_action_detail detail)

Free all memory in a given libwifi_action_detail.

Parameters
detailA used libwifi_action_detail struct

Definition at line 42 of file action.c.

◆ libwifi_get_action_length()

size_t libwifi_get_action_length ( struct libwifi_action action)

Get the length of a given libwifi_action.

Parameters
actionA used libwifi_action struct
Returns
The length of the given libwifi_action

Definition at line 89 of file action.c.