Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
802_11-utils.h File Reference
#include <wireshark.h>

Go to the source code of this file.

Macros

#define FREQ_IS_BG(freq)
#define CHAN_IS_BG(chan)
#define FREQ_IS_6G(freq)
#define RATE_IS_DSSS(rate)
#define RATE_IS_OFDM(rate)

Functions

WS_DLL_PUBLIC int ieee80211_mhz_to_chan (unsigned freq)
WS_DLL_PUBLIC unsigned ieee80211_chan_to_mhz (int chan, bool is_bg)
WS_DLL_PUBLIC char * ieee80211_mhz_to_str (unsigned freq)
WS_DLL_PUBLIC unsigned ieee80211_chan_band_to_mhz (int chan, bool is_bg, bool is_6ghz)
 Get Frequency given a Channel number and band.

Detailed Description

802.11 utilities.

Macro Definition Documentation

◆ CHAN_IS_BG

#define CHAN_IS_BG ( chan)
Value:
((chan) <= 14)

◆ FREQ_IS_6G

#define FREQ_IS_6G ( freq)
Value:
(5950 <= (freq) && (freq) <= 7125)

◆ FREQ_IS_BG

#define FREQ_IS_BG ( freq)
Value:
((freq) <= 2484)

◆ RATE_IS_DSSS

#define RATE_IS_DSSS ( rate)
Value:
((rate) == 2 /* 1 Mb/s */ || \
(rate) == 4 /* 2 Mb/s */ || \
(rate) == 11 /* 5.5 Mb/s */ || \
(rate) == 22 /* 11 Mb/s */ || \
(rate) == 44 /* 22 Mb/s */ || \
(rate) == 66 /* 33 Mb/s */)

◆ RATE_IS_OFDM

#define RATE_IS_OFDM ( rate)
Value:
((rate) == 12 /* 6 Mb/s */ || \
(rate) == 18 /* 9 Mb/s */ || \
(rate) == 24 /* 12 Mb/s */ || \
(rate) == 36 /* 18 Mb/s */ || \
(rate) == 48 /* 24 Mb/s */ || \
(rate) == 72 /* 36 Mb/s */ || \
(rate) == 96 /* 48 Mb/s */ || \
(rate) == 108 /* 54 Mb/s */)

Function Documentation

◆ ieee80211_chan_band_to_mhz()

WS_DLL_PUBLIC unsigned ieee80211_chan_band_to_mhz ( int chan,
bool is_bg,
bool is_6ghz )

Get Frequency given a Channel number and band.

Parameters
chanChannel number
is_bgtrue if the channel is a b/g channel, false otherwise.
is_6ghztrue if the channel is a 6 GHz channel, false otherwise.
Returns
The equivalent frequency or 0 if no match is found.

◆ ieee80211_chan_to_mhz()

WS_DLL_PUBLIC unsigned ieee80211_chan_to_mhz ( int chan,
bool is_bg )

Given an 802.11 channel number and a band type, return a center frequency.

Parameters
chanChannel number
is_bgtrue if the channel is a b/g channel, false otherwise.
Returns
The equivalent frequency or 0 if no match is found.

◆ ieee80211_mhz_to_chan()

WS_DLL_PUBLIC int ieee80211_mhz_to_chan ( unsigned freq)

Given a center frequency in MHz, return a channel number.

Parameters
freqFrequency in MHz.
Returns
The equivalent channel or -1 if no match is found.

◆ ieee80211_mhz_to_str()

WS_DLL_PUBLIC char * ieee80211_mhz_to_str ( unsigned freq)

Given an 802.11 channel center frequency in MHz, return a string representation.

Parameters
freqFrequench in MHz.
Returns
A string showing the frequency, channel number, and type. The string must be freed with g_free() after use.