/hostap-3.6.0/src/p2p/ |
D | p2p_build.c | 18 void p2p_buf_add_action_hdr(struct wpabuf *buf, u8 subtype, u8 dialog_token) in p2p_buf_add_action_hdr() argument 20 wpabuf_put_u8(buf, WLAN_ACTION_VENDOR_SPECIFIC); in p2p_buf_add_action_hdr() 21 wpabuf_put_be32(buf, P2P_IE_VENDOR_TYPE); in p2p_buf_add_action_hdr() 23 wpabuf_put_u8(buf, subtype); /* OUI Subtype */ in p2p_buf_add_action_hdr() 24 wpabuf_put_u8(buf, dialog_token); in p2p_buf_add_action_hdr() 29 void p2p_buf_add_public_action_hdr(struct wpabuf *buf, u8 subtype, in p2p_buf_add_public_action_hdr() argument 32 wpabuf_put_u8(buf, WLAN_ACTION_PUBLIC); in p2p_buf_add_public_action_hdr() 33 wpabuf_put_u8(buf, WLAN_PA_VENDOR_SPECIFIC); in p2p_buf_add_public_action_hdr() 34 wpabuf_put_be32(buf, P2P_IE_VENDOR_TYPE); in p2p_buf_add_public_action_hdr() 36 wpabuf_put_u8(buf, subtype); /* OUI Subtype */ in p2p_buf_add_public_action_hdr() [all …]
|
/hostap-3.6.0/src/utils/ |
D | wpabuf.c | 22 static struct wpabuf_trace * wpabuf_get_trace(const struct wpabuf *buf) in wpabuf_get_trace() argument 25 ((const u8 *) buf - sizeof(struct wpabuf_trace)); in wpabuf_get_trace() 30 static void wpabuf_overflow(const struct wpabuf *buf, size_t len) in wpabuf_overflow() argument 33 struct wpabuf_trace *trace = wpabuf_get_trace(buf); in wpabuf_overflow() 40 buf, (unsigned long) buf->size, (unsigned long) buf->used, in wpabuf_overflow() 49 struct wpabuf *buf = *_buf; in wpabuf_resize() local 54 if (buf == NULL) { in wpabuf_resize() 60 trace = wpabuf_get_trace(buf); in wpabuf_resize() 69 if (buf->used + add_len > buf->size) { in wpabuf_resize() 71 if (buf->flags & WPABUF_FLAG_EXT_DATA) { in wpabuf_resize() [all …]
|
D | wpabuf.h | 23 u8 *buf; /* pointer to the head of the buffer */ member 29 int wpabuf_resize(struct wpabuf **buf, size_t add_len); 34 void wpabuf_free(struct wpabuf *buf); 35 void wpabuf_clear_free(struct wpabuf *buf); 36 void * wpabuf_put(struct wpabuf *buf, size_t len); 38 struct wpabuf * wpabuf_zeropad(struct wpabuf *buf, size_t len); 39 void wpabuf_printf(struct wpabuf *buf, char *fmt, ...) PRINTF_FORMAT(2, 3); 40 struct wpabuf * wpabuf_parse_bin(const char *buf); 48 static inline size_t wpabuf_size(const struct wpabuf *buf) in wpabuf_size() argument 50 return buf->size; in wpabuf_size() [all …]
|
D | wpa_debug_zephyr.c | 67 static void _wpa_hexdump(int level, const char *title, const u8 *buf, size_t len, int show) in _wpa_hexdump() argument 76 if (buf == NULL) { in _wpa_hexdump() 87 os_snprintf(&content_buf[i * 3], 4, " %02x", buf[i]); in _wpa_hexdump() 97 void wpa_hexdump_impl(int level, const char *title, const void *buf, size_t len) in wpa_hexdump_impl() argument 99 _wpa_hexdump(level, title, buf, len, 1); in wpa_hexdump_impl() 102 void wpa_hexdump_key_impl(int level, const char *title, const void *buf, size_t len) in wpa_hexdump_key_impl() argument 104 _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys); in wpa_hexdump_key_impl() 107 static void _wpa_hexdump_ascii(int level, const char *title, const void *buf, size_t len, int show) in _wpa_hexdump_ascii() argument 115 if (buf == NULL) { in _wpa_hexdump_ascii() 125 if (buf == NULL || !show) { in _wpa_hexdump_ascii() [all …]
|
D | wpa_debug.c | 131 char buf[4096] = {}; in wpa_debug_open_linux_tracing() local 141 buflen = read(mounts, buf, sizeof(buf) - 1); in wpa_debug_open_linux_tracing() 147 buf[buflen] = '\0'; in wpa_debug_open_linux_tracing() 149 line = strtok_r(buf, "\n", &tmp1); in wpa_debug_open_linux_tracing() 169 snprintf(buf, sizeof(buf) - 1, "%s/tracing/trace_marker", path); in wpa_debug_open_linux_tracing() 171 trace_fd = open(buf, O_WRONLY); in wpa_debug_open_linux_tracing() 258 static void _wpa_hexdump(int level, const char *title, const u8 *buf, in _wpa_hexdump() argument 268 if (buf == NULL) { in _wpa_hexdump() 275 " %02x", buf[i]); in _wpa_hexdump() 288 if (buf == NULL) { in _wpa_hexdump() [all …]
|
D | pcsc_funcs.c | 253 unsigned char *buf, size_t *buf_len, 257 unsigned char *buf, size_t *buf_len); 266 static int scard_parse_fsp_templ(unsigned char *buf, size_t buf_len, in scard_parse_fsp_templ() argument 276 pos = buf; in scard_parse_fsp_templ() 413 unsigned char buf[127], *aid_pos; in scard_get_aid() local 417 efdir = (struct efdir *) buf; in scard_get_aid() 418 aid_pos = &buf[4]; in scard_get_aid() 419 blen = sizeof(buf); in scard_get_aid() 420 if (scard_select_file(scard, SCARD_FILE_EF_DIR, buf, &blen)) { in scard_get_aid() 424 wpa_hexdump(MSG_DEBUG, "SCARD: EF_DIR select", buf, blen); in scard_get_aid() [all …]
|
D | utils_module_tests.c | 49 char buf[100]; in printf_encode_decode_tests() local 58 printf_encode(buf, sizeof(buf), test->data, test->len); in printf_encode_decode_tests() 59 wpa_printf(MSG_INFO, "%d: -> \"%s\"", i, buf); in printf_encode_decode_tests() 61 binlen = printf_decode(bin, sizeof(bin), buf); in printf_encode_decode_tests() 78 buf[5] = 'A'; in printf_encode_decode_tests() 79 printf_encode(buf, 5, (const u8 *) "abcde", 5); in printf_encode_decode_tests() 80 if (buf[5] != 'A') { in printf_encode_decode_tests() 86 buf[i] = 'A'; in printf_encode_decode_tests() 87 printf_encode(buf, i, (const u8 *) "\xdd\xdd\xdd\xdd\xdd", 5); in printf_encode_decode_tests() 88 if (buf[i] != 'A') { in printf_encode_decode_tests() [all …]
|
/hostap-3.6.0/src/common/ |
D | gas.c | 20 struct wpabuf *buf; in gas_build_req() local 22 buf = wpabuf_alloc(100 + size); in gas_build_req() 23 if (buf == NULL) in gas_build_req() 26 wpabuf_put_u8(buf, WLAN_ACTION_PUBLIC); in gas_build_req() 27 wpabuf_put_u8(buf, action); in gas_build_req() 28 wpabuf_put_u8(buf, dialog_token); in gas_build_req() 30 return buf; in gas_build_req() 51 struct wpabuf *buf; in gas_build_resp() local 53 buf = wpabuf_alloc(100 + size); in gas_build_resp() 54 if (buf == NULL) in gas_build_resp() [all …]
|
D | wpa_helpers.c | 24 char buf[128]; in wpa_open_ctrl() local 27 os_snprintf(buf, sizeof(buf), "%s%s", wpas_ctrl_path, ifname); in wpa_open_ctrl() 28 ctrl = wpa_ctrl_open(buf); in wpa_open_ctrl() 30 printf("wpa_command: wpa_ctrl_open(%s) failed\n", buf); in wpa_open_ctrl() 38 char buf[128]; in wpa_command() local 45 len = sizeof(buf); in wpa_command() 46 if (wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, NULL) < 0) { in wpa_command() 52 buf[len] = '\0'; in wpa_command() 53 if (strncmp(buf, "FAIL", 4) == 0) { in wpa_command() 101 char *buf, size_t buf_size) in get_wpa_cli_event2() argument [all …]
|
/hostap-3.6.0/src/ap/ |
D | gas_serv.c | 25 static void gas_serv_write_dpp_adv_proto(struct wpabuf *buf) in gas_serv_write_dpp_adv_proto() argument 27 wpabuf_put_u8(buf, WLAN_EID_ADV_PROTO); in gas_serv_write_dpp_adv_proto() 28 wpabuf_put_u8(buf, 8); /* Length */ in gas_serv_write_dpp_adv_proto() 29 wpabuf_put_u8(buf, 0x7f); in gas_serv_write_dpp_adv_proto() 30 wpabuf_put_u8(buf, WLAN_EID_VENDOR_SPECIFIC); in gas_serv_write_dpp_adv_proto() 31 wpabuf_put_u8(buf, 5); in gas_serv_write_dpp_adv_proto() 32 wpabuf_put_be24(buf, OUI_WFA); in gas_serv_write_dpp_adv_proto() 33 wpabuf_put_u8(buf, DPP_OUI_TYPE); in gas_serv_write_dpp_adv_proto() 34 wpabuf_put_u8(buf, 0x01); in gas_serv_write_dpp_adv_proto() 162 struct wpabuf *buf) in anqp_add_hs_capab_list() argument [all …]
|
D | hs20.c | 106 struct wpabuf *buf; in hs20_send_wnm_notification() local 122 buf = wpabuf_alloc(4 + 7 + len); in hs20_send_wnm_notification() 123 if (buf == NULL) in hs20_send_wnm_notification() 126 wpabuf_put_u8(buf, WLAN_ACTION_WNM); in hs20_send_wnm_notification() 127 wpabuf_put_u8(buf, WNM_NOTIFICATION_REQ); in hs20_send_wnm_notification() 128 wpabuf_put_u8(buf, 1); /* Dialog token */ in hs20_send_wnm_notification() 129 wpabuf_put_u8(buf, 1); /* Type - 1 reserved for WFA */ in hs20_send_wnm_notification() 132 wpabuf_put_u8(buf, WLAN_EID_VENDOR_SPECIFIC); in hs20_send_wnm_notification() 133 wpabuf_put_u8(buf, 5 + len); in hs20_send_wnm_notification() 134 wpabuf_put_be24(buf, OUI_WFA); in hs20_send_wnm_notification() [all …]
|
D | rrm.c | 96 const u8 *buf, size_t len) in hostapd_handle_radio_msmt_report() argument 98 const struct ieee80211_mgmt *mgmt = (const struct ieee80211_mgmt *) buf; in hostapd_handle_radio_msmt_report() 102 end = buf + len; in hostapd_handle_radio_msmt_report() 139 static u16 hostapd_parse_location_lci_req_age(const u8 *buf, size_t len) in hostapd_parse_location_lci_req_age() argument 148 subelem = get_ie(buf + 4, len - 4, LCI_REQ_SUBELEM_MAX_AGE); in hostapd_parse_location_lci_req_age() 183 static size_t hostapd_neighbor_report_len(struct wpabuf *buf, in hostapd_neighbor_report_len() argument 205 struct wpabuf *buf; in hostapd_send_nei_report_resp() local 213 buf = wpabuf_alloc(3 + IEEE80211_MAX_MMPDU_SIZE); in hostapd_send_nei_report_resp() 214 if (!buf) in hostapd_send_nei_report_resp() 217 wpabuf_put_u8(buf, WLAN_ACTION_RADIO_MEASUREMENT); in hostapd_send_nei_report_resp() [all …]
|
/hostap-3.6.0/hostapd/ |
D | config_file.c | 34 char buf[128], *pos, *pos2, *pos3; in hostapd_config_read_vlan_file() local 44 while (fgets(buf, sizeof(buf), f)) { in hostapd_config_read_vlan_file() 47 if (buf[0] == '#') in hostapd_config_read_vlan_file() 49 pos = buf; in hostapd_config_read_vlan_file() 57 if (buf[0] == '\0') in hostapd_config_read_vlan_file() 60 if (buf[0] == '*') { in hostapd_config_read_vlan_file() 62 pos = buf + 1; in hostapd_config_read_vlan_file() 64 vlan_id = strtol(buf, &pos, 10); in hostapd_config_read_vlan_file() 65 if (buf == pos || vlan_id < 1 || in hostapd_config_read_vlan_file() 171 char buf[128], *pos; in hostapd_config_read_maclist() local [all …]
|
D | ctrl_iface.c | 83 const char *buf, size_t len); 188 struct hostapd_data *hapd, char *cmd, char *buf, size_t buflen) in hostapd_ctrl_iface_wps_check_pin() argument 217 ret = os_snprintf(buf, buflen, "FAIL-CHECKSUM\n"); in hostapd_ctrl_iface_wps_check_pin() 224 ret = os_snprintf(buf, buflen, "%s", pin); in hostapd_ctrl_iface_wps_check_pin() 237 struct wpabuf *buf; in hostapd_ctrl_iface_wps_nfc_tag_read() local 245 buf = wpabuf_alloc(len); in hostapd_ctrl_iface_wps_nfc_tag_read() 246 if (buf == NULL) in hostapd_ctrl_iface_wps_nfc_tag_read() 248 if (hexstr2bin(pos, wpabuf_put(buf, len), len) < 0) { in hostapd_ctrl_iface_wps_nfc_tag_read() 249 wpabuf_free(buf); in hostapd_ctrl_iface_wps_nfc_tag_read() 253 ret = hostapd_wps_nfc_tag_read(hapd, buf); in hostapd_ctrl_iface_wps_nfc_tag_read() [all …]
|
D | hostapd_cli.c | 195 char buf[4096]; in _wpa_ctrl_command() local 203 len = sizeof(buf) - 1; in _wpa_ctrl_command() 204 ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), buf, &len, in _wpa_ctrl_command() 214 buf[len] = '\0'; in _wpa_ctrl_command() 215 printf("%s", buf); in _wpa_ctrl_command() 230 char buf[4096]; in hostapd_cli_cmd() local 237 if (write_cmd(buf, sizeof(buf), cmd, argc, argv) < 0) in hostapd_cli_cmd() 239 return wpa_ctrl_command(ctrl, buf); in hostapd_cli_cmd() 266 char buf[100]; in hostapd_cli_cmd_mib() local 267 os_snprintf(buf, sizeof(buf), "MIB %s", argv[0]); in hostapd_cli_cmd_mib() [all …]
|
/hostap-3.6.0/src/crypto/ |
D | aes-eax.c | 32 u8 *buf; in aes_128_eax_encrypt() local 46 buf = os_malloc(buf_len); in aes_128_eax_encrypt() 47 if (buf == NULL) in aes_128_eax_encrypt() 50 os_memset(buf, 0, 15); in aes_128_eax_encrypt() 52 buf[15] = 0; in aes_128_eax_encrypt() 53 os_memcpy(buf + 16, nonce, nonce_len); in aes_128_eax_encrypt() 54 if (omac1_aes_128(key, buf, 16 + nonce_len, nonce_mac)) in aes_128_eax_encrypt() 57 buf[15] = 1; in aes_128_eax_encrypt() 58 os_memcpy(buf + 16, hdr, hdr_len); in aes_128_eax_encrypt() 59 if (omac1_aes_128(key, buf, 16 + hdr_len, hdr_mac)) in aes_128_eax_encrypt() [all …]
|
/hostap-3.6.0/src/tls/ |
D | asn1.c | 171 int asn1_get_next(const u8 *buf, size_t len, struct asn1_hdr *hdr) in asn1_get_next() argument 177 pos = buf; in asn1_get_next() 178 end = buf + len; in asn1_get_next() 290 int asn1_parse_oid(const u8 *buf, size_t len, struct asn1_oid *oid) in asn1_parse_oid() argument 298 pos = buf; in asn1_parse_oid() 299 end = buf + len; in asn1_parse_oid() 334 int asn1_get_oid(const u8 *buf, size_t len, struct asn1_oid *oid, in asn1_get_oid() argument 339 if (asn1_get_next(buf, len, &hdr) < 0 || hdr.length == 0 || in asn1_get_oid() 351 void asn1_oid_to_str(const struct asn1_oid *oid, char *buf, size_t len) in asn1_oid_to_str() argument 353 char *pos = buf; in asn1_oid_to_str() [all …]
|
/hostap-3.6.0/src/wps/ |
D | wps_upnp_web.c | 184 struct wpabuf *buf) in format_wps_device_xml() argument 189 wpabuf_put_str(buf, wps_device_xml_prefix); in format_wps_device_xml() 197 xml_add_tagged_data(buf, "friendlyName", s); in format_wps_device_xml() 201 xml_add_tagged_data(buf, "manufacturer", s); in format_wps_device_xml() 204 xml_add_tagged_data(buf, "manufacturerURL", in format_wps_device_xml() 208 xml_add_tagged_data(buf, "modelDescription", in format_wps_device_xml() 213 xml_add_tagged_data(buf, "modelName", s); in format_wps_device_xml() 216 xml_add_tagged_data(buf, "modelNumber", in format_wps_device_xml() 220 xml_add_tagged_data(buf, "modelURL", iface->wps->model_url); in format_wps_device_xml() 223 xml_add_tagged_data(buf, "serialNumber", in format_wps_device_xml() [all …]
|
/hostap-3.6.0/wpa_supplicant/ |
D | twt.c | 35 struct wpabuf *buf; in wpas_twt_send_setup() local 47 buf = wpabuf_alloc(3 + 17); in wpas_twt_send_setup() 48 if (!buf) { in wpas_twt_send_setup() 58 wpabuf_put_u8(buf, WLAN_ACTION_S1G); in wpas_twt_send_setup() 59 wpabuf_put_u8(buf, S1G_ACT_TWT_SETUP); in wpas_twt_send_setup() 60 wpabuf_put_u8(buf, dtok); in wpas_twt_send_setup() 62 wpabuf_put_u8(buf, WLAN_EID_TWT); in wpas_twt_send_setup() 63 wpabuf_put_u8(buf, 15); /* len */ in wpas_twt_send_setup() 65 wpabuf_put_u8(buf, control); in wpas_twt_send_setup() 81 wpabuf_put_le16(buf, req_type); in wpas_twt_send_setup() [all …]
|
D | robust_av.c | 24 struct wpabuf *buf) in wpas_populate_mscs_descriptor_ie() argument 29 wpabuf_put_u8(buf, WLAN_EID_EXTENSION); in wpas_populate_mscs_descriptor_ie() 30 len = wpabuf_put(buf, 1); in wpas_populate_mscs_descriptor_ie() 31 wpabuf_put_u8(buf, WLAN_EID_EXT_MSCS_DESCRIPTOR); in wpas_populate_mscs_descriptor_ie() 32 wpabuf_put_u8(buf, robust_av->request_type); in wpas_populate_mscs_descriptor_ie() 33 wpabuf_put_u8(buf, robust_av->up_bitmap); in wpas_populate_mscs_descriptor_ie() 34 wpabuf_put_u8(buf, robust_av->up_limit); in wpas_populate_mscs_descriptor_ie() 35 wpabuf_put_le32(buf, robust_av->stream_timeout); in wpas_populate_mscs_descriptor_ie() 39 wpabuf_put_u8(buf, WLAN_EID_EXTENSION); in wpas_populate_mscs_descriptor_ie() 40 len1 = wpabuf_put(buf, 1); in wpas_populate_mscs_descriptor_ie() [all …]
|
/hostap-3.6.0/src/eap_peer/ |
D | eap_teap_pac.c | 184 char *buf; member 194 if (fgets(rc->buf, rc->buf_len, rc->f) == NULL) in eap_teap_read_line() 208 os_memcpy(rc->buf, rc->pos, len); in eap_teap_read_line() 209 rc->buf[len] = '\0'; in eap_teap_read_line() 213 rc->buf[rc->buf_len - 1] = '\0'; in eap_teap_read_line() 214 pos = rc->buf; in eap_teap_read_line() 223 pos = os_strchr(rc->buf, '='); in eap_teap_read_line() 235 u8 *buf; in eap_teap_parse_hex() local 243 buf = os_malloc(*len); in eap_teap_parse_hex() 244 if (!buf) in eap_teap_parse_hex() [all …]
|
D | eap_fast_pac.c | 184 char *buf; member 194 if (fgets(rc->buf, rc->buf_len, rc->f) == NULL) in eap_fast_read_line() 207 os_memcpy(rc->buf, rc->pos, len); in eap_fast_read_line() 208 rc->buf[len] = '\0'; in eap_fast_read_line() 212 rc->buf[rc->buf_len - 1] = '\0'; in eap_fast_read_line() 213 pos = rc->buf; in eap_fast_read_line() 222 pos = os_strchr(rc->buf, '='); in eap_fast_read_line() 234 u8 *buf; in eap_fast_parse_hex() local 242 buf = os_malloc(*len); in eap_fast_parse_hex() 243 if (buf == NULL) in eap_fast_parse_hex() [all …]
|
/hostap-3.6.0/src/drivers/ |
D | driver_nl80211_android.c | 25 char *buf; member 47 char buf[MAX_DRV_CMD_SIZE]; in android_priv_cmd() local 54 os_memset(buf, 0, sizeof(buf)); in android_priv_cmd() 55 os_strlcpy(buf, cmd, sizeof(buf)); in android_priv_cmd() 57 priv_cmd.buf = buf; in android_priv_cmd() 58 priv_cmd.used_len = sizeof(buf); in android_priv_cmd() 59 priv_cmd.total_len = sizeof(buf); in android_priv_cmd() 82 char buf[WEXT_PNO_MAX_COMMAND_SIZE]; in android_pno_start() local 85 os_memcpy(buf, WEXT_PNOSETUP_HEADER, bp); in android_pno_start() 86 buf[bp++] = WEXT_PNO_TLV_PREFIX; in android_pno_start() [all …]
|
/hostap-3.6.0/wlantest/ |
D | ctrl.c | 21 static u8 * attr_get(u8 *buf, size_t buflen, enum wlantest_ctrl_attr attr, in attr_get() argument 24 u8 *pos = buf; in attr_get() 26 while (pos + 8 <= buf + buflen) { in attr_get() 33 if (pos + alen > buf + buflen) { in attr_get() 49 static u8 * attr_get_macaddr(u8 *buf, size_t buflen, in attr_get_macaddr() argument 54 addr = attr_get(buf, buflen, attr, &addr_len); in attr_get_macaddr() 61 static int attr_get_int(u8 *buf, size_t buflen, enum wlantest_ctrl_attr attr) in attr_get_int() argument 65 pos = attr_get(buf, buflen, attr, &len); in attr_get_int() 120 static void ctrl_send(struct wlantest *wt, int sock, const u8 *buf, in ctrl_send() argument 123 if (send(sock, buf, len, 0) < 0) { in ctrl_send() [all …]
|
/hostap-3.6.0/tests/remote/ |
D | test_devices.py | 31 status, buf = host.execute(["id"]) 41 status, buf = host.execute(["uname", "-s", "-n", "-r", "-m", "-o"]) 42 print("\t" + buf) 46 status, buf = host.execute(["ifconfig", iface]) 50 lines = buf.splitlines() 54 status, buf = host.execute([setup_params['wpa_supplicant'], "-v"]) 58 lines = buf.splitlines() 62 status, buf = host.execute([setup_params['hostapd'], "-v"]) 66 lines = buf.splitlines() 70 status, buf = host.execute([setup_params['iperf'], "-v"]) [all …]
|