这篇教程C++ wpa_msg_ctrl函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wpa_msg_ctrl函数的典型用法代码示例。如果您正苦于以下问题:C++ wpa_msg_ctrl函数的具体用法?C++ wpa_msg_ctrl怎么用?C++ wpa_msg_ctrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wpa_msg_ctrl函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wpas_wps_notify_scan_resultsvoid wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s){ struct wpa_bss *bss; if (wpa_s->disconnected || wpa_s->wpa_state >= WPA_ASSOCIATED) return; dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) { struct wpabuf *ie; ie = wpa_bss_get_vendor_ie_multi(bss, WPS_IE_VENDOR_TYPE); if (!ie) continue; if (wps_is_selected_pbc_registrar(ie)) wpa_msg_ctrl(wpa_s, MSG_INFO, WPS_EVENT_AP_AVAILABLE_PBC); else if (wps_is_selected_pin_registrar(ie)) wpa_msg_ctrl(wpa_s, MSG_INFO, WPS_EVENT_AP_AVAILABLE_PIN); else wpa_msg_ctrl(wpa_s, MSG_INFO, WPS_EVENT_AP_AVAILABLE); wpabuf_free(ie); break; }}
开发者ID:2014-class,项目名称:freerouter,代码行数:25,
示例2: eapol_test_cert_cbstatic void eapol_test_cert_cb(void *ctx, int depth, const char *subject, const char *cert_hash, const struct wpabuf *cert){ struct eapol_test_data *e = ctx; wpa_msg(e->wpa_s, MSG_INFO, WPA_EVENT_EAP_PEER_CERT "depth=%d subject='%s'%s%s", depth, subject, cert_hash ? " hash=" : "", cert_hash ? cert_hash : ""); if (cert) { char *cert_hex; size_t len = wpabuf_len(cert) * 2 + 1; cert_hex = os_malloc(len); if (cert_hex) { wpa_snprintf_hex(cert_hex, len, wpabuf_head(cert), wpabuf_len(cert)); wpa_msg_ctrl(e->wpa_s, MSG_INFO, WPA_EVENT_EAP_PEER_CERT "depth=%d subject='%s' cert=%s", depth, subject, cert_hex); os_free(cert_hex); } if (e->server_cert_file) eapol_test_write_cert(e->server_cert_file, subject, cert); }}
开发者ID:MultiNet-80211,项目名称:Hostapd,代码行数:31,
示例3: wpas_notify_state_changedvoid wpas_notify_state_changed(struct wpa_supplicant *wpa_s, enum wpa_states new_state, enum wpa_states old_state){ /* notify the old DBus API */ wpa_supplicant_dbus_notify_state_change(wpa_s, new_state, old_state); /* notify the new DBus API */ wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_STATE);#ifdef CONFIG_P2P if (new_state == WPA_COMPLETED) wpas_p2p_notif_connected(wpa_s); else if (old_state >= WPA_ASSOCIATED && new_state < WPA_ASSOCIATED) wpas_p2p_notif_disconnected(wpa_s);#endif /* CONFIG_P2P */ sme_state_changed(wpa_s);#ifdef ANDROID wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE "id=%d state=%d BSSID=" MACSTR " SSID=%s", wpa_s->current_ssid ? wpa_s->current_ssid->id : -1, new_state, MAC2STR(wpa_s->bssid), wpa_s->current_ssid && wpa_s->current_ssid->ssid ? wpa_ssid_txt(wpa_s->current_ssid->ssid, wpa_s->current_ssid->ssid_len) : "");#endif /* ANDROID */}
开发者ID:Aratori,项目名称:Roaming,代码行数:31,
示例4: wpas_notify_certificationvoid wpas_notify_certification(struct wpa_supplicant *wpa_s, int depth, const char *subject, const char *cert_hash, const struct wpabuf *cert){ wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_EAP_PEER_CERT "depth=%d subject='%s'%s%s", depth, subject, cert_hash ? " hash=" : "", cert_hash ? cert_hash : ""); if (cert) { char *cert_hex; size_t len = wpabuf_len(cert) * 2 + 1; cert_hex = os_malloc(len); if (cert_hex) { wpa_snprintf_hex(cert_hex, len, wpabuf_head(cert), wpabuf_len(cert)); wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_EAP_PEER_CERT "depth=%d subject='%s' cert=%s", depth, subject, cert_hex); os_free(cert_hex); } } /* notify the old DBus API */ wpa_supplicant_dbus_notify_certification(wpa_s, depth, subject, cert_hash, cert); /* notify the new DBus API */ wpas_dbus_signal_certification(wpa_s, depth, subject, cert_hash, cert);}
开发者ID:Aratori,项目名称:Roaming,代码行数:31,
示例5: wpas_notify_bss_removedvoid wpas_notify_bss_removed(struct wpa_supplicant *wpa_s, u8 bssid[], unsigned int id){ wpas_dbus_unregister_bss(wpa_s, bssid, id); wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_REMOVED "%u " MACSTR, id, MAC2STR(bssid));}
开发者ID:Aratori,项目名称:Roaming,代码行数:7,
示例6: wpas_notify_eap_statusvoid wpas_notify_eap_status(struct wpa_supplicant *wpa_s, const char *status, const char *parameter){ wpas_dbus_signal_eap_status(wpa_s, status, parameter); wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_EAP_STATUS "status='%s' parameter='%s'", status, parameter);}
开发者ID:Aratori,项目名称:Roaming,代码行数:8,
示例7: scan_only_handler/** * scan_only_handler - Reports scan results */void scan_only_handler(struct wpa_supplicant *wpa_s, struct wpa_scan_results *scan_res){ wpa_dbg(wpa_s, MSG_DEBUG, "Scan-only results received"); wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS); wpas_notify_scan_results(wpa_s); wpas_notify_scan_done(wpa_s, 1);}
开发者ID:GabberBaby,项目名称:peapwn,代码行数:11,
示例8: wpas_notify_bss_addedvoid wpas_notify_bss_added(struct wpa_supplicant *wpa_s, u8 bssid[], unsigned int id){ if (wpa_s->p2p_mgmt) return; wpas_dbus_register_bss(wpa_s, bssid, id); wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_ADDED "%u " MACSTR, id, MAC2STR(bssid));}
开发者ID:cococorp,项目名称:hostap-upstream,代码行数:10,
示例9: scan_only_handler/** * scan_only_handler - Reports scan results */void scan_only_handler(struct wpa_supplicant *wpa_s, struct wpa_scan_results *scan_res){ wpa_dbg(wpa_s, MSG_DEBUG, "Scan-only results received"); if (wpa_s->last_scan_req == MANUAL_SCAN_REQ && wpa_s->manual_scan_use_id && wpa_s->own_scan_running) { wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS "id=%u", wpa_s->manual_scan_id); wpa_s->manual_scan_use_id = 0; } else { wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS); } wpas_notify_scan_results(wpa_s); wpas_notify_scan_done(wpa_s, 1); if (wpa_s->scan_work) { struct wpa_radio_work *work = wpa_s->scan_work; wpa_s->scan_work = NULL; radio_work_done(work); }}
开发者ID:kusumi,项目名称:DragonFlyBSD,代码行数:23,
示例10: hostapd_wps_enrollee_seen_cbstatic void hostapd_wps_enrollee_seen_cb(void *ctx, const u8 *addr, const u8 *uuid_e, const u8 *pri_dev_type, u16 config_methods, u16 dev_password_id, u8 request_type, const char *dev_name){ struct hostapd_data *hapd = ctx; char uuid[40]; char devtype[WPS_DEV_TYPE_BUFSIZE]; if (uuid_bin2str(uuid_e, uuid, sizeof(uuid))) return; if (dev_name == NULL) dev_name = ""; wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ENROLLEE_SEEN MACSTR " %s %s 0x%x %u %u [%s]", MAC2STR(addr), uuid, wps_dev_type_bin2str(pri_dev_type, devtype, sizeof(devtype)), config_methods, dev_password_id, request_type, dev_name);}
开发者ID:MindShow,项目名称:amlogic_s905_kernel_merges,代码行数:21,
示例11: wpa_supplicant_event_scan_resultsstatic void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s){ int prio, timeout; struct wpa_scan_res *selected = NULL; struct wpa_ssid *ssid = NULL; wpa_supplicant_notify_scanning(wpa_s, 0); if (wpa_supplicant_get_scan_results(wpa_s) < 0) { if (wpa_s->conf->ap_scan == 2) return; wpa_printf(MSG_DEBUG, "Failed to get scan results - try " "scanning again"); timeout = 1; goto req_scan; } /* * Don't post the results if this was the initial cached * and there were no results. */ if (wpa_s->scan_res_tried == 1 && wpa_s->conf->ap_scan == 1 && wpa_s->scan_res->num == 0) { wpa_msg(wpa_s, MSG_DEBUG, "Cached scan results are " "empty - not posting"); } else { wpa_printf(MSG_DEBUG, "New scan results available"); wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS); wpa_supplicant_dbus_notify_scan_results(wpa_s); wpas_wps_notify_scan_results(wpa_s); } if ((wpa_s->conf->ap_scan == 2 && !wpas_wps_searching(wpa_s))) return; if (wpa_s->disconnected) { wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED); return; } while (selected == NULL) { for (prio = 0; prio < wpa_s->conf->num_prio; prio++) { selected = wpa_supplicant_select_bss( wpa_s, wpa_s->conf->pssid[prio], &ssid); if (selected) break; } if (selected == NULL && wpa_s->blacklist) { wpa_printf(MSG_DEBUG, "No APs found - clear blacklist " "and try again"); wpa_blacklist_clear(wpa_s); wpa_s->blacklist_cleared++; } else if (selected == NULL) { break; } } if (selected) { if (wpas_wps_scan_pbc_overlap(wpa_s, selected, ssid)) { wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_OVERLAP "PBC session overlap"); timeout = 10; goto req_scan; } /* Do not trigger new association unless the BSSID has changed * or if reassociation is requested. If we are in process of * associating with the selected BSSID, do not trigger new * attempt. */ if (wpa_s->reassociate || (os_memcmp(selected->bssid, wpa_s->bssid, ETH_ALEN) != 0 && (wpa_s->wpa_state != WPA_ASSOCIATING || os_memcmp(selected->bssid, wpa_s->pending_bssid, ETH_ALEN) != 0))) { if (wpa_supplicant_scard_init(wpa_s, ssid)) { wpa_supplicant_req_scan(wpa_s, 10, 0); return; } wpa_supplicant_associate(wpa_s, selected, ssid); } else { wpa_printf(MSG_DEBUG, "Already associated with the " "selected AP."); } rsn_preauth_scan_results(wpa_s->wpa, wpa_s->scan_res); } else { wpa_printf(MSG_DEBUG, "No suitable AP found."); timeout = 5; goto req_scan; } return;req_scan: if (wpa_s->scan_res_tried == 1 && wpa_s->conf->ap_scan == 1) { /* * Quick recovery if the initial scan results were not * complete when fetched before the first scan request. */ wpa_s->scan_res_tried++;//.........这里部分代码省略.........
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:101,
示例12: wpa_supplicant_event_scan_resultsstatic void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, union wpa_event_data *data){ struct wpa_bss *selected; struct wpa_ssid *ssid = NULL; struct wpa_scan_results *scan_res; int ap = 0;#ifdef CONFIG_AP if (wpa_s->ap_iface) ap = 1;#endif /* CONFIG_AP */ wpa_supplicant_notify_scanning(wpa_s, 0); scan_res = wpa_supplicant_get_scan_results(wpa_s, data ? &data->scan_info : NULL, 1); if (scan_res == NULL) { if (wpa_s->conf->ap_scan == 2 || ap) return; wpa_printf(MSG_DEBUG, "Failed to get scan results - try " "scanning again"); wpa_supplicant_req_new_scan(wpa_s, 1, 0); return; } if (wpa_s->scan_res_handler) { wpa_s->scan_res_handler(wpa_s, scan_res); wpa_s->scan_res_handler = NULL; wpa_scan_results_free(scan_res); return; } if (ap) { wpa_printf(MSG_DEBUG, "Ignore scan results in AP mode"); wpa_scan_results_free(scan_res); return; } wpa_printf(MSG_DEBUG, "New scan results available"); wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS); wpas_notify_scan_results(wpa_s); wpas_notify_scan_done(wpa_s, 1); if ((wpa_s->conf->ap_scan == 2 && !wpas_wps_searching(wpa_s))) { wpa_scan_results_free(scan_res); return; } if (wpa_s->disconnected) { wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED); wpa_scan_results_free(scan_res); return; } wpa_supplicant_rsn_preauth_scan_results(wpa_s, scan_res); selected = wpa_supplicant_pick_network(wpa_s, scan_res, &ssid); if (selected) { int skip; skip = !wpa_supplicant_need_to_roam(wpa_s, selected, ssid, scan_res); wpa_scan_results_free(scan_res); if (skip) return; wpa_supplicant_connect(wpa_s, selected, ssid); } else { wpa_scan_results_free(scan_res); wpa_printf(MSG_DEBUG, "No suitable network found"); ssid = wpa_supplicant_pick_new_network(wpa_s); if (ssid) { wpa_printf(MSG_DEBUG, "Setup a new network"); wpa_supplicant_associate(wpa_s, NULL, ssid); } else { int timeout_sec = 5; int timeout_usec = 0;#ifdef CONFIG_P2P if (wpa_s->p2p_in_provisioning) { /* * Use shorter wait during P2P Provisioning * state to speed up group formation. */ timeout_sec = 0; timeout_usec = 250000; }#endif /* CONFIG_P2P */ wpa_supplicant_req_new_scan(wpa_s, timeout_sec, timeout_usec); } }}
开发者ID:Keepenjoying,项目名称:lw_hostap,代码行数:94,
示例13: wpa_supplicant_event_scan_resultsstatic void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, union wpa_event_data *data){ //struct wpa_bss *selected; //struct wpa_ssid *ssid = NULL; struct wpa_scan_results *scan_res; wpa_supplicant_notify_scanning(wpa_s, 0); scan_res = wpa_supplicant_get_scan_results(wpa_s, data ? &data->scan_info : NULL, 1); ros_scan_completed(wpa_s, scan_res); if (scan_res == NULL) { if (wpa_s->conf->ap_scan == 2) return; wpa_printf(MSG_DEBUG, "Failed to get scan results - don't bother try " "scanning again"); //wpa_supplicant_req_new_scan(wpa_s, 1, 0); return; } if (wpa_s->scan_res_handler) { wpa_s->scan_res_handler(wpa_s, scan_res); wpa_s->scan_res_handler = NULL; wpa_scan_results_free(scan_res); return; } /* * Don't post the results if this was the initial cached * and there were no results. */ if (wpa_s->scan_res_tried == 1 && wpa_s->conf->ap_scan == 1 && scan_res->num == 0) { wpa_msg(wpa_s, MSG_DEBUG, "Cached scan results are " "empty - not posting"); } else { wpa_printf(MSG_DEBUG, "New scan results available"); wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS); wpas_notify_scan_results(wpa_s); } wpas_notify_scan_done(wpa_s, 1); if ((wpa_s->conf->ap_scan == 2 && !wpas_wps_searching(wpa_s))) { wpa_scan_results_free(scan_res); return; } if (wpa_s->disconnected) { wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED); wpa_scan_results_free(scan_res); return; } if (bgscan_notify_scan(wpa_s) == 1) { wpa_scan_results_free(scan_res); return; } wpa_supplicant_rsn_preauth_scan_results(wpa_s, scan_res); /*selected = wpa_supplicant_pick_network(wpa_s, scan_res, &ssid); if (selected) { int skip; wpa_s->more_bss_to_try = 1; skip = !wpa_supplicant_need_to_roam(wpa_s, selected, ssid, scan_res); wpa_scan_results_free(scan_res); if (skip) return; wpa_supplicant_connect(wpa_s, selected, ssid); } else { wpa_s->more_bss_to_try = 0; wpa_scan_results_free(scan_res); wpa_printf(MSG_DEBUG, "No suitable network found"); ssid = wpa_supplicant_pick_new_network(wpa_s); if (ssid) { wpa_printf(MSG_DEBUG, "Setup a new network"); wpa_supplicant_associate(wpa_s, NULL, ssid); } else { int timeout_sec = 1; int timeout_usec = 0; wpa_supplicant_req_new_scan(wpa_s, timeout_sec, timeout_usec); } } */}
开发者ID:PR2,项目名称:linux_networking,代码行数:92,
注:本文中的wpa_msg_ctrl函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wpa_printf函数代码示例 C++ wpa_hexdump_buf函数代码示例 |