Wireshark 4.5.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
21enum ws80211_channel_type {
22 WS80211_CHAN_NO_HT,
23 WS80211_CHAN_HT20,
24 WS80211_CHAN_HT40MINUS,
25 WS80211_CHAN_HT40PLUS,
26 WS80211_CHAN_VHT80,
27 WS80211_CHAN_VHT80P80,
28 WS80211_CHAN_VHT160,
29 WS80211_CHAN_EHT320
30};
31
32#define CHAN_NO_HT "NOHT"
33#define CHAN_HT20 "HT20"
34#define CHAN_HT40MINUS "HT40-"
35#define CHAN_HT40PLUS "HT40+"
36#define CHAN_VHT80 "VHT80"
37#define CHAN_VHT80P80 "VHT80+80"
38#define CHAN_VHT160 "VHT160"
39#define CHAN_EHT320 "EHT320"
40
41/* These are *not* the same values as the Linux NL80211_BAND_* enum,
42 * because we don't support the 60 GHz or 900 MHz (S1G, HaLow) bands,
43 * which have different channel widths. */
44enum ws80211_band_type {
45 WS80211_BAND_2GHZ,
46 WS80211_BAND_5GHZ,
47 WS80211_BAND_6GHZ
48};
49
50enum ws80211_fcs_validation {
51 WS80211_FCS_ALL,
52 WS80211_FCS_VALID,
53 WS80211_FCS_INVALID
54};
55
57{
58 GArray *frequencies; /* Array of uint32_t (MHz) (lazily created, can be NULL) */
59 int channel_types;
60};
61
63{
64 char *ifname;
65 bool can_set_freq;
66 bool can_check_fcs;
67 GArray *bands; /* Array of struct ws80211_band, indexed by
68 ws80211_band_type. (array always exists but might
69 be shorter than the number of possible bands.) */
70 int cap_monitor;
71};
72
74 int current_freq;
75 enum ws80211_channel_type current_chan_type;
76 int current_center_freq1;
77 int current_center_freq2;
78 enum ws80211_fcs_validation current_fcs_validation;
79};
80
88#define WS80211_INIT_OK 0
89#define WS80211_INIT_NOT_SUPPORTED 1
90
91int ws80211_init(void);
92
97/* XXX Should we make this an array of structs instead of an array of struct pointers?
98 * It'd save a bit of mallocing and freeing. */
99GArray* ws80211_find_interfaces(void);
100
101int ws80211_get_iface_info(const char *name, struct ws80211_iface_info *iface_info);
102
107void ws80211_free_interfaces(GArray *interfaces);
108
109void ws80211_clear_band(struct ws80211_band *band);
110
120int ws80211_set_freq(const char *name, uint32_t freq, int chan_type, uint32_t _U_ center_freq, uint32_t _U_ center_freq2);
121
122int ws80211_str_to_chan_type(const char *s);
123const char *ws80211_chan_type_to_str(enum ws80211_channel_type type);
124
125const char *ws80211_band_type_to_str(enum ws80211_band_type type);
126
131bool ws80211_has_fcs_filter(void);
132
139int ws80211_set_fcs_validation(const char *name, enum ws80211_fcs_validation fcs_validation);
140
141
148const char *ws80211_get_helper_path(void);
149
150
160int ws80211_get_center_frequency(int control_frequency, enum ws80211_channel_type channel_type);
161
162#ifdef __cplusplus
163}
164#endif /* __cplusplus */
165
166#endif /* __WS80211_UTILS_H__ */
Definition ws80211_utils.h:57
Definition ws80211_utils.h:73
Definition ws80211_utils.h:63
GArray * ws80211_find_interfaces(void)
Definition ws80211_utils.c:1089
int ws80211_set_freq(const char *name, uint32_t freq, int chan_type, uint32_t _U_ center_freq, uint32_t _U_ center_freq2)
int ws80211_set_fcs_validation(const char *name, enum ws80211_fcs_validation fcs_validation)
const char * ws80211_get_helper_path(void)
Definition ws80211_utils.c:1129
int ws80211_get_center_frequency(int control_frequency, enum ws80211_channel_type channel_type)
Definition ws80211_utils.c:1161
void ws80211_free_interfaces(GArray *interfaces)
Definition ws80211_utils.c:1137
bool ws80211_has_fcs_filter(void)
Definition ws80211_utils.c:1119