wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
ieee802_11_common.c File Reference

IEEE 802.11 Common routines. More...

#include "includes.h"
#include "common.h"
#include "defs.h"
#include "wpa_common.h"
#include "qca-vendor.h"
#include "ieee802_11_defs.h"
#include "ieee802_11_common.h"

Macros

#define C2S(x)   case x: return #x;
 

Functions

ParseRes ieee802_11_parse_elems (const u8 *start, size_t len, struct ieee802_11_elems *elems, int show_errors)
 Parse information elements in management frames. More...
 
int ieee802_11_ie_count (const u8 *ies, size_t ies_len)
 
struct wpabufieee802_11_vendor_ie_concat (const u8 *ies, size_t ies_len, u32 oui_type)
 
const u8 * get_hdr_bssid (const struct ieee80211_hdr *hdr, size_t len)
 
int hostapd_config_wmm_ac (struct hostapd_wmm_ac_params wmm_ac_params[], const char *name, const char *val)
 
enum hostapd_hw_mode ieee80211_freq_to_chan (int freq, u8 *channel)
 
enum hostapd_hw_mode ieee80211_freq_to_channel_ext (unsigned int freq, int sec_channel, int vht, u8 *op_class, u8 *channel)
 Convert frequency into channel info for HT40 and VHT. DFS channels are not covered. More...
 
int ieee80211_chan_to_freq (const char *country, u8 op_class, u8 chan)
 Convert channel info to frequency. More...
 
int ieee80211_is_dfs (int freq)
 
int supp_rates_11b_only (struct ieee802_11_elems *elems)
 
const char * fc2str (u16 fc)
 
int mb_ies_info_by_ies (struct mb_ies_info *info, const u8 *ies_buf, size_t ies_len)
 
struct wpabufmb_ies_by_info (struct mb_ies_info *info)
 

Detailed Description

IEEE 802.11 Common routines.

Function Documentation

int ieee80211_chan_to_freq ( const char *  country,
u8  op_class,
u8  chan 
)

Convert channel info to frequency.

Parameters
countryCountry code, if known; otherwise, global operating class is used
op_classOperating class
chanChannel number
Returns
Frequency in MHz or -1 if the specified channel is unknown
enum hostapd_hw_mode ieee80211_freq_to_channel_ext ( unsigned int  freq,
int  sec_channel,
int  vht,
u8 *  op_class,
u8 *  channel 
)

Convert frequency into channel info for HT40 and VHT. DFS channels are not covered.

Parameters
freqFrequency (MHz) to convert
sec_channel0 = non-HT40, 1 = sec. channel above, -1 = sec. channel below
vht0 - non-VHT, 1 - 80 MHz
op_classBuffer for returning operating class
channelBuffer for returning channel number
Returns
hw_mode on success, NUM_HOSTAPD_MODES on failure
ParseRes ieee802_11_parse_elems ( const u8 *  start,
size_t  len,
struct ieee802_11_elems elems,
int  show_errors 
)

Parse information elements in management frames.

Parameters
startPointer to the start of IEs
lenLength of IE buffer in octets
elemsData structure for parsed elements
show_errorsWhether to show parsing errors in debug log
Returns
Parsing result