/* * Driver interface definition * Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi> * * This software may be distributed under the terms of the BSD license. * See README for more details. * * This file defines a driver interface used by both %wpa_supplicant and * hostapd. The first part of the file defines data structures used in various * driver operations. This is followed by the struct wpa_driver_ops that each * driver wrapper will beed to define with callback functions for requesting * driver operations. After this, there are definitions for driver event * reporting with wpa_supplicant_event() and some convenience helper functions * that can be used to report events. *//* ... */#ifndefDRIVER_H#defineDRIVER_H#defineWPA_SUPPLICANT_DRIVER_VERSION4#include"common/defs.h"#include"common/ieee802_11_defs.h"#include"common/wpa_common.h"#include"utils/list.h"structwpa_bss;structwpa_supplicant;/** * struct wpa_scan_res - Scan result for an BSS/IBSS * @flags: information flags about the BSS/IBSS (WPA_SCAN_*) * @bssid: BSSID * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1) * @beacon_int: beacon interval in TUs (host byte order) * @caps: capability information field in host byte order * @qual: signal quality * @noise: noise level * @level: signal level * @tsf: Timestamp * @age: Age of the information in milliseconds (i.e., how many milliseconds * ago the last Beacon or Probe Response frame was received) * @snr: Signal-to-noise ratio in dB (calculated during scan result processing) * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms * of TSF of the BSS specified by %tsf_bssid. * @tsf_bssid: The BSS that %parent_tsf TSF time refers to. * @ie_len: length of the following IE field in octets * @beacon_ie_len: length of the following Beacon IE field in octets * * This structure is used as a generic format for scan results from the * driver. Each driver interface implementation is responsible for converting * the driver or OS specific scan results into this format. * * If the driver does not support reporting all IEs, the IE data structure is * constructed of the IEs that are available. This field will also need to * include SSID in IE format. All drivers are encouraged to be extended to * report all IEs to make it easier to support future additions. * * This structure data is followed by ie_len octets of IEs from Probe Response * frame (or if the driver does not indicate source of IEs, these may also be * from Beacon frame). After the first set of IEs, another set of IEs may follow * (with beacon_ie_len octets of data) if the driver provides both IE sets. *//* ... */structwpa_scan_res{unsignedintflags;u8bssid[ETH_ALEN];intchan;u16beacon_int;u16caps;intnoise;intlevel;u64tsf;unsignedintage;u64parent_tsf;u8tsf_bssid[ETH_ALEN];size_tie_len;size_tbeacon_ie_len;/* Followed by ie_len + beacon_ie_len octets of IE data */}{ ... };/** * struct wpa_scan_results - Scan results * @res: Array of pointers to allocated variable length scan result entries * @num: Number of entries in the scan result array * @fetch_time: Time when the results were fetched from the driver *//* ... */structwpa_scan_results{structwpa_scan_res**res;size_tnum;structos_reltimefetch_time;}{ ... };#defineWPAS_MAX_SCAN_SSIDS1/** * struct wpa_driver_scan_ssid - SSIDs to scan for * @ssid - specific SSID to scan for (ProbeReq) * %NULL or zero-length SSID is used to indicate active scan * with wildcard SSID. * @ssid_len - Length of the SSID in octets *//* ... */structwpa_driver_scan_ssid{constu8*ssid;size_tssid_len;}{ ... };/** * struct wpa_driver_scan_params - Scan parameters * Data for struct wpa_driver_ops::scan2(). *//* ... */structwpa_driver_scan_params{/** * ssids - SSIDs to scan for *//* ... */structwpa_driver_scan_ssidssids[WPAS_MAX_SCAN_SSIDS];/** * num_ssids - Number of entries in ssids array * Zero indicates a request for a passive scan. *//* ... */size_tnum_ssids;/** * freqs - Array of frequencies to scan or %NULL for all frequencies * * The frequency is set in MHz. The array is zero-terminated. *//* ... */intchannel;/** * bssid - Specific BSSID to scan for * * This optional parameter can be used to replace the default wildcard * BSSID with a specific BSSID to scan for if results are needed from * only a single BSS. *//* ... */constu8*bssid;/** * duration - Dwell time on each channel * * This optional parameter can be used to set the dwell time on each * channel. In TUs. *//* ... */u16duration;unsignedintduration_mandatory;u8mode;}{ ... };/** * struct scan_info - Optional data for EVENT_SCAN_RESULTS events * @aborted: Whether the scan was aborted * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned) * @num_freqs: Number of entries in freqs array * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard * SSID) * @num_ssids: Number of entries in ssids array * @external_scan: Whether the scan info is for an external scan * @nl_scan_event: 1 if the source of this scan event is a normal scan, * 0 if the source of the scan event is a vendor scan * @scan_start_tsf: Time when the scan started in terms of TSF of the * BSS that the interface that requested the scan is connected to * (if available). * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf * is set. *//* ... */structscan_info{intaborted;constint*freqs;size_tnum_freqs;structwpa_driver_scan_ssidssids[WPAS_MAX_SCAN_SSIDS];size_tnum_ssids;intexternal_scan;intnl_scan_event;u64scan_start_tsf;u8scan_start_tsf_bssid[ETH_ALEN];}{ ... };structwpa_bss_trans_info{u8mbo_transition_reason;u8n_candidates;u8*bssid;}{ ... };structwpa_bss_candidate_info{u8num;structcandidate_list{u8bssid[ETH_ALEN];u8is_accept;u32reject_reason;}{ ... }*candidates;}{ ... };/* driver_common.c */voidwpa_scan_results_free(structwpa_scan_results*res);intwpa_drv_send_action(structwpa_supplicant*wpa_s,unsignedintchan,unsignedintwait,constu8*data,size_tdata_len,intno_cck);voidwpa_supplicant_connect(structwpa_supplicant*wpa_s,structwpa_bss*bss,char*ssid);/* ... */#endif/* DRIVER_H */
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.