mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-18 02:44:03 -05:00
Use C99 designated initializers to cleanup driver_ops setup
These driver wrappers use UNIX domain sockets and as such, won't be built with Microsoft compiler. Consequently, use of C99-style designated initializers can be used to make these files easier to maintain. Only driver_ndis.c needs to support the old C89-style due to Microsoft compiler not supporting newer C standard.
This commit is contained in:
parent
61693eaa80
commit
b08d177aad
@ -768,100 +768,22 @@ static int wpa_driver_privsep_set_country(void *priv, const char *alpha2)
|
|||||||
struct wpa_driver_ops wpa_driver_privsep_ops = {
|
struct wpa_driver_ops wpa_driver_privsep_ops = {
|
||||||
"privsep",
|
"privsep",
|
||||||
"wpa_supplicant privilege separated driver",
|
"wpa_supplicant privilege separated driver",
|
||||||
wpa_driver_privsep_get_bssid,
|
.get_bssid = wpa_driver_privsep_get_bssid,
|
||||||
wpa_driver_privsep_get_ssid,
|
.get_ssid = wpa_driver_privsep_get_ssid,
|
||||||
wpa_driver_privsep_set_wpa,
|
.set_wpa = wpa_driver_privsep_set_wpa,
|
||||||
wpa_driver_privsep_set_key,
|
.set_key = wpa_driver_privsep_set_key,
|
||||||
wpa_driver_privsep_init,
|
.init = wpa_driver_privsep_init,
|
||||||
wpa_driver_privsep_deinit,
|
.deinit = wpa_driver_privsep_deinit,
|
||||||
wpa_driver_privsep_set_param,
|
.set_param = wpa_driver_privsep_set_param,
|
||||||
NULL /* set_countermeasures */,
|
.scan = wpa_driver_privsep_scan,
|
||||||
NULL /* set_drop_unencrypted */,
|
.deauthenticate = wpa_driver_privsep_deauthenticate,
|
||||||
wpa_driver_privsep_scan,
|
.disassociate = wpa_driver_privsep_disassociate,
|
||||||
NULL /* get_scan_results */,
|
.associate = wpa_driver_privsep_associate,
|
||||||
wpa_driver_privsep_deauthenticate,
|
.get_capa = wpa_driver_privsep_get_capa,
|
||||||
wpa_driver_privsep_disassociate,
|
.get_mac_addr = wpa_driver_privsep_get_mac_addr,
|
||||||
wpa_driver_privsep_associate,
|
.get_scan_results2 = wpa_driver_privsep_get_scan_results2,
|
||||||
NULL /* set_auth_alg */,
|
.set_mode = wpa_driver_privsep_set_mode,
|
||||||
NULL /* add_pmkid */,
|
.set_country = wpa_driver_privsep_set_country,
|
||||||
NULL /* remove_pmkid */,
|
|
||||||
NULL /* flush_pmkid */,
|
|
||||||
wpa_driver_privsep_get_capa,
|
|
||||||
NULL /* poll */,
|
|
||||||
NULL /* get_ifname */,
|
|
||||||
wpa_driver_privsep_get_mac_addr,
|
|
||||||
NULL /* send_eapol */,
|
|
||||||
NULL /* set_operstate */,
|
|
||||||
NULL /* mlme_setprotection */,
|
|
||||||
NULL /* get_hw_feature_data */,
|
|
||||||
NULL /* set_channel */,
|
|
||||||
NULL /* set_ssid */,
|
|
||||||
NULL /* set_bssid */,
|
|
||||||
NULL /* send_mlme */,
|
|
||||||
NULL /* mlme_add_sta */,
|
|
||||||
NULL /* mlme_remove_sta */,
|
|
||||||
NULL /* update_ft_ies */,
|
|
||||||
NULL /* send_ft_action */,
|
|
||||||
wpa_driver_privsep_get_scan_results2,
|
|
||||||
NULL /* set_probe_req_ie */,
|
|
||||||
wpa_driver_privsep_set_mode,
|
|
||||||
wpa_driver_privsep_set_country,
|
|
||||||
NULL /* global_init */,
|
|
||||||
NULL /* global_deinit */,
|
|
||||||
NULL /* init2 */,
|
|
||||||
NULL /* get_interfaces */,
|
|
||||||
NULL /* scan2 */,
|
|
||||||
NULL /* authenticate */,
|
|
||||||
NULL /* set_beacon */,
|
|
||||||
NULL /* set_beacon_int */,
|
|
||||||
NULL /* hapd_init */,
|
|
||||||
NULL /* hapd_deinit */,
|
|
||||||
NULL /* set_ieee8021x */,
|
|
||||||
NULL /* set_privacy */,
|
|
||||||
NULL /* hapd_set_key */,
|
|
||||||
NULL /* get_seqnum */,
|
|
||||||
NULL /* get_seqnum_igtk */,
|
|
||||||
NULL /* flush */,
|
|
||||||
NULL /* set_generic_elem */,
|
|
||||||
NULL /* read_sta_data */,
|
|
||||||
NULL /* hapd_send_eapol */,
|
|
||||||
NULL /* sta_deauth */,
|
|
||||||
NULL /* sta_disassoc */,
|
|
||||||
NULL /* sta_remove */,
|
|
||||||
NULL /* hapd_get_ssid */,
|
|
||||||
NULL /* hapd_set_ssid */,
|
|
||||||
NULL /* hapd_set_countermeasures */,
|
|
||||||
NULL /* sta_add */,
|
|
||||||
NULL /* get_inact_sec */,
|
|
||||||
NULL /* sta_clear_stats */,
|
|
||||||
NULL /* set_freq */,
|
|
||||||
NULL /* set_rts */,
|
|
||||||
NULL /* set_frag */,
|
|
||||||
NULL /* set_retry */,
|
|
||||||
NULL /* sta_set_flags */,
|
|
||||||
NULL /* set_rate_sets */,
|
|
||||||
NULL /* set_ieee80211d */,
|
|
||||||
NULL /* hapd_set_beacon */,
|
|
||||||
NULL /* set_internal_bridge */,
|
|
||||||
NULL /* set_broadcast_ssid */,
|
|
||||||
NULL /* set_cts_protect */,
|
|
||||||
NULL /* set_preamble */,
|
|
||||||
NULL /* set_short_slot_time */,
|
|
||||||
NULL /* set_tx_queue_params */,
|
|
||||||
NULL /* bss_add */,
|
|
||||||
NULL /* bss_remove */,
|
|
||||||
NULL /* valid_bss_mask */,
|
|
||||||
NULL /* if_add */,
|
|
||||||
NULL /* if_update */,
|
|
||||||
NULL /* if_remove */,
|
|
||||||
NULL /* set_sta_vlan */,
|
|
||||||
NULL /* commit */,
|
|
||||||
NULL /* send_ether */,
|
|
||||||
NULL /* set_radius_acl_auth */,
|
|
||||||
NULL /* set_radius_acl_expire */,
|
|
||||||
NULL /* set_ht_params */,
|
|
||||||
NULL /* set_wps_beacon_ie */,
|
|
||||||
NULL /* set_wps_probe_resp_ie */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -2465,109 +2465,34 @@ const struct wpa_driver_ops wpa_driver_test_ops = {
|
|||||||
.set_wps_beacon_ie = test_driver_set_wps_beacon_ie,
|
.set_wps_beacon_ie = test_driver_set_wps_beacon_ie,
|
||||||
.set_wps_probe_resp_ie = test_driver_set_wps_probe_resp_ie,
|
.set_wps_probe_resp_ie = test_driver_set_wps_probe_resp_ie,
|
||||||
#else /* HOSTAPD */
|
#else /* HOSTAPD */
|
||||||
wpa_driver_test_get_bssid,
|
.get_bssid = wpa_driver_test_get_bssid,
|
||||||
wpa_driver_test_get_ssid,
|
.get_ssid = wpa_driver_test_get_ssid,
|
||||||
wpa_driver_test_set_wpa,
|
.set_wpa = wpa_driver_test_set_wpa,
|
||||||
wpa_driver_test_set_key,
|
.set_key = wpa_driver_test_set_key,
|
||||||
NULL /* init */,
|
.deinit = wpa_driver_test_deinit,
|
||||||
wpa_driver_test_deinit,
|
.set_param = wpa_driver_test_set_param,
|
||||||
wpa_driver_test_set_param,
|
.deauthenticate = wpa_driver_test_deauthenticate,
|
||||||
NULL /* set_countermeasures */,
|
.disassociate = wpa_driver_test_disassociate,
|
||||||
NULL /* set_drop_unencrypted */,
|
.associate = wpa_driver_test_associate,
|
||||||
NULL /* scan */,
|
.get_capa = wpa_driver_test_get_capa,
|
||||||
NULL /* get_scan_results */,
|
.get_mac_addr = wpa_driver_test_get_mac_addr,
|
||||||
wpa_driver_test_deauthenticate,
|
.send_eapol = wpa_driver_test_send_eapol,
|
||||||
wpa_driver_test_disassociate,
|
.mlme_setprotection = wpa_driver_test_mlme_setprotection,
|
||||||
wpa_driver_test_associate,
|
|
||||||
NULL /* set_auth_alg */,
|
|
||||||
NULL /* add_pmkid */,
|
|
||||||
NULL /* remove_pmkid */,
|
|
||||||
NULL /* flush_pmkid */,
|
|
||||||
wpa_driver_test_get_capa,
|
|
||||||
NULL /* poll */,
|
|
||||||
NULL /* get_ifname */,
|
|
||||||
wpa_driver_test_get_mac_addr,
|
|
||||||
wpa_driver_test_send_eapol,
|
|
||||||
NULL /* set_operstate */,
|
|
||||||
wpa_driver_test_mlme_setprotection,
|
|
||||||
#ifdef CONFIG_CLIENT_MLME
|
#ifdef CONFIG_CLIENT_MLME
|
||||||
wpa_driver_test_get_hw_feature_data,
|
.get_hw_feature_data = wpa_driver_test_get_hw_feature_data,
|
||||||
wpa_driver_test_set_channel,
|
.set_channel = wpa_driver_test_set_channel,
|
||||||
wpa_driver_test_set_ssid,
|
.set_ssid = wpa_driver_test_set_ssid,
|
||||||
wpa_driver_test_set_bssid,
|
.set_bssid = wpa_driver_test_set_bssid,
|
||||||
wpa_driver_test_send_mlme,
|
.send_mlme = wpa_driver_test_send_mlme,
|
||||||
wpa_driver_test_mlme_add_sta,
|
.mlme_add_sta = wpa_driver_test_mlme_add_sta,
|
||||||
wpa_driver_test_mlme_remove_sta,
|
.mlme_remove_sta = wpa_driver_test_mlme_remove_sta,
|
||||||
#else /* CONFIG_CLIENT_MLME */
|
|
||||||
NULL /* get_hw_feature_data */,
|
|
||||||
NULL /* set_channel */,
|
|
||||||
NULL /* set_ssid */,
|
|
||||||
NULL /* set_bssid */,
|
|
||||||
NULL /* send_mlme */,
|
|
||||||
NULL /* mlme_add_sta */,
|
|
||||||
NULL /* mlme_remove_sta */,
|
|
||||||
#endif /* CONFIG_CLIENT_MLME */
|
#endif /* CONFIG_CLIENT_MLME */
|
||||||
NULL /* update_ft_ies */,
|
.get_scan_results2 = wpa_driver_test_get_scan_results2,
|
||||||
NULL /* send_ft_action */,
|
.set_probe_req_ie = wpa_driver_test_set_probe_req_ie,
|
||||||
wpa_driver_test_get_scan_results2,
|
.global_init = wpa_driver_test_global_init,
|
||||||
wpa_driver_test_set_probe_req_ie,
|
.global_deinit = wpa_driver_test_global_deinit,
|
||||||
NULL /* set_mode */,
|
.init2 = wpa_driver_test_init2,
|
||||||
NULL /* set_country */,
|
.get_interfaces = wpa_driver_test_get_interfaces,
|
||||||
wpa_driver_test_global_init,
|
.scan2 = wpa_driver_test_scan,
|
||||||
wpa_driver_test_global_deinit,
|
|
||||||
wpa_driver_test_init2,
|
|
||||||
wpa_driver_test_get_interfaces,
|
|
||||||
wpa_driver_test_scan,
|
|
||||||
NULL /* authenticate */,
|
|
||||||
NULL /* set_beacon */,
|
|
||||||
NULL /* set_beacon_int */,
|
|
||||||
NULL /* hapd_init */,
|
|
||||||
NULL /* hapd_deinit */,
|
|
||||||
NULL /* set_ieee8021x */,
|
|
||||||
NULL /* set_privacy */,
|
|
||||||
NULL /* hapd_set_key */,
|
|
||||||
NULL /* get_seqnum */,
|
|
||||||
NULL /* get_seqnum_igtk */,
|
|
||||||
NULL /* flush */,
|
|
||||||
NULL /* set_generic_elem */,
|
|
||||||
NULL /* read_sta_data */,
|
|
||||||
NULL /* hapd_send_eapol */,
|
|
||||||
NULL /* sta_deauth */,
|
|
||||||
NULL /* sta_disassoc */,
|
|
||||||
NULL /* sta_remove */,
|
|
||||||
NULL /* hapd_get_ssid */,
|
|
||||||
NULL /* hapd_set_ssid */,
|
|
||||||
NULL /* hapd_set_countermeasures */,
|
|
||||||
NULL /* sta_add */,
|
|
||||||
NULL /* get_inact_sec */,
|
|
||||||
NULL /* sta_clear_stats */,
|
|
||||||
NULL /* set_freq */,
|
|
||||||
NULL /* set_rts */,
|
|
||||||
NULL /* set_frag */,
|
|
||||||
NULL /* set_retry */,
|
|
||||||
NULL /* sta_set_flags */,
|
|
||||||
NULL /* set_rate_sets */,
|
|
||||||
NULL /* set_ieee80211d */,
|
|
||||||
NULL /* hapd_set_beacon */,
|
|
||||||
NULL /* set_internal_bridge */,
|
|
||||||
NULL /* set_broadcast_ssid */,
|
|
||||||
NULL /* set_cts_protect */,
|
|
||||||
NULL /* set_preamble */,
|
|
||||||
NULL /* set_short_slot_time */,
|
|
||||||
NULL /* set_tx_queue_params */,
|
|
||||||
NULL /* bss_add */,
|
|
||||||
NULL /* bss_remove */,
|
|
||||||
NULL /* valid_bss_mask */,
|
|
||||||
NULL /* if_add */,
|
|
||||||
NULL /* if_update */,
|
|
||||||
NULL /* if_remove */,
|
|
||||||
NULL /* set_sta_vlan */,
|
|
||||||
NULL /* commit */,
|
|
||||||
NULL /* send_ether */,
|
|
||||||
NULL /* set_radius_acl_auth */,
|
|
||||||
NULL /* set_radius_acl_expire */,
|
|
||||||
NULL /* set_ht_params */,
|
|
||||||
NULL /* set_wps_beacon_ie */,
|
|
||||||
NULL /* set_wps_probe_resp_ie */
|
|
||||||
#endif /* HOSTAPD */
|
#endif /* HOSTAPD */
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user