libwifi 0.0.3
An 802.11 Frame Parsing and Generation library in C
core.h File Reference

Go to the source code of this file.

Macros

#define LIBWIFI_VERSION   "UNSET_VERSION"
 
#define LIBWIFI_BCAST_MAC   "\xFF\xFF\xFF\xFF\xFF\xFF"
 Commonly used fixed fields. More...
 
#define LIBWIFI_ZERO_MAC   "\x00\x00\x00\x00\x00\x00"
 
#define MAC2STR(a)   (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
 Helpers for MAC Addresses. More...
 
#define MACSTR   "%02x:%02x:%02x:%02x:%02x:%02x"
 

Functions

void libwifi_random_mac (unsigned char buf[6], unsigned char prefix[3])
 Function to randomly generate a MAC address. More...
 
void libwifi_dummy (void)
 Dummy function for linker testing purposes. More...
 
const char * libwifi_get_version (void)
 Obtain the version of libwifi. More...
 

Macro Definition Documentation

◆ LIBWIFI_BCAST_MAC

#define LIBWIFI_BCAST_MAC   "\xFF\xFF\xFF\xFF\xFF\xFF"

Commonly used fixed fields.

Definition at line 26 of file core.h.

◆ LIBWIFI_VERSION

#define LIBWIFI_VERSION   "UNSET_VERSION"

Definition at line 20 of file core.h.

◆ LIBWIFI_ZERO_MAC

#define LIBWIFI_ZERO_MAC   "\x00\x00\x00\x00\x00\x00"

Definition at line 27 of file core.h.

◆ MAC2STR

#define MAC2STR (   a)    (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]

Helpers for MAC Addresses.

Definition at line 32 of file core.h.

◆ MACSTR

#define MACSTR   "%02x:%02x:%02x:%02x:%02x:%02x"

Definition at line 33 of file core.h.

Function Documentation

◆ libwifi_dummy()

void libwifi_dummy ( void  )

Dummy function for linker testing purposes.

Dummy function for linker testing purposes.

Definition at line 37 of file core.c.

◆ libwifi_get_version()

const char * libwifi_get_version ( void  )

Obtain the version of libwifi.

Returns
The version of the installed libwifi.

Obtain the version of libwifi.

Definition at line 44 of file core.c.

◆ libwifi_random_mac()

void libwifi_random_mac ( unsigned char  buf[6],
unsigned char  prefix[3] 
)

Function to randomly generate a MAC address.

Parameters
bufA buffer for the generated MAC to be written to
prefixAn optional OUI prefix

Function to randomly generate a MAC address.

Definition at line 24 of file core.c.