Newer
Older
/*
* wifi_dataelements.h
* WiFi DataElements-v2.0 definitions header.
*
* Copyright (C) 2019-2022 IOPSYS Software Solutions AB. All rights reserved.
*
*/
#ifndef WIFI_DATAELEMENTS_H
#define WIFI_DATAELEMENTS_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef WIFI_H /* deprecate eventually this section */
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
BAND_2 = 1 << 0, /**< 0x1 for 2.4Ghz band. */
BAND_5 = 1 << 1, /**< 0x2 for 5Ghz band. */
BAND_DUAL = 3, /**< 0x3 for both 2.4 and 5Ghz bands */
BAND_60 = 1 << 2, /**< 0x4 for 60Ghz */
BAND_6 = 1 << 3, /**< 0x8 for 6Ghz */
BAND_UNKNOWN = 1 << 4, /**< 0x10 (and above) for unknown band */
};
/** enum wifi_bw - bandwidth */
enum wifi_bw {
BW20, /**< bandwidth = 20 Mhz */
BW40, /**< bandwidth = 40 Mhz */
BW80, /**< bandwidth = 80 Mhz */
BW160, /**< bandwidth = 160 Mhz */
BW_AUTO, /**< bandwidth = ? */
BW8080 = 7, /**< bandwidth = 80+80 Mhz */
BW_UNKNOWN, /**< Unknown or Undefined */
};
/** enum wifi_chan_ext - extension channel */
enum wifi_chan_ext {
EXTCH_NONE, /**< no extension channel */
EXTCH_ABOVE, /**< extension channel above primary */
EXTCH_BELOW, /**< extension channel below primary */
EXTCH_AUTO, /**< extension channel auto */
};
enum wifi_security_type {
WIFI_SECURITY_NONE,
WIFI_SECURITY_WEP64,
WIFI_SECURITY_WEP128,
WIFI_SECURITY_WPAPSK,
WIFI_SECURITY_WPA2PSK,
WIFI_SECURITY_FT_WPA2PSK,
WIFI_SECURITY_WPA3PSK,
WIFI_SECURITY_WPA3PSK_T,
WIFI_SECURITY_FT_WPA3PSK,
WIFI_SECURITY_WPA,
WIFI_SECURITY_WPA2,
WIFI_SECURITY_WPA3,
};
#endif
typedef char timestamp_t[32];
typedef uint8_t guid_t[16];
typedef uint8_t macaddr_t[6], node_id_t[6];
enum wifi_bsstype {
AP_WIFI_FBSS,
AP_WIFI_BBSS,
AP_WIFI_COMBINED,
};
#ifndef EASY_IF_UTILS_H
struct ip_address {
int family; /* AF_INET or AF_INET6 */
union {
struct in_addr ip4;
struct in6_addr ip6;
} addr;
};
#endif
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
enum wifi_opclass_dfs {
WIFI_OPCLASS_CHANNEL_DFS_NONE,
WIFI_OPCLASS_CHANNEL_DFS_USABLE,
WIFI_OPCLASS_CHANNEL_DFS_AVAILABLE,
WIFI_OPCLASS_CHANNEL_DFS_NOP,
WIFI_OPCLASS_CHANNEL_DFS_CAC,
};
struct wifi_opclass_channel {
uint8_t channel;
uint8_t preference;
enum wifi_opclass_dfs dfs;
uint32_t cac_time;
uint32_t nop_time;
};
struct wifi_opclass_entry {
uint8_t id;
int bandwidth;
int max_txpower;
int channel_num;
struct wifi_opclass_channel channel[64];
};
struct wifi_opclass {
struct timespec entry_time;
int entry_num;
struct wifi_opclass_entry entry[64];
};
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
struct wifi_sta_meas_report {
struct list_head list;
size_t len;
uint8_t *data;
};
struct wifi_cac_available_channel {
uint8_t opclass;
uint8_t channel;
uint32_t cleared; // in minutes since available
};
struct wifi_cac_nop_channel {
uint8_t opclass;
uint8_t channel;
uint32_t remaining; // in secs
};
struct wifi_cac_active_channel {
uint8_t opclass;
uint8_t channel;
uint32_t remaining; // in secs
};
struct wifi_cac_status {
timestamp_t tsp;
struct list_head available_chlist; /* list of wifi_cac_available_channel */
struct list_head nop_chlist; /* list of wifi_cac_nop_channel */
struct list_head cac_chlist; /* list of wifi_cac_active_channel */
struct list_head list;
};
struct wifi_tid_queuesize {
uint8_t tid;
uint32_t size;
struct list_head list;
};
struct wifi_akm_suite {
uint8_t oui[3];
uint8_t type;
};
//TODO_ redfine. why needed?
struct wifi_mcs {
uint16_t vht_mcs_rxmap;
uint16_t vht_mcs_txmap;
};
struct wifi_wifi6_capabilities {
bool he160;
bool he8080;
//mcs
//nss
bool su_beamformer;
bool su_beamformee;
bool mu_beamformer;
bool beamformee_le80;
bool beamformee_gt80;
bool ul_mumimo;
bool ul_ofdma;
bool dl_ofdma;
uint8_t max_dl_mumimo;
uint8_t max_ul_mumimo;
uint8_t max_dl_ofdma;
uint8_t max_ul_ofdma;
bool rts;
bool mu_rts;
bool multi_bssid;
bool mu_edca;
bool twt_requester;
bool twt_responder;
};
/* maps to capability bytes in respective TLVs */
struct wifi_caps_element {
#define HT_CAP_VALID 0x4
#define VHT_CAP_VALID 0x8
#define HE_CAP_VALID 0x20
uint8_t ht;
uint8_t vht[6];
uint8_t he[15]; /* 1 (supp-mcs-len), 12 (Tx Rx mcs), 2 (others) */
uint8_t wifi6[20]; /* max bytes per-role */
uint32_t valid; /* caps validity */
struct wifi_mcs mcs;
};
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
struct wifi_steer_summary {
uint64_t no_candidate_cnt;
uint64_t blacklist_attempt_cnt;
uint64_t blacklist_success_cnt;
uint64_t blacklist_failure_cnt;
uint64_t btm_attempt_cnt;
uint64_t btm_success_cnt;
uint64_t btm_failure_cnt;
uint64_t btm_query_resp_cnt;
};
struct wifi_apsta_steer_summary {
struct wifi_steer_summary summary;
uint32_t time_since_steer;
};
enum steer_trigger {
STEER_TRIGGER_UNKNOWN,
STEER_TRIGGER_UTIL,
STEER_TRIGGER_LINK_QUALITY,
STEER_TRIGGER_BK_UTIL
};
enum steer_method {
STEER_METHOD_ASSOC_CTL,
STEER_METHOD_BTM_REQ,
STEER_METHOD_ASYNC_BTM
};
struct wifi_apsta_steer_history {
struct list_head list;
struct timespec time;
uint8_t origin_bssid[6];
enum steer_trigger trigger;
enum steer_method method;
uint8_t dst_bssid[6];
uint32_t duration; /* seconds */
};
struct wifi_multiap_sta {
time_t assoc_time;
uint8_t anpi; /* avg noise to power indicator */
struct wifi_apsta_steer_summary steer_summary;
uint8_t num_steer_hist;
struct list_head steer_history; /* list of wifi_apsta_steer_history */
};
struct wifi_sta_element {
struct list_head list;
timestamp_t tsp;
uint8_t macaddr[6];
//wifi6caps
//clientcaps
struct wifi_caps_element caps;
uint32_t dl_rate; /* latest data rate in Kbps: ap -> sta */
uint32_t ul_rate; /* latest data rate in Kbps: sta -> ap */
unsigned long ul_utilization; /* time in msecs for receive from sta */
unsigned long dl_utilization; /* time in msecs for transmit to sta */
uint32_t dl_est_thput; /* in Mbps */
uint32_t ul_est_thput; /* in Mbps */
uint8_t rcpi;
uint32_t conn_time; /* in secs since last associated */
uint64_t tx_bytes; /* transmit bytes count: ap -> sta */
uint64_t rx_bytes; /* receive bytes count: sta -> ap */
uint32_t tx_pkts;
uint32_t rx_pkts;
uint32_t tx_errors;
uint32_t rx_errors;
uint32_t rtx_pkts; /* total retransmitted packets */
struct ip_address ipv4_addr;
struct ip_address ipv6_addr;
char hostname[128];
uint8_t num_meas_reports;
struct list_head meas_reportlist; /* list of wifi_sta_meas_report */
size_t reassoc_framelen;
uint8_t *reassoc_frame;
struct list_head tid_qsizelist; /* list of wifi_tid_queuesize */
struct wifi_multiap_sta multi_apsta;
struct wifi_multiap_steering {
uint64_t blacklist_attempt_cnt;
uint64_t btm_attempt_cnt;
uint64_t btm_query_resp_cnt;
};
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
enum counter_unit { COUNTER_UNIT_KB = 1, COUNTER_UNIT_MB = 2 };
struct wifi_bss_element {
struct list_head list;
timestamp_t tsp;
uint8_t bssid[6];
char ssid[33];
bool enabled;
uint32_t uptime;
uint64_t tx_ucast_bytes;
uint64_t rx_ucast_bytes;
uint64_t tx_mcast_bytes;
uint64_t rx_mcast_bytes;
uint64_t tx_bcast_bytes;
uint64_t rx_bcast_bytes;
enum counter_unit unit;
uint8_t is_ac_be; //deprecate
uint8_t is_ac_bk; //"
uint8_t is_ac_vo; //"
uint8_t is_ac_vi; //"
uint8_t est_wmm_be[3];
uint8_t est_wmm_bk[3];
uint8_t est_wmm_vi[3];
uint8_t est_wmm_vo[3];
uint32_t num_stations;
struct list_head stalist; /* list of wifi_sta_element */
bool p1_bsta_disallowed;
bool p2_bsta_disallowed;
bool sta_assoc_allowed;
bool is_bbss;
bool is_fbss;
bool r1_disallowed;
bool r2_disallowed;
bool multi_bssid;
bool transmitted_bssid;
struct wifi_multiap_steering steer_stats;
};
struct wifi_radio_capabilities {
uint8_t ht;
uint8_t vht;
uint8_t he;
uint8_t he_ap;
uint8_t he_bsta;
uint32_t num_supp_opclass;
struct list_head supp_opclasslist; /* list of wifi_opclass_supported_element */
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
struct wifi_akm_suite akm_fbss;
struct wifi_akm_suite akm_bbss;
};
struct wifi_radio_scan_capabilities {
bool boot_only;
uint8_t impact;
uint32_t interval;
size_t num_opclass;
struct list_head opclasslist;
};
enum wifi_cac_method {
CAC_METHOD_CONTINUOUS,
CAC_METHOD_CONTINUOUS_DEDICATED,
CAC_METHOD_MIMO_REDUCED,
CAC_METHOD_TIMESLICED,
};
struct wifi_radio_cac_capabilities {
enum wifi_cac_method method;
uint32_t num_seconds;
size_t num_opclass;
struct list_head supp_opclasslist;
};
/* represents a scanned AP entry */
struct wifi_scanres_neighbor_element {
struct list_head list;
uint8_t bssid[6];
char ssid[33];
int rssi;
uint32_t bw;
uint8_t utilization;
uint32_t num_stations;
};
struct wifi_scanres_channel_element {
struct list_head list;
timestamp_t tsp;
uint8_t channel;
uint8_t utilization;
uint8_t anpi;
uint32_t num_neighbors;
struct list_head nbrlist; /* list of wifi_scanres_neighbor_element */
bool report_independent_scan;
};
struct wifi_scanres_opclass_element {
struct list_head list;
uint8_t opclass;
uint32_t num_channels_scanned;
struct list_head channel_scanlist; /* list of wifi_scanres_channel_element */
};
struct wifi_scanres_element {
struct list_head list;
timestamp_t tsp;
uint32_t num_opclass_scanned;
struct list_head opclass_scanlist; /* list of wifi_scanres_opclass_element */
};
struct wifi_backhaul_element {
uint8_t macaddr[6];
};
struct wifi_unassoc_sta_element {
struct list_head list;
uint8_t macaddr[6];
uint8_t rcpi;
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
//struct wifi_sta_measurement meas;
};
struct wifi_radio_element {
struct list_head list;
uint8_t macaddr[6];
bool enabled;
struct wifi_radio_element_report {
uint8_t sta_rcpi_threshold; /* 0 = disable; else 1..220 */
uint8_t sta_rcpi_margin_override; /* 0 = disable; else value */
uint8_t channel_util_threshold; /* 0 = disable; else value */
bool include_sta_stats; /* bit7 = include stats */
bool include_sta_metrics; /* bit6 = include link metrics */
bool include_wifi6_metrics;
} report;
uint8_t steer_policy; /* 0, 1 or 2 */
uint8_t channel_util_threshold; /* 0..220 */
uint8_t rcpi_steer_threshold; /* 0..220 */
uint8_t anpi; /* avg noise to power indicator */
uint8_t total_utilization; /** in %age, linearly scaled 0..255 */
uint8_t tx_utilization;
uint8_t rx_utilization;
uint8_t other_utilization;
uint8_t tx_streams;
uint8_t rx_streams;
char country_code[4];
uint32_t num_bss;
uint32_t num_unassoc_sta;
uint32_t num_scanresult;
struct wifi_backhaul_element bsta;
struct wifi_caps_element caps;
struct wifi_opclass opclass; /* E-4 table reported by device */
struct wifi_opclass cur_opclass; /* current opclass reported by device */
struct list_head bsslist; /* list of wifi_bss_element */
struct list_head unassoc_stalist; /* list of wifi_unassoc_sta_element */
struct list_head scanlist; /* list of wifi_scanres_element */
int ts_combined_fronthaul;
int ts_combined_backhaul;
char vendor[64]; /* chipset vendor */
struct wifi_radio_scan_capabilities scan_caps;
struct wifi_radio_cac_capabilities cac_caps;
struct wifi_radio_capabilities radio_caps;
};
struct wifi_default_8021q {
uint8_t pvid;
uint8_t pcp;
struct list_head list;
};
struct ieee1905_security_caps {
uint8_t onboarding_protocol;
uint8_t integrity;
uint8_t encryption;
};
struct wifi_sp_rule {
uint32_t id;
uint8_t priority;
uint8_t output;
bool always_match;
struct list_head list;
};
timestamp_t tsp;
uint64_t tx_bytes;
uint64_t rx_bytes;
uint32_t tx_pkts;
uint32_t rx_pkts;
uint32_t tx_errors;
uint32_t rx_errors;
uint8_t link_utilization; /* in %age */
uint8_t rcpi;
uint32_t dl_rate; /* latest data rate in Kbps: ap -> bsta */
uint32_t ul_rate; /* latest data rate in Kbps: bsta -> ap */
};
/* TODO: fill in or remove from wifi_network_device */
struct wifi_network_tspolicy {
bool foo;
};
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
enum network_link_type {
LINK_TYPE_NONE = 0,
LINK_TYPE_WIFI = 1,
LINK_TYPE_ETH = 2,
LINK_TYPE_MOCA = 3,
LINK_TYPE_GHN = 4,
LINK_TYPE_HPNA = 5,
LINK_TYPE_HOME = 6,
LINK_TYPE_UPA = 7,
};
struct wifi_network_device_backhaul {
enum network_link_type linktype;
uint8_t bsta_macaddr[6];
uint8_t upstream_device_macaddr[6];
uint8_t upstream_bbss_macaddr[6];
uint32_t num_curr_opclass;
struct list_head curr_opclasslist; /* list of wifi_opclass_current_element */
struct wifi_backhaul_stats stats;
};
enum operation_mode {
NOT_SUPPORTED = 0,
SUPPORTED = 1,
RUNNING = 2,
};
struct wifi_multi_ap_device {
uint8_t oui[3];
timestamp_t last_contacttime;
struct wifi_network_device *dev_ref;
enum operation_mode controller_opmode;
enum operation_mode agent_opmode;
struct wifi_network_device_backhaul backhaul;
};
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
struct wifi_network_device {
uint8_t macaddr[6]; /* unique device-id: eui-48 address */
uint8_t map_caps[2]; /* multi-ap caps */
uint32_t collect_int; /* data collection interval in msecs */
struct wifi_network_device_report {
uint8_t ap_metrics_int; /* 0 = disable; 1-255 in seconds */
bool independent_scans;
uint32_t sta_assoc_fails; /* 0 = disable; max-rate/minute */
bool include_wifi6_metrics;
} report;
uint32_t map_profile; /* MAP-Profile; 1, 2, 3 etc. */
uint32_t num_radios;
struct list_head radiolist; /* list of wifi_radio_element */
time_t last_contacttime;
char manufacturer[65];
uint8_t oui[3];
char serial[33];
char model[33];
char osversion[65];
char execenv[65];
uint32_t num_cacstatus;
uint32_t num_sprules;
struct list_head sta_steer_disallowlist;
struct list_head sta_btmsteer_disallowlist;
struct list_head default_8021qlist; /* list of wifi_default_8021q */
struct list_head cac_statuslist; /* list of wifi_cac_status */
struct list_head sp_rulelist; /* list of wifi_sp_rule */
struct wifi_multi_ap_device multi_ap_device;
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
uint8_t dscp_mapping[64];
uint8_t max_prules;
bool support_sp;
size_t max_vids;
struct ieee1905_security_caps i1905_seccap;
char country_code[4];
bool dfs_enabled;
bool sta_steering_state;
bool ts_allowed;
bool sp_allowed;
struct wifi_network_tspolicy tspolicy;
uint32_t num_anticipated_channels;
//anticipated_chanlist
//anticipated_chanlist.usage
uint8_t has_easymesh_controller; // 0, 1 or 2
uint8_t has_easymesh_agent; // 0, 1 or 2
};
/* ssids in the multiap network */
struct wifi_network_ssid {
bool enabled;
size_t ssidlen;
uint8_t ssid[32];
uint32_t band;
uint32_t security;
uint16_t vid;
uint8_t multi_ap;
enum wifi_bsstype type;
struct list_head list;
};
struct wifi_network {
timestamp_t tsp;
char id[16]; /* network id: guid */
uint8_t cntlr_id[6]; /* controller id: macaddress */
uint32_t num_ssid;
struct list_head ssidlist; /* list of wifi_network_ssid */
uint16_t primary_vid;
uint16_t default_pcp;
macaddr_t *disallow_scslist;
macaddr_t *disallow_mscslist;
uint32_t num_devices;
struct wifi_steer_summary steer_summary;
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
struct wifi_network_device device[];
};
struct wifi_data_element {
timestamp_t tsp;
char version[32];
struct wifi_network network;
};
struct wifi_assoc_events {
timestamp_t tsp;
uint8_t macaddr[6];
uint8_t bssid[6];
uint16_t status_code;
struct wifi_caps_element caps;
};
struct wifi_disassoc_events {
timestamp_t tsp;
uint8_t bssid[6];
uint16_t reason_code;
struct wifi_sta_element sta_data;
};
struct wifi_sta_events {
uint32_t old_assoc_events;
uint32_t old_disassoc_events;
uint32_t num_assoc_events;
uint32_t num_disassoc_events;
struct list_head assoc_eventlist; /* list of wifi_assoc_events */
struct list_head disassoc_eventlist; /* list of wifi_disassoc_events */
};
struct wifi_channel_data {
uint8_t channel;
uint8_t utilization;
uint8_t anpi;
};
struct radio_event_data {
uint8_t macaddr[6];
uint32_t num_cdata;
struct wifi_channel_data *cdata;
};
struct wifi_radio_events {
uint32_t num_radios;
struct radio_event_data *rdata;
};
#ifdef __cplusplus
}
#endif
#endif /* WIFI_DATAELEMENTS_H */