| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Macros | Functions
802_11-utils.h File Reference
`#include <wireshark.h>`

Go to the source code of this file.

## Macros
#define | FREQ_IS_BG(freq) ((freq) <= 2484)
#define | CHAN_IS_BG(chan) ((chan) <= 14)
#define | FREQ_IS_6G(freq) (5950 <= (freq) && (freq) <= 7125)
#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)

## Detailed Description

802.11 utilities.

## Macro Definition Documentation

## ◆ 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_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

  chan | Channel number
  is_bg | true 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

  freq | Frequency 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

  freq | Frequench in MHz.

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