这篇教程C++ uuid_bin2str函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uuid_bin2str函数的典型用法代码示例。如果您正苦于以下问题:C++ uuid_bin2str函数的具体用法?C++ uuid_bin2str怎么用?C++ uuid_bin2str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uuid_bin2str函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: hostapd_wps_pin_needed_cbstatic void hostapd_wps_pin_needed_cb(void *ctx, const u8 *uuid_e, const struct wps_device_data *dev){ struct hostapd_data *hapd = ctx; char uuid[40], txt[400]; int len; if (uuid_bin2str(uuid_e, uuid, sizeof(uuid))) return; wpa_printf(MSG_DEBUG, "WPS: PIN needed for E-UUID %s", uuid); len = os_snprintf(txt, sizeof(txt), WPS_EVENT_PIN_NEEDED "%s " MACSTR " [%s|%s|%s|%s|%s|%d-%08X-%d]", uuid, MAC2STR(dev->mac_addr), dev->device_name, dev->manufacturer, dev->model_name, dev->model_number, dev->serial_number, dev->categ, dev->oui, dev->sub_categ); if (len > 0 && len < (int) sizeof(txt)) wpa_msg(hapd, MSG_INFO, "%s", txt); if (hapd->conf->wps_pin_requests) { FILE *f; struct os_time t; f = fopen(hapd->conf->wps_pin_requests, "a"); if (f == NULL) return; os_get_time(&t); fprintf(f, "%ld/t%s/t" MACSTR "/t%s/t%s/t%s/t%s/t%s" "/t%d-%08X-%d/n", t.sec, uuid, MAC2STR(dev->mac_addr), dev->device_name, dev->manufacturer, dev->model_name, dev->model_number, dev->serial_number, dev->categ, dev->oui, dev->sub_categ); fclose(f); }}
开发者ID:Austrie,项目名称:android_external_hostapd,代码行数:34,
示例2: wps_er_get_sidstatic int wps_er_get_sid(struct wps_er_ap *ap, char *sid){ char *pos; char txt[100]; if (!sid) { wpa_printf(MSG_DEBUG, "WPS ER: No SID received from %s (%s)", inet_ntoa(ap->addr), ap->location); return -1; } pos = os_strstr(sid, "uuid:"); if (!pos) { wpa_printf(MSG_DEBUG, "WPS ER: Invalid SID received from " "%s (%s): '%s'", inet_ntoa(ap->addr), ap->location, sid); return -1; } pos += 5; if (uuid_str2bin(pos, ap->sid) < 0) { wpa_printf(MSG_DEBUG, "WPS ER: Invalid SID received from " "%s (%s): '%s'", inet_ntoa(ap->addr), ap->location, sid); return -1; } uuid_bin2str(ap->sid, txt, sizeof(txt)); wpa_printf(MSG_DEBUG, "WPS ER: SID for subscription with %s (%s): %s", inet_ntoa(ap->addr), ap->location, txt); return 0;}
开发者ID:DentonGentry,项目名称:gfiber-gfrg100,代码行数:33,
示例3: wpa_supplicant_wps_event_er_ap_removestatic void wpa_supplicant_wps_event_er_ap_remove(struct wpa_supplicant *wpa_s, struct wps_event_er_ap *ap){ char uuid_str[100]; uuid_bin2str(ap->uuid, uuid_str, sizeof(uuid_str)); wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_ER_AP_REMOVE "%s", uuid_str);}
开发者ID:2014-class,项目名称:freerouter,代码行数:7,
示例4: event_build_messagestatic struct wpabuf * event_build_message(struct wps_event_ *e){ struct wpabuf *buf; char *b; buf = wpabuf_alloc(1000 + wpabuf_len(e->data)); if (buf == NULL) return NULL; wpabuf_printf(buf, "NOTIFY %s HTTP/1.1/r/n", e->addr->path); wpabuf_put_str(buf, "SERVER: Unspecified, UPnP/1.0, Unspecified/r/n"); wpabuf_printf(buf, "HOST: %s/r/n", e->addr->domain_and_port); wpabuf_put_str(buf, "CONTENT-TYPE: text/xml; charset=/"utf-8/"/r/n" "NT: upnp:event/r/n" "NTS: upnp:propchange/r/n"); wpabuf_put_str(buf, "SID: uuid:"); b = wpabuf_put(buf, 0); uuid_bin2str(e->s->uuid, b, 80); wpabuf_put(buf, os_strlen(b)); wpabuf_put_str(buf, "/r/n"); wpabuf_printf(buf, "SEQ: %u/r/n", e->subscriber_sequence); wpabuf_printf(buf, "CONTENT-LENGTH: %d/r/n", (int) wpabuf_len(e->data)); wpabuf_put_str(buf, "/r/n"); /* terminating empty line */ wpabuf_put_buf(buf, e->data); return buf;}
开发者ID:2asoft,项目名称:freebsd,代码行数:26,
示例5: wpa_supplicant_wps_event_er_enrollee_removestatic void wpa_supplicant_wps_event_er_enrollee_remove( struct wpa_supplicant *wpa_s, struct wps_event_er_enrollee *enrollee){ char uuid_str[100]; uuid_bin2str(enrollee->uuid, uuid_str, sizeof(uuid_str)); wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_ER_ENROLLEE_REMOVE "%s " MACSTR, uuid_str, MAC2STR(enrollee->mac_addr));}
开发者ID:2014-class,项目名称:freerouter,代码行数:8,
示例6: wpa_config_write_globalstatic int wpa_config_write_global(struct wpa_config *config, HKEY hk){#ifdef CONFIG_CTRL_IFACE wpa_config_write_reg_string(hk, "ctrl_interface", config->ctrl_interface);#endif /* CONFIG_CTRL_IFACE */ wpa_config_write_reg_dword(hk, TEXT("eapol_version"), config->eapol_version, DEFAULT_EAPOL_VERSION); wpa_config_write_reg_dword(hk, TEXT("ap_scan"), config->ap_scan, DEFAULT_AP_SCAN); wpa_config_write_reg_dword(hk, TEXT("fast_reauth"), config->fast_reauth, DEFAULT_FAST_REAUTH); wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigPMKLifetime"), config->dot11RSNAConfigPMKLifetime, 0); wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigPMKReauthThreshold"), config->dot11RSNAConfigPMKReauthThreshold, 0); wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigSATimeout"), config->dot11RSNAConfigSATimeout, 0); wpa_config_write_reg_dword(hk, TEXT("update_config"), config->update_config, 0);#ifdef CONFIG_WPS if (!is_nil_uuid(config->uuid)) { char buf[40]; uuid_bin2str(config->uuid, buf, sizeof(buf)); wpa_config_write_reg_string(hk, "uuid", buf); } wpa_config_write_reg_string(hk, "device_name", config->device_name); wpa_config_write_reg_string(hk, "manufacturer", config->manufacturer); wpa_config_write_reg_string(hk, "model_name", config->model_name); wpa_config_write_reg_string(hk, "model_number", config->model_number); wpa_config_write_reg_string(hk, "serial_number", config->serial_number); wpa_config_write_reg_string(hk, "device_type", config->device_type); wpa_config_write_reg_string(hk, "config_methods", config->config_methods); if (WPA_GET_BE32(config->os_version)) { char vbuf[10]; os_snprintf(vbuf, sizeof(vbuf), "%08x", WPA_GET_BE32(config->os_version)); wpa_config_write_reg_string(hk, "os_version", vbuf); } wpa_config_write_reg_dword(hk, TEXT("wps_cred_processing"), config->wps_cred_processing, 0);#endif /* CONFIG_WPS */ wpa_config_write_reg_dword(hk, TEXT("bss_max_count"), config->bss_max_count, DEFAULT_BSS_MAX_COUNT); wpa_config_write_reg_dword(hk, TEXT("filter_ssids"), config->filter_ssids, 0); return 0;}
开发者ID:AxelLin,项目名称:Drv,代码行数:58,
示例7: format_wps_device_xml/* format_wps_device_xml -- produce content of "file" wps_device.xml * (UPNP_WPS_DEVICE_XML_FILE) */static void format_wps_device_xml(struct upnp_wps_device_interface *iface, struct upnp_wps_device_sm *sm, struct wpabuf *buf){ const char *s; char uuid_string[80]; wpabuf_put_str(buf, wps_device_xml_prefix); /* * Add required fields with default values if not configured. Add * optional and recommended fields only if configured. */ s = iface->wps->friendly_name; s = ((s && *s) ? s : "WPS Access Point"); xml_add_tagged_data(buf, "friendlyName", s); s = iface->wps->dev.manufacturer; s = ((s && *s) ? s : ""); xml_add_tagged_data(buf, "manufacturer", s); if (iface->wps->manufacturer_url) xml_add_tagged_data(buf, "manufacturerURL", iface->wps->manufacturer_url); if (iface->wps->model_description) xml_add_tagged_data(buf, "modelDescription", iface->wps->model_description); s = iface->wps->dev.model_name; s = ((s && *s) ? s : ""); xml_add_tagged_data(buf, "modelName", s); if (iface->wps->dev.model_number) xml_add_tagged_data(buf, "modelNumber", iface->wps->dev.model_number); if (iface->wps->model_url) xml_add_tagged_data(buf, "modelURL", iface->wps->model_url); if (iface->wps->dev.serial_number) xml_add_tagged_data(buf, "serialNumber", iface->wps->dev.serial_number); uuid_bin2str(iface->wps->uuid, uuid_string, sizeof(uuid_string)); s = uuid_string; /* Need "uuid:" prefix, thus we can't use xml_add_tagged_data() * easily... */ wpabuf_put_str(buf, "<UDN>uuid:"); xml_data_encode(buf, s, os_strlen(s)); wpabuf_put_str(buf, "</UDN>/n"); if (iface->wps->upc) xml_add_tagged_data(buf, "UPC", iface->wps->upc); wpabuf_put_str(buf, wps_device_xml_postfix);}
开发者ID:2asoft,项目名称:freebsd,代码行数:61,
示例8: hostapd_wps_reg_success_cbstatic void hostapd_wps_reg_success_cb(void *ctx, const u8 *mac_addr, const u8 *uuid_e){ struct hostapd_data *hapd = ctx; char uuid[40]; if (uuid_bin2str(uuid_e, uuid, sizeof(uuid))) return; wpa_msg(hapd, MSG_INFO, WPS_EVENT_REG_SUCCESS MACSTR " %s", MAC2STR(mac_addr), uuid);}
开发者ID:Austrie,项目名称:android_external_hostapd,代码行数:10,
示例9: wps_er_ap_unsubscribestatic void wps_er_ap_unsubscribe(struct wps_er *er, struct wps_er_ap *ap){ struct wpabuf *req; struct sockaddr_in dst; char *url, *path; char sid[100]; if (ap->event_sub_url == NULL) { wpa_printf(MSG_DEBUG, "WPS ER: No eventSubURL - cannot " "subscribe"); goto fail; } if (ap->http) { wpa_printf(MSG_DEBUG, "WPS ER: Pending HTTP request - cannot " "send subscribe request"); goto fail; } url = http_client_url_parse(ap->event_sub_url, &dst, &path); if (url == NULL) { wpa_printf(MSG_DEBUG, "WPS ER: Failed to parse eventSubURL"); goto fail; } req = wpabuf_alloc(os_strlen(ap->event_sub_url) + 1000); if (req == NULL) { os_free(url); goto fail; } uuid_bin2str(ap->sid, sid, sizeof(sid)); wpabuf_printf(req, "UNSUBSCRIBE %s HTTP/1.1/r/n" "HOST: %s:%d/r/n" "SID: uuid:%s/r/n" "/r/n", path, inet_ntoa(dst.sin_addr), ntohs(dst.sin_port), sid); os_free(url); wpa_hexdump_ascii(MSG_MSGDUMP, "WPS ER: Unsubscription request", wpabuf_head(req), wpabuf_len(req)); ap->http = http_client_addr(&dst, req, 1000, wps_er_http_unsubscribe_cb, ap); if (ap->http == NULL) { wpabuf_free(req); goto fail; } return;fail: /* * Need to get rid of the AP entry even when we fail to unsubscribe * cleanly. */ wps_er_ap_unsubscribed(ap->er, ap);}
开发者ID:DentonGentry,项目名称:gfiber-gfrg100,代码行数:55,
示例10: wpa_config_process_uuidstatic int wpa_config_process_uuid(const struct global_parse_data *data, struct wpa_config *config, int line, const char *pos){ char buf[40]; if (uuid_str2bin(pos, config->uuid)) { wpa_printf(MSG_ERROR, "Line %d: invalid UUID", line); return -1; } uuid_bin2str(config->uuid, buf, sizeof(buf)); wpa_printf(MSG_DEBUG, "uuid=%s", buf); return 0;}
开发者ID:nadlabak,项目名称:android_external_wpa_supplicant_6,代码行数:13,
示例11: hostapd_wps_reg_success_cbstatic void hostapd_wps_reg_success_cb(void *ctx, const u8 *mac_addr, const u8 *uuid_e){ struct hostapd_data *hapd = ctx; char uuid[40]; struct wps_stop_reg_data data; if (uuid_bin2str(uuid_e, uuid, sizeof(uuid))) return; wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_REG_SUCCESS MACSTR " %s", MAC2STR(mac_addr), uuid); if (hapd->wps_reg_success_cb) hapd->wps_reg_success_cb(hapd->wps_reg_success_cb_ctx, mac_addr, uuid_e); data.current_hapd = hapd; data.uuid_e = uuid_e; hostapd_wps_for_each(hapd, wps_stop_registrar, &data);}
开发者ID:RasmusKoldsoe,项目名称:performand.k70.2,代码行数:17,
示例12: wpas_wps_pin_needed_cbstatic void wpas_wps_pin_needed_cb(void *ctx, const u8 *uuid_e, const struct wps_device_data *dev){ char uuid[40], txt[400]; int len; if (uuid_bin2str(uuid_e, uuid, sizeof(uuid))) return; wpa_printf(MSG_DEBUG, "WPS: PIN needed for UUID-E %s", uuid); len = os_snprintf(txt, sizeof(txt), "WPS-EVENT-PIN-NEEDED %s " MACSTR " [%s|%s|%s|%s|%s|%d-%08X-%d]", uuid, MAC2STR(dev->mac_addr), dev->device_name, dev->manufacturer, dev->model_name, dev->model_number, dev->serial_number, dev->categ, dev->oui, dev->sub_categ); if (len > 0 && len < (int) sizeof(txt)) wpa_printf(MSG_INFO, "%s", txt);}
开发者ID:smx-smx,项目名称:dsl-n55u,代码行数:17,
示例13: gen_uuidstatic int gen_uuid(const char *txt_addr){ u8 addr[ETH_ALEN]; u8 uuid[UUID_LEN]; char buf[100]; if (hwaddr_aton(txt_addr, addr) < 0) return -1; uuid_gen_mac_addr(addr, uuid); if (uuid_bin2str(uuid, buf, sizeof(buf)) < 0) return -1; printf("%s/n", buf); return 0;}
开发者ID:imw,项目名称:hapd,代码行数:17,
示例14: wpas_wps_pin_needed_cbstatic void wpas_wps_pin_needed_cb(void *ctx, const u8 *uuid_e, const struct wps_device_data *dev){ char uuid[40], txt[400]; int len; char devtype[WPS_DEV_TYPE_BUFSIZE]; if (uuid_bin2str(uuid_e, uuid, sizeof(uuid))) return; wpa_printf(MSG_DEBUG, "WPS: PIN needed for UUID-E %s", uuid); len = os_snprintf(txt, sizeof(txt), "WPS-EVENT-PIN-NEEDED %s " MACSTR " [%s|%s|%s|%s|%s|%s]", uuid, MAC2STR(dev->mac_addr), dev->device_name, dev->manufacturer, dev->model_name, dev->model_number, dev->serial_number, wps_dev_type_bin2str(dev->pri_dev_type, devtype, sizeof(devtype))); if (len > 0 && len < (int) sizeof(txt)) wpa_printf(MSG_INFO, "%s", txt);}
开发者ID:2014-class,项目名称:freerouter,代码行数:19,
示例15: 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,
示例16: wpa_supplicant_wps_event_er_ap_addstatic void wpa_supplicant_wps_event_er_ap_add(struct wpa_supplicant *wpa_s, struct wps_event_er_ap *ap){ char uuid_str[100]; char dev_type[WPS_DEV_TYPE_BUFSIZE]; uuid_bin2str(ap->uuid, uuid_str, sizeof(uuid_str)); if (ap->pri_dev_type) wps_dev_type_bin2str(ap->pri_dev_type, dev_type, sizeof(dev_type)); else dev_type[0] = '/0'; wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_ER_AP_ADD "%s " MACSTR " pri_dev_type=%s wps_state=%d |%s|%s|%s|%s|%s|%s|", uuid_str, MAC2STR(ap->mac_addr), dev_type, ap->wps_state, ap->friendly_name ? ap->friendly_name : "", ap->manufacturer ? ap->manufacturer : "", ap->model_description ? ap->model_description : "", ap->model_name ? ap->model_name : "", ap->manufacturer_url ? ap->manufacturer_url : "", ap->model_url ? ap->model_url : "");}
开发者ID:2014-class,项目名称:freerouter,代码行数:23,
示例17: wpa_supplicant_wps_event_er_enrollee_addstatic void wpa_supplicant_wps_event_er_enrollee_add( struct wpa_supplicant *wpa_s, struct wps_event_er_enrollee *enrollee){ char uuid_str[100]; char dev_type[WPS_DEV_TYPE_BUFSIZE]; uuid_bin2str(enrollee->uuid, uuid_str, sizeof(uuid_str)); if (enrollee->pri_dev_type) wps_dev_type_bin2str(enrollee->pri_dev_type, dev_type, sizeof(dev_type)); else dev_type[0] = '/0'; wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_ER_ENROLLEE_ADD "%s " MACSTR " M1=%d config_methods=0x%x dev_passwd_id=%d pri_dev_type=%s " "|%s|%s|%s|%s|%s|", uuid_str, MAC2STR(enrollee->mac_addr), enrollee->m1_received, enrollee->config_methods, enrollee->dev_passwd_id, dev_type, enrollee->dev_name ? enrollee->dev_name : "", enrollee->manufacturer ? enrollee->manufacturer : "", enrollee->model_name ? enrollee->model_name : "", enrollee->model_number ? enrollee->model_number : "", enrollee->serial_number ? enrollee->serial_number : "");}
开发者ID:2014-class,项目名称:freerouter,代码行数:24,
示例18: wpa_config_write_globalstatic int wpa_config_write_global(struct wpa_config *config, HKEY hk){#ifdef CONFIG_CTRL_IFACE wpa_config_write_reg_string(hk, "ctrl_interface", config->ctrl_interface);#endif /* CONFIG_CTRL_IFACE */ wpa_config_write_reg_dword(hk, TEXT("eapol_version"), config->eapol_version, DEFAULT_EAPOL_VERSION); wpa_config_write_reg_dword(hk, TEXT("ap_scan"), config->ap_scan, DEFAULT_AP_SCAN); wpa_config_write_reg_dword(hk, TEXT("fast_reauth"), config->fast_reauth, DEFAULT_FAST_REAUTH); wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigPMKLifetime"), config->dot11RSNAConfigPMKLifetime, 0); wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigPMKReauthThreshold"), config->dot11RSNAConfigPMKReauthThreshold, 0); wpa_config_write_reg_dword(hk, TEXT("dot11RSNAConfigSATimeout"), config->dot11RSNAConfigSATimeout, 0); wpa_config_write_reg_dword(hk, TEXT("update_config"), config->update_config, 0);#ifdef CONFIG_WPS if (!is_nil_uuid(config->uuid)) { char buf[40]; uuid_bin2str(config->uuid, buf, sizeof(buf)); wpa_config_write_reg_string(hk, "uuid", buf); } wpa_config_write_reg_string(hk, "device_name", config->device_name); wpa_config_write_reg_string(hk, "manufacturer", config->manufacturer); wpa_config_write_reg_string(hk, "model_name", config->model_name); wpa_config_write_reg_string(hk, "model_number", config->model_number); wpa_config_write_reg_string(hk, "serial_number", config->serial_number); { char _buf[WPS_DEV_TYPE_BUFSIZE], *buf; buf = wps_dev_type_bin2str(config->device_type, _buf, sizeof(_buf)); wpa_config_write_reg_string(hk, "device_type", buf); } wpa_config_write_reg_string(hk, "config_methods", config->config_methods); if (WPA_GET_BE32(config->os_version)) { char vbuf[10]; os_snprintf(vbuf, sizeof(vbuf), "%08x", WPA_GET_BE32(config->os_version)); wpa_config_write_reg_string(hk, "os_version", vbuf); } wpa_config_write_reg_dword(hk, TEXT("wps_cred_processing"), config->wps_cred_processing, 0);#endif /* CONFIG_WPS */#ifdef CONFIG_P2P wpa_config_write_reg_string(hk, "p2p_ssid_postfix", config->p2p_ssid_postfix); wpa_config_write_reg_dword(hk, TEXT("p2p_group_idle"), config->p2p_group_idle, 0);#endif /* CONFIG_P2P */ wpa_config_write_reg_dword(hk, TEXT("bss_max_count"), config->bss_max_count, DEFAULT_BSS_MAX_COUNT); wpa_config_write_reg_dword(hk, TEXT("filter_ssids"), config->filter_ssids, 0); wpa_config_write_reg_dword(hk, TEXT("max_num_sta"), config->max_num_sta, DEFAULT_MAX_NUM_STA); wpa_config_write_reg_dword(hk, TEXT("disassoc_low_ack"), config->disassoc_low_ack, 0); wpa_config_write_reg_dword(hk, TEXT("sched_scan_num_short_intervals"), config->sched_scan_num_short_intervals, DEFAULT_SCHED_SCAN_NUM_SHORT_INTERVALS); wpa_config_write_reg_dword(hk, TEXT("sched_scan_short_interval"), config->sched_scan_short_interval, DEFAULT_SCHED_SCAN_SHORT_INTERVAL); wpa_config_write_reg_dword(hk, TEXT("sched_scan_long_interval"), config->sched_scan_long_interval, DEFAULT_SCHED_SCAN_LONG_INTERVAL); wpa_config_write_reg_dword(hk, TEXT("okc"), config->okc, 0); wpa_config_write_reg_dword(hk, TEXT("pmf"), config->pmf, 0); return 0;}
开发者ID:brianwoo,项目名称:cm11_grouper,代码行数:85,
示例19: wpa_config_write_globalstatic void wpa_config_write_global(FILE *f, struct wpa_config *config){#ifdef CONFIG_CTRL_IFACE if (config->ctrl_interface) fprintf(f, "ctrl_interface=%s/n", config->ctrl_interface); if (config->ctrl_interface_group) fprintf(f, "ctrl_interface_group=%s/n", config->ctrl_interface_group);#endif /* CONFIG_CTRL_IFACE */ if (config->eapol_version != DEFAULT_EAPOL_VERSION) fprintf(f, "eapol_version=%d/n", config->eapol_version); if (config->ap_scan != DEFAULT_AP_SCAN) fprintf(f, "ap_scan=%d/n", config->ap_scan); if (config->disable_scan_offload) fprintf(f, "disable_scan_offload=%d/n", config->disable_scan_offload); if (config->fast_reauth != DEFAULT_FAST_REAUTH) fprintf(f, "fast_reauth=%d/n", config->fast_reauth); if (config->opensc_engine_path) fprintf(f, "opensc_engine_path=%s/n", config->opensc_engine_path); if (config->pkcs11_engine_path) fprintf(f, "pkcs11_engine_path=%s/n", config->pkcs11_engine_path); if (config->pkcs11_module_path) fprintf(f, "pkcs11_module_path=%s/n", config->pkcs11_module_path); if (config->pcsc_reader) fprintf(f, "pcsc_reader=%s/n", config->pcsc_reader); if (config->pcsc_pin) fprintf(f, "pcsc_pin=%s/n", config->pcsc_pin); if (config->driver_param) fprintf(f, "driver_param=%s/n", config->driver_param); if (config->dot11RSNAConfigPMKLifetime) fprintf(f, "dot11RSNAConfigPMKLifetime=%d/n", config->dot11RSNAConfigPMKLifetime); if (config->dot11RSNAConfigPMKReauthThreshold) fprintf(f, "dot11RSNAConfigPMKReauthThreshold=%d/n", config->dot11RSNAConfigPMKReauthThreshold); if (config->dot11RSNAConfigSATimeout) fprintf(f, "dot11RSNAConfigSATimeout=%d/n", config->dot11RSNAConfigSATimeout); if (config->update_config) fprintf(f, "update_config=%d/n", config->update_config);#ifdef CONFIG_WPS if (!is_nil_uuid(config->uuid)) { char buf[40]; uuid_bin2str(config->uuid, buf, sizeof(buf)); fprintf(f, "uuid=%s/n", buf); } if (config->device_name) fprintf(f, "device_name=%s/n", config->device_name); if (config->manufacturer) fprintf(f, "manufacturer=%s/n", config->manufacturer); if (config->model_name) fprintf(f, "model_name=%s/n", config->model_name); if (config->model_number) fprintf(f, "model_number=%s/n", config->model_number); if (config->serial_number) fprintf(f, "serial_number=%s/n", config->serial_number); { char _buf[WPS_DEV_TYPE_BUFSIZE], *buf; buf = wps_dev_type_bin2str(config->device_type, _buf, sizeof(_buf)); if (os_strcmp(buf, "0-00000000-0") != 0) fprintf(f, "device_type=%s/n", buf); } if (WPA_GET_BE32(config->os_version)) fprintf(f, "os_version=%08x/n", WPA_GET_BE32(config->os_version)); if (config->config_methods) fprintf(f, "config_methods=%s/n", config->config_methods); if (config->wps_cred_processing) fprintf(f, "wps_cred_processing=%d/n", config->wps_cred_processing); if (config->wps_vendor_ext_m1) { int i, len = wpabuf_len(config->wps_vendor_ext_m1); const u8 *p = wpabuf_head_u8(config->wps_vendor_ext_m1); if (len > 0) { fprintf(f, "wps_vendor_ext_m1="); for (i = 0; i < len; i++) fprintf(f, "%02x", *p++); fprintf(f, "/n"); } }#endif /* CONFIG_WPS */#ifdef CONFIG_P2P if (config->p2p_listen_reg_class) fprintf(f, "p2p_listen_reg_class=%u/n", config->p2p_listen_reg_class); if (config->p2p_listen_channel) fprintf(f, "p2p_listen_channel=%u/n", config->p2p_listen_channel); if (config->p2p_oper_reg_class) fprintf(f, "p2p_oper_reg_class=%u/n", config->p2p_oper_reg_class); if (config->p2p_oper_channel) fprintf(f, "p2p_oper_channel=%u/n", config->p2p_oper_channel); if (config->p2p_go_intent != DEFAULT_P2P_GO_INTENT) fprintf(f, "p2p_go_intent=%u/n", config->p2p_go_intent);//.........这里部分代码省略.........
开发者ID:GabberBaby,项目名称:peapwn,代码行数:101,
示例20: mainintmain(int argc, char **argv){ uint8_t anuuid[16]; uint8_t anuuid2[16]; uuid_str2bin(NOT_NIL_UUID_STR, anuuid); fprintf(stderr, "%s cmp %02x%02x%02x%02x-%02x%02x-%02x%02x-" "%02x%02x-%02x%02x%02x%02x%02x%02x/n", NOT_NIL_UUID_STR, anuuid[0], anuuid[1], anuuid[2], anuuid[3], anuuid[4], anuuid[5], anuuid[6], anuuid[7], anuuid[8], anuuid[9], anuuid[10], anuuid[11], anuuid[12], anuuid[13], anuuid[14], anuuid[15]); uuid_str2bin(NOT_NIL_UUID_STR2, anuuid2); fprintf(stderr, "%s cmp %02x%02x%02x%02x-%02x%02x-%02x%02x-" "%02x%02x-%02x%02x%02x%02x%02x%02x/n", NOT_NIL_UUID_STR2, anuuid2[0], anuuid2[1], anuuid2[2], anuuid2[3], anuuid2[4], anuuid2[5], anuuid2[6], anuuid2[7], anuuid2[8], anuuid2[9], anuuid2[10], anuuid2[11], anuuid2[12], anuuid2[13], anuuid2[14], anuuid2[15]); /* * uuid_is_nil with nil UUID */ uint8_t nilUUID[16] = NIL_UUID; char nilUUIDstr[40]; n_tests++; if (uuid_bin2str(nilUUID, nilUUIDstr, 40) < 0) { fprintf(stderr, "Failure/n"); goto skip1; } char isnil = uuid_is_nil(nilUUID); if (isnil) n_tests_passed++; else n_tests_failed++; printf("%s is nil? %s <%s>/n", nilUUIDstr, isnil ? "YES" : "NO", isnil ? "passed" : "failed" ); skip1: { /* * uuid_is_nil with not nil UUID */ uint8_t notNilUUID[16] = NOT_NIL_UUID; char notNilUUIDstr[40]; n_tests++; if (uuid_bin2str(notNilUUID, notNilUUIDstr, 40) < 0) { fprintf(stderr, "Failure/n"); goto skip2; } char isnil = uuid_is_nil(notNilUUID); if (!isnil) n_tests_passed++; else n_tests_failed++; printf("%s is nil? %s <%s>/n", notNilUUIDstr, isnil ? "YES" : "NO", isnil ? "failed" : "passed" ); } skip2: { /* * uuid_cmp with one nil UUID */ uint8_t nilUUID[16] = NIL_UUID; char nilUUIDstr[40]; uint8_t notNilUUID[16] = NOT_NIL_UUID; char notNilUUIDstr[40]; n_tests++; if (uuid_bin2str(nilUUID, nilUUIDstr, 40) < 0) { fprintf(stderr, "Failure/n"); goto skip3; } n_tests++; if (uuid_bin2str(notNilUUID, notNilUUIDstr, 40) < 0) { fprintf(stderr, "Failure/n"); goto skip3; } int8_t cmpval1 = uuid_cmp(notNilUUID, nilUUID); int8_t cmpval2 = uuid_cmp(nilUUID, notNilUUID); if (cmpval1 + cmpval2 == 0 && cmpval1 != 0) n_tests_passed+=2; else n_tests_failed+=2; printf("%s cmp %s = %d <%s>/n", notNilUUIDstr, nilUUIDstr, cmpval1, cmpval1 ? "passed" : "failed" ); printf("%s cmp %s = %d <%s>/n", nilUUIDstr, notNilUUIDstr, cmpval2, cmpval2 ? "passed" : "failed" ); } skip3: { /*//.........这里部分代码省略.........
开发者ID:rcoscali,项目名称:vendor-nagravision,代码行数:101,
示例21: wpa_config_write_globalstatic void wpa_config_write_global(FILE *f, struct wpa_config *config){#ifdef CONFIG_CTRL_IFACE if (config->ctrl_interface) fprintf(f, "ctrl_interface=%s/n", config->ctrl_interface); if (config->ctrl_interface_group) fprintf(f, "ctrl_interface_group=%s/n", config->ctrl_interface_group);#endif /* CONFIG_CTRL_IFACE */ if (config->eapol_version != DEFAULT_EAPOL_VERSION) fprintf(f, "eapol_version=%d/n", config->eapol_version); if (config->ap_scan != DEFAULT_AP_SCAN) fprintf(f, "ap_scan=%d/n", config->ap_scan); if (config->fast_reauth != DEFAULT_FAST_REAUTH) fprintf(f, "fast_reauth=%d/n", config->fast_reauth); if (config->opensc_engine_path) fprintf(f, "opensc_engine_path=%s/n", config->opensc_engine_path); if (config->pkcs11_engine_path) fprintf(f, "pkcs11_engine_path=%s/n", config->pkcs11_engine_path); if (config->pkcs11_module_path) fprintf(f, "pkcs11_module_path=%s/n", config->pkcs11_module_path); if (config->driver_param) fprintf(f, "driver_param=%s/n", config->driver_param); if (config->dot11RSNAConfigPMKLifetime) fprintf(f, "dot11RSNAConfigPMKLifetime=%d/n", config->dot11RSNAConfigPMKLifetime); if (config->dot11RSNAConfigPMKReauthThreshold) fprintf(f, "dot11RSNAConfigPMKReauthThreshold=%d/n", config->dot11RSNAConfigPMKReauthThreshold); if (config->dot11RSNAConfigSATimeout) fprintf(f, "dot11RSNAConfigSATimeout=%d/n", config->dot11RSNAConfigSATimeout); if (config->update_config) fprintf(f, "update_config=%d/n", config->update_config);#ifdef CONFIG_WPS if (!is_nil_uuid(config->uuid)) { char buf[40]; uuid_bin2str(config->uuid, buf, sizeof(buf)); fprintf(f, "uuid=%s/n", buf); } if (config->device_name) fprintf(f, "device_name=%s/n", config->device_name); if (config->manufacturer) fprintf(f, "manufacturer=%s/n", config->manufacturer); if (config->model_name) fprintf(f, "model_name=%s/n", config->model_name); if (config->model_number) fprintf(f, "model_number=%s/n", config->model_number); if (config->serial_number) fprintf(f, "serial_number=%s/n", config->serial_number); { char _buf[WPS_DEV_TYPE_BUFSIZE], *buf; buf = wps_dev_type_bin2str(config->device_type, _buf, sizeof(_buf)); if (os_strcmp(buf, "0-00000000-0") != 0) fprintf(f, "device_type=%s/n", buf); } if (WPA_GET_BE32(config->os_version)) fprintf(f, "os_version=%08x/n", WPA_GET_BE32(config->os_version)); if (config->config_methods) fprintf(f, "config_methods=%s/n", config->config_methods); if (config->wps_cred_processing) fprintf(f, "wps_cred_processing=%d/n", config->wps_cred_processing);#endif /* CONFIG_WPS */#ifdef CONFIG_P2P if (config->p2p_listen_reg_class) fprintf(f, "p2p_listen_reg_class=%u/n", config->p2p_listen_reg_class); if (config->p2p_listen_channel) fprintf(f, "p2p_listen_channel=%u/n", config->p2p_listen_channel); if (config->p2p_oper_reg_class) fprintf(f, "p2p_oper_reg_class=%u/n", config->p2p_oper_reg_class); if (config->p2p_oper_channel) fprintf(f, "p2p_oper_channel=%u/n", config->p2p_oper_channel); if (config->p2p_go_intent != DEFAULT_P2P_GO_INTENT) fprintf(f, "p2p_go_intent=%u/n", config->p2p_go_intent); if (config->p2p_ssid_postfix) fprintf(f, "p2p_ssid_postfix=%s/n", config->p2p_ssid_postfix); if (config->persistent_reconnect) fprintf(f, "persistent_reconnect=%u/n", config->persistent_reconnect); if (config->p2p_intra_bss != DEFAULT_P2P_INTRA_BSS) fprintf(f, "p2p_intra_bss=%u/n", config->p2p_intra_bss); if (config->p2p_group_idle) fprintf(f, "p2p_group_idle=%u/n", config->p2p_group_idle);#endif /* CONFIG_P2P */ if (config->country[0] && config->country[1]) { fprintf(f, "country=%c%c/n", config->country[0], config->country[1]); }#ifdef CONFIG_EAP_SIM_AKA if (config->software_sim) fprintf(f, "software_sim=%d/n", config->software_sim);//.........这里部分代码省略.........
开发者ID:wufuyue,项目名称:TCL_S820,代码行数:101,
示例22: wpa_config_write_globalstatic void wpa_config_write_global(FILE *f, struct wpa_config *config){#ifdef CONFIG_CTRL_IFACE if (config->ctrl_interface) fprintf(f, "ctrl_interface=%s/n", config->ctrl_interface); if (config->ctrl_interface_group) fprintf(f, "ctrl_interface_group=%s/n", config->ctrl_interface_group);#endif /* CONFIG_CTRL_IFACE */ if (config->eapol_version != DEFAULT_EAPOL_VERSION) fprintf(f, "eapol_version=%d/n", config->eapol_version);#ifndef ANDROID if (config->ap_scan != DEFAULT_AP_SCAN) fprintf(f, "ap_scan=%d/n", config->ap_scan);#endif if (config->fast_reauth != DEFAULT_FAST_REAUTH) fprintf(f, "fast_reauth=%d/n", config->fast_reauth);#ifdef EAP_TLS_OPENSSL if (config->opensc_engine_path) fprintf(f, "opensc_engine_path=%s/n", config->opensc_engine_path); if (config->pkcs11_engine_path) fprintf(f, "pkcs11_engine_path=%s/n", config->pkcs11_engine_path); if (config->pkcs11_module_path) fprintf(f, "pkcs11_module_path=%s/n", config->pkcs11_module_path);#endif /* EAP_TLS_OPENSSL */ if (config->driver_param) fprintf(f, "driver_param=%s/n", config->driver_param); if (config->dot11RSNAConfigPMKLifetime) fprintf(f, "dot11RSNAConfigPMKLifetime=%d/n", config->dot11RSNAConfigPMKLifetime); if (config->dot11RSNAConfigPMKReauthThreshold) fprintf(f, "dot11RSNAConfigPMKReauthThreshold=%d/n", config->dot11RSNAConfigPMKReauthThreshold); if (config->dot11RSNAConfigSATimeout) fprintf(f, "dot11RSNAConfigSATimeout=%d/n", config->dot11RSNAConfigSATimeout); if (config->update_config) fprintf(f, "update_config=%d/n", config->update_config);#ifdef CONFIG_WPS if (!is_nil_uuid(config->uuid)) { char buf[40]; uuid_bin2str(config->uuid, buf, sizeof(buf)); fprintf(f, "uuid=%s/n", buf); } if (config->device_name) fprintf(f, "device_name=%s/n", config->device_name); if (config->manufacturer) fprintf(f, "manufacturer=%s/n", config->manufacturer); if (config->model_name) fprintf(f, "model_name=%s/n", config->model_name); if (config->model_number) fprintf(f, "model_number=%s/n", config->model_number); if (config->serial_number) fprintf(f, "serial_number=%s/n", config->serial_number); if (config->device_type) fprintf(f, "device_type=%s/n", config->device_type); if (WPA_GET_BE32(config->os_version)) fprintf(f, "os_version=%08x/n", WPA_GET_BE32(config->os_version)); if (config->wps_cred_processing) fprintf(f, "wps_cred_processing=%d/n", config->wps_cred_processing);#endif /* CONFIG_WPS */ if (config->country[0] && config->country[1]) { fprintf(f, "country=%c%c/n", config->country[0], config->country[1]); }}
开发者ID:nadlabak,项目名称:android_external_wpa_supplicant_6,代码行数:71,
示例23: event_send_tx_ready/* event_send_tx_ready -- actually write event message * * Prequisite: subscription socket descriptor has become ready to * write (because connection to subscriber has been made). * * It is also possible that we are called because the connect has failed; * it is possible to test for this, or we can just go ahead and then * the write will fail. */static void event_send_tx_ready(int sock, void *eloop_ctx, void *sock_ctx){ struct wps_event_ *e = sock_ctx; struct subscription *s = e->s; struct wpabuf *buf; char *b; assert(e == s->current_event); assert(e->sd == sock); buf = wpabuf_alloc(1000 + wpabuf_len(e->data)); if (buf == NULL) { event_retry(e, 0); goto bad; } wpabuf_printf(buf, "NOTIFY %s HTTP/1.1/r/n", e->addr->path); wpabuf_put_str(buf, "SERVER: Unspecified, UPnP/1.0, Unspecified/r/n"); wpabuf_printf(buf, "HOST: %s/r/n", e->addr->domain_and_port); wpabuf_put_str(buf, "CONTENT-TYPE: text/xml; charset=/"utf-8/"/r/n" "NT: upnp:event/r/n" "NTS: upnp:propchange/r/n"); wpabuf_put_str(buf, "SID: uuid:"); b = wpabuf_put(buf, 0); uuid_bin2str(s->uuid, b, 80); wpabuf_put(buf, os_strlen(b)); wpabuf_put_str(buf, "/r/n"); wpabuf_printf(buf, "SEQ: %u/r/n", e->subscriber_sequence); wpabuf_printf(buf, "CONTENT-LENGTH: %d/r/n", (int) wpabuf_len(e->data)); wpabuf_put_str(buf, "/r/n"); /* terminating empty line */ wpabuf_put_buf(buf, e->data); /* Since the message size is pretty small, we should be * able to get the operating system to buffer what we give it * and not have to come back again later to write more... */#if 0 /* we could: Turn blocking back on? */ fcntl(e->sd, F_SETFL, 0);#endif wpa_printf(MSG_DEBUG, "WPS UPnP: Sending event to %s", e->addr->domain_and_port); if (send_wpabuf(e->sd, buf) < 0) { event_retry(e, 1); goto bad; } wpabuf_free(buf); buf = NULL; if (e->sd_registered) { e->sd_registered = 0; eloop_unregister_sock(e->sd, EVENT_TYPE_WRITE); } /* Set up to read the reply */ e->hread = httpread_create(e->sd, event_got_response_handler, e /* cookie */, 0 /* no data expected */, EVENT_TIMEOUT_SEC); if (e->hread == NULL) { wpa_printf(MSG_ERROR, "WPS UPnP: httpread_create failed"); event_retry(e, 0); goto bad; } return;bad: /* Schedule sending more if there is more to send */ if (s->event_queue) event_send_all_later(s->sm); wpabuf_free(buf);}
开发者ID:Austrie,项目名称:android_external_hostapd,代码行数:80,
示例24: wpa_config_write_globalstatic void wpa_config_write_global(FILE *f, struct wpa_config *config){#ifdef CONFIG_CTRL_IFACE if (config->ctrl_interface) fprintf(f, "ctrl_interface=%s/n", config->ctrl_interface); if (config->ctrl_interface_group) fprintf(f, "ctrl_interface_group=%s/n", config->ctrl_interface_group);#endif /* CONFIG_CTRL_IFACE */ if (config->eapol_version != DEFAULT_EAPOL_VERSION) fprintf(f, "eapol_version=%d/n", config->eapol_version); if (config->ap_scan != DEFAULT_AP_SCAN) fprintf(f, "ap_scan=%d/n", config->ap_scan); if (config->fast_reauth != DEFAULT_FAST_REAUTH) fprintf(f, "fast_reauth=%d/n", config->fast_reauth); if (config->opensc_engine_path) fprintf(f, "opensc_engine_path=%s/n", config->opensc_engine_path); if (config->pkcs11_engine_path) fprintf(f, "pkcs11_engine_path=%s/n", config->pkcs11_engine_path); if (config->pkcs11_module_path) fprintf(f, "pkcs11_module_path=%s/n", config->pkcs11_module_path); if (config->driver_param) fprintf(f, "driver_param=%s/n", config->driver_param); if (config->dot11RSNAConfigPMKLifetime) fprintf(f, "dot11RSNAConfigPMKLifetime=%d/n", config->dot11RSNAConfigPMKLifetime); if (config->dot11RSNAConfigPMKReauthThreshold) fprintf(f, "dot11RSNAConfigPMKReauthThreshold=%d/n", config->dot11RSNAConfigPMKReauthThreshold); if (config->dot11RSNAConfigSATimeout) fprintf(f, "dot11RSNAConfigSATimeout=%d/n", config->dot11RSNAConfigSATimeout); if (config->update_config) fprintf(f, "update_config=%d/n", config->update_config);#ifdef CONFIG_WPS if (!is_nil_uuid(config->uuid)) { char buf[40]; uuid_bin2str(config->uuid, buf, sizeof(buf)); fprintf(f, "uuid=%s/n", buf); } if (config->device_name) fprintf(f, "device_name=%s/n", config->device_name); if (config->manufacturer) fprintf(f, "manufacturer=%s/n", config->manufacturer); if (config->model_name) fprintf(f, "model_name=%s/n", config->model_name); if (config->model_number) fprintf(f, "model_number=%s/n", config->model_number); if (config->serial_number) fprintf(f, "serial_number=%s/n", config->serial_number); if (config->device_type) fprintf(f, "device_type=%s/n", config->device_type); if (WPA_GET_BE32(config->os_version)) fprintf(f, "os_version=%08x/n", WPA_GET_BE32(config->os_version)); if (config->config_methods) fprintf(f, "config_methods=%s/n", config->config_methods); if (config->wps_cred_processing) fprintf(f, "wps_cred_processing=%d/n", config->wps_cred_processing);#endif /* CONFIG_WPS */#ifdef CONFIG_P2P if (config->p2p_listen_reg_class) fprintf(f, "p2p_listen_reg_class=%u/n", config->p2p_listen_reg_class); if (config->p2p_listen_channel) fprintf(f, "p2p_listen_channel=%u/n", config->p2p_listen_channel); if (config->p2p_oper_reg_class) fprintf(f, "p2p_oper_reg_class=%u/n", config->p2p_oper_reg_class); if (config->p2p_oper_channel) fprintf(f, "p2p_oper_channel=%u/n", config->p2p_oper_channel); if (config->p2p_go_intent != DEFAULT_P2P_GO_INTENT) fprintf(f, "p2p_go_intent=%u/n", config->p2p_go_intent); if (config->p2p_ssid_postfix) fprintf(f, "p2p_ssid_postfix=%s/n", config->p2p_ssid_postfix); if (config->persistent_reconnect) fprintf(f, "persistent_reconnect=%u/n", config->persistent_reconnect); if (config->p2p_intra_bss != DEFAULT_P2P_INTRA_BSS) fprintf(f, "p2p_intra_bss=%u/n", config->p2p_intra_bss);#endif /* CONFIG_P2P */ if (config->country[0] && config->country[1]) { fprintf(f, "country=%c%c/n", config->country[0], config->country[1]); } if (config->bss_max_count != DEFAULT_BSS_MAX_COUNT) fprintf(f, "bss_max_count=%u/n", config->bss_max_count); if (config->filter_ssids) fprintf(f, "filter_ssids=%d/n", config->filter_ssids);}
开发者ID:janetuk,项目名称:libeap,代码行数:96,
注:本文中的uuid_bin2str函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ uuid_copy函数代码示例 C++ uuid函数代码示例 |