Wireshark  4.3.0
The Wireshark network protocol analyzer
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
18 extern "C" {
19 #endif /* __cplusplus */
20 
21 enum 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 };
30 
31 #define CHAN_NO_HT "NOHT"
32 #define CHAN_HT20 "HT20"
33 #define CHAN_HT40MINUS "HT40-"
34 #define CHAN_HT40PLUS "HT40+"
35 #define CHAN_VHT80 "VHT80"
36 #define CHAN_VHT80P80 "VHT80+80"
37 #define CHAN_VHT160 "VHT160"
38 
39 /* XXX This doesn't match AirpcapValidationType. Should it? */
40 enum ws80211_fcs_validation {
41  WS80211_FCS_ALL,
42  WS80211_FCS_VALID,
43  WS80211_FCS_INVALID
44 };
45 
47 {
48  char *ifname;
49  bool can_set_freq;
50  bool can_check_fcs;
51  GArray *frequencies; /* Array of uint32_t? */
52  int channel_types; /* Union for all bands */
53  int cap_monitor;
54 };
55 
57  int current_freq;
58  enum ws80211_channel_type current_chan_type;
59  int current_center_freq1;
60  int current_center_freq2;
61  enum ws80211_fcs_validation current_fcs_validation;
62 };
63 
73 #define WS80211_INIT_OK 0
74 #define WS80211_INIT_NOT_SUPPORTED 1
75 
76 int ws80211_init(void);
77 
82 /* XXX Should we make this an array of structs instead of an array of struct pointers?
83  * It'd save a bit of mallocing and freeing. */
84 GArray* ws80211_find_interfaces(void);
85 
86 int ws80211_get_iface_info(const char *name, struct ws80211_iface_info *iface_info);
87 
92 void ws80211_free_interfaces(GArray *interfaces);
93 
103 int ws80211_set_freq(const char *name, uint32_t freq, int chan_type, uint32_t _U_ center_freq, uint32_t _U_ center_freq2);
104 
105 int ws80211_str_to_chan_type(const char *s);
106 const char *ws80211_chan_type_to_str(int type);
107 
112 bool ws80211_has_fcs_filter(void);
113 
120 int ws80211_set_fcs_validation(const char *name, enum ws80211_fcs_validation fcs_validation);
121 
122 
129 const char *ws80211_get_helper_path(void);
130 
131 #ifdef __cplusplus
132 }
133 #endif /* __cplusplus */
134 
135 #endif /* __WS80211_UTILS_H__ */
Definition: ws80211_utils.h:56
Definition: ws80211_utils.h:47
int ws80211_set_freq(const char *name, uint32_t freq, int chan_type, uint32_t _U_ center_freq, uint32_t _U_ center_freq2)
GArray * ws80211_find_interfaces(void)
Definition: ws80211_utils.c:1194
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:1229
void ws80211_free_interfaces(GArray *interfaces)
Definition: ws80211_utils.c:1237
bool ws80211_has_fcs_filter(void)
Definition: ws80211_utils.c:1219