Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
ws80211_utils.h
Go to the documentation of this file.
1
12#ifndef __WS80211_UTILS_H__
13#define __WS80211_UTILS_H__
14
15#include <wireshark.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/* For our (monitor mode tuning) purposes we shouldn't care about 20 MHz
22 * non HT vs 20 MHz HT. We do care about HT40- vs HT40+ vs HE40 (whether
23 * the center freq must be provided, */
24
39
41#define CHAN_NO_HT "NOHT"
43#define CHAN_HT20 "HT20"
45#define CHAN_HT40MINUS "HT40-"
47#define CHAN_HT40PLUS "HT40+"
49#define CHAN_HE40 "HE40"
51#define CHAN_VHT80 "VHT80"
53#define CHAN_VHT80P80 "VHT80+80"
55#define CHAN_VHT160 "VHT160"
57#define CHAN_EHT320 "EHT320"
58
59/* These are *not* the same values as the Linux NL80211_BAND_* enum,
60 * because we don't support the 60 GHz or 900 MHz (S1G, HaLow) bands,
61 * which have different channel widths. */
62
71
80
85{
86 uint32_t freq;
90};
91
96{
97 GArray *frequencies;
101};
102
116
127
128/*
129 * List of error types.
130 * WS80211_ERROR is a generic error that might have a platform-specific
131 * error message that depends on the last failed operation.
132 */
133#define WS80211_OK 0
134#define WS80211_ERROR_NOT_SUPPORTED 1
135#define WS80211_ERROR 2
136
140const char *ws80211_geterror(int error);
141
148int ws80211_init(void);
149
154/* XXX Should we make this an array of structs instead of an array of struct pointers?
155 * It'd save a bit of mallocing and freeing. */
156
162GArray* ws80211_find_interfaces(void);
163
171int ws80211_get_iface_info(const char *name, struct ws80211_iface_info *iface_info);
172
178void ws80211_free_interfaces(GArray *interfaces);
179
185void ws80211_clear_band(struct ws80211_band *band);
186
197int ws80211_set_freq(const char *name, uint32_t freq, int chan_type, uint32_t _U_ center_freq, uint32_t _U_ center_freq2);
198
205int ws80211_str_to_chan_type(const char *s);
206
214
221const char *ws80211_band_type_to_str(enum ws80211_band_type type);
222
228bool ws80211_has_fcs_filter(void);
229
237int ws80211_set_fcs_validation(const char *name, enum ws80211_fcs_validation fcs_validation);
238
239
248const char *ws80211_get_helper_path(void);
249
250
261int ws80211_get_center_frequency(int control_frequency, enum ws80211_channel_type channel_type);
262
263#ifdef __cplusplus
264}
265#endif /* __cplusplus */
266
267#endif /* __WS80211_UTILS_H__ */
Describes the channel capabilities of a single RF band on a PHY.
Definition ws80211_utils.h:96
int channel_types
Definition ws80211_utils.h:99
GArray * frequencies
Definition ws80211_utils.h:97
Describes a single frequency and its channel-type constraints.
Definition ws80211_utils.h:85
int channel_mask
Definition ws80211_utils.h:87
uint32_t freq
Definition ws80211_utils.h:86
Snapshot of the current configuration of a wireless interface.
Definition ws80211_utils.h:120
enum ws80211_fcs_validation current_fcs_validation
Definition ws80211_utils.h:125
int current_center_freq1
Definition ws80211_utils.h:123
int current_center_freq2
Definition ws80211_utils.h:124
int current_freq
Definition ws80211_utils.h:121
enum ws80211_channel_type current_chan_type
Definition ws80211_utils.h:122
Represents a wireless network interface and its capture capabilities.
Definition ws80211_utils.h:107
GArray * bands
Definition ws80211_utils.h:111
char * ifname
Definition ws80211_utils.h:108
bool can_set_freq
Definition ws80211_utils.h:109
int cap_monitor
Definition ws80211_utils.h:114
bool can_check_fcs
Definition ws80211_utils.h:110
GArray * ws80211_find_interfaces(void)
Finds and returns a list of wireless network interfaces.
Definition ws80211_utils.c:1179
void ws80211_clear_band(struct ws80211_band *band)
Clear the frequencies array in a ws80211_band structure.
Definition ws80211_utils.c:1244
ws80211_band_type
Supported RF band identifiers (not equivalent to Linux NL80211_BAND_*).
Definition ws80211_utils.h:66
@ WS80211_BAND_6GHZ
Definition ws80211_utils.h:69
@ WS80211_BAND_5GHZ
Definition ws80211_utils.h:68
@ WS80211_BAND_2GHZ
Definition ws80211_utils.h:67
int ws80211_str_to_chan_type(const char *s)
Convert a string representation of a channel type to its corresponding enum value.
const char * ws80211_geterror(int error)
Definition ws80211_utils.c:1174
ws80211_channel_type
IEEE 802.11 channel width/type for monitor mode configuration.
Definition ws80211_utils.h:28
@ WS80211_CHAN_HE40
Definition ws80211_utils.h:33
@ WS80211_CHAN_HT40PLUS
Definition ws80211_utils.h:32
@ WS80211_CHAN_VHT80
Definition ws80211_utils.h:34
@ WS80211_CHAN_VHT160
Definition ws80211_utils.h:36
@ WS80211_CHAN_HT40MINUS
Definition ws80211_utils.h:31
@ WS80211_CHAN_VHT80P80
Definition ws80211_utils.h:35
@ WS80211_CHAN_EHT320
Definition ws80211_utils.h:37
@ WS80211_CHAN_NO_HT
Definition ws80211_utils.h:29
@ WS80211_CHAN_HT20
Definition ws80211_utils.h:30
ws80211_fcs_validation
FCS (Frame Check Sequence) capture filter policy.
Definition ws80211_utils.h:75
@ WS80211_FCS_VALID
Definition ws80211_utils.h:77
@ WS80211_FCS_INVALID
Definition ws80211_utils.h:78
@ WS80211_FCS_ALL
Definition ws80211_utils.h:76
int ws80211_set_freq(const char *name, uint32_t freq, int chan_type, uint32_t _U_ center_freq, uint32_t _U_ center_freq2)
Set the frequency and channel width for an interface.
int ws80211_set_fcs_validation(const char *name, enum ws80211_fcs_validation fcs_validation)
Set the FCS validation behavior for an interface.
int ws80211_init(void)
Definition ws80211_utils.c:1169
const char * ws80211_band_type_to_str(enum ws80211_band_type type)
Convert a Wi-Fi band type to its string representation.
Definition ws80211_utils.c:1204
const char * ws80211_get_helper_path(void)
Get the path to a helper application.
Definition ws80211_utils.c:1219
int ws80211_get_iface_info(const char *name, struct ws80211_iface_info *iface_info)
Get information about a wireless interface.
const char * ws80211_chan_type_to_str(enum ws80211_channel_type type)
Convert a Wi-Fi channel type to its string representation.
Definition ws80211_utils.c:1199
int ws80211_get_center_frequency(int control_frequency, enum ws80211_channel_type channel_type)
Return center frequency of an 80M/160M/320M channel.
Definition ws80211_utils.c:1251
void ws80211_free_interfaces(GArray *interfaces)
Free an interface list.
Definition ws80211_utils.c:1227
bool ws80211_has_fcs_filter(void)
Check to see if we have FCS filtering.
Definition ws80211_utils.c:1209