blob: 6379d9d06c9ac4c5e85a75f37a02d6ea524a8fd1 [file] [log] [blame]
Hai Shalom74f70d42019-02-11 14:42:39 -08001/*
2 * Operating Channel Validation (OCV)
3 * Copyright (c) 2018, Mathy Vanhoef
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8
9#ifndef OCV_H
10#define OCV_H
11
12struct wpa_channel_info;
13
14struct oci_info {
15 /* Values in the OCI element */
16 u8 op_class;
17 u8 channel;
18 u8 seg1_idx;
19
20 /* Derived values for easier verification */
21 int freq;
22 int sec_channel;
23 int chanwidth;
24};
25
26#define OCV_OCI_LEN 3
27#define OCV_OCI_EXTENDED_LEN (3 + OCV_OCI_LEN)
28#define OCV_OCI_KDE_LEN (2 + RSN_SELECTOR_LEN + OCV_OCI_LEN)
29
30extern char ocv_errorstr[256];
31
32int ocv_derive_all_parameters(struct oci_info *oci);
33int ocv_insert_oci(struct wpa_channel_info *ci, u8 **argpos);
34int ocv_insert_oci_kde(struct wpa_channel_info *ci, u8 **argpos);
35int ocv_insert_extended_oci(struct wpa_channel_info *ci, u8 *pos);
36int ocv_verify_tx_params(const u8 *oci_ie, size_t oci_ie_len,
37 struct wpa_channel_info *ci, int tx_chanwidth,
38 int tx_seg1_idx);
39
40#endif /* OCV_H */