Lines Matching refs:msg
37 struct p2p_message *msg) in p2p_parse_attribute() argument
50 msg->capability = data; in p2p_parse_attribute()
61 msg->device_id = data; in p2p_parse_attribute()
63 MAC2STR(msg->device_id)); in p2p_parse_attribute()
71 msg->go_intent = data; in p2p_parse_attribute()
81 msg->status = data; in p2p_parse_attribute()
95 msg->listen_channel = data; in p2p_parse_attribute()
112 msg->operating_channel = data; in p2p_parse_attribute()
124 msg->channel_list = data; in p2p_parse_attribute()
125 msg->channel_list_len = len; in p2p_parse_attribute()
129 msg->channel_list, msg->channel_list_len); in p2p_parse_attribute()
132 msg->group_info = data; in p2p_parse_attribute()
133 msg->group_info_len = len; in p2p_parse_attribute()
142 msg->p2p_device_info = data; in p2p_parse_attribute()
143 msg->p2p_device_info_len = len; in p2p_parse_attribute()
145 msg->p2p_device_addr = pos; in p2p_parse_attribute()
147 msg->config_methods = WPA_GET_BE16(pos); in p2p_parse_attribute()
149 msg->pri_dev_type = pos; in p2p_parse_attribute()
151 msg->num_sec_dev_types = *pos++; in p2p_parse_attribute()
152 if (msg->num_sec_dev_types * 8 > data + len - pos) { in p2p_parse_attribute()
156 pos += msg->num_sec_dev_types * 8; in p2p_parse_attribute()
176 p2p_copy_filter_devname(msg->device_name, in p2p_parse_attribute()
177 sizeof(msg->device_name), pos, nlen); in p2p_parse_attribute()
181 MAC2STR(msg->p2p_device_addr), in p2p_parse_attribute()
182 wps_dev_type_bin2str(msg->pri_dev_type, devtype, in p2p_parse_attribute()
184 msg->device_name, msg->config_methods); in p2p_parse_attribute()
192 msg->config_timeout = data; in p2p_parse_attribute()
202 msg->intended_addr = data; in p2p_parse_attribute()
204 MACSTR, MAC2STR(msg->intended_addr)); in p2p_parse_attribute()
212 msg->group_bssid = data; in p2p_parse_attribute()
214 MAC2STR(msg->group_bssid)); in p2p_parse_attribute()
222 msg->group_id = data; in p2p_parse_attribute()
223 msg->group_id_len = len; in p2p_parse_attribute()
225 MACSTR, MAC2STR(msg->group_id)); in p2p_parse_attribute()
227 msg->group_id + ETH_ALEN, in p2p_parse_attribute()
228 msg->group_id_len - ETH_ALEN); in p2p_parse_attribute()
236 msg->invitation_flags = data; in p2p_parse_attribute()
246 msg->manageability = data; in p2p_parse_attribute()
256 msg->noa = data; in p2p_parse_attribute()
257 msg->noa_len = len; in p2p_parse_attribute()
266 msg->ext_listen_timing = data; in p2p_parse_attribute()
269 WPA_GET_LE16(msg->ext_listen_timing), in p2p_parse_attribute()
270 WPA_GET_LE16(msg->ext_listen_timing + 2)); in p2p_parse_attribute()
278 msg->minor_reason_code = data; in p2p_parse_attribute()
280 *msg->minor_reason_code); in p2p_parse_attribute()
288 msg->oob_go_neg_channel = data; in p2p_parse_attribute()
302 msg->service_hash_count = len / P2PS_HASH_LEN; in p2p_parse_attribute()
303 msg->service_hash = data; in p2p_parse_attribute()
307 msg->session_info = data; in p2p_parse_attribute()
308 msg->session_info_len = len; in p2p_parse_attribute()
319 msg->conn_cap = data; in p2p_parse_attribute()
321 *msg->conn_cap); in p2p_parse_attribute()
330 msg->adv_id = data; in p2p_parse_attribute()
331 msg->adv_mac = &data[sizeof(u32)]; in p2p_parse_attribute()
342 msg->adv_service_instance = data; in p2p_parse_attribute()
343 msg->adv_service_instance_len = len; in p2p_parse_attribute()
367 msg->session_id = data; in p2p_parse_attribute()
368 msg->session_mac = &data[sizeof(u32)]; in p2p_parse_attribute()
370 WPA_GET_LE32(data), MAC2STR(msg->session_mac)); in p2p_parse_attribute()
379 msg->feature_cap = data; in p2p_parse_attribute()
380 msg->feature_cap_len = len; in p2p_parse_attribute()
392 msg->persistent_dev = data; in p2p_parse_attribute()
393 msg->persistent_ssid_len = len - ETH_ALEN; in p2p_parse_attribute()
394 msg->persistent_ssid = &data[ETH_ALEN]; in p2p_parse_attribute()
396 MAC2STR(msg->persistent_dev), in p2p_parse_attribute()
397 wpa_ssid_txt(msg->persistent_ssid, in p2p_parse_attribute()
398 msg->persistent_ssid_len)); in p2p_parse_attribute()
420 int p2p_parse_p2p_ie(const struct wpabuf *buf, struct p2p_message *msg) in p2p_parse_p2p_ie() argument
447 if (p2p_parse_attribute(id, pos, attr_len, msg)) in p2p_parse_p2p_ie()
456 static int p2p_parse_wps_ie(const struct wpabuf *buf, struct p2p_message *msg) in p2p_parse_wps_ie() argument
464 if (attr.dev_name && attr.dev_name_len < sizeof(msg->device_name) && in p2p_parse_wps_ie()
465 !msg->device_name[0]) in p2p_parse_wps_ie()
466 os_memcpy(msg->device_name, attr.dev_name, attr.dev_name_len); in p2p_parse_wps_ie()
468 msg->wps_config_methods = in p2p_parse_wps_ie()
471 msg->wps_config_methods); in p2p_parse_wps_ie()
474 msg->dev_password_id = WPA_GET_BE16(attr.dev_password_id); in p2p_parse_wps_ie()
476 msg->dev_password_id); in p2p_parse_wps_ie()
477 msg->dev_password_id_present = 1; in p2p_parse_wps_ie()
481 msg->wps_pri_dev_type = attr.primary_dev_type; in p2p_parse_wps_ie()
483 wps_dev_type_bin2str(msg->wps_pri_dev_type, devtype, in p2p_parse_wps_ie()
487 msg->wps_sec_dev_type_list = attr.sec_dev_type_list; in p2p_parse_wps_ie()
488 msg->wps_sec_dev_type_list_len = attr.sec_dev_type_list_len; in p2p_parse_wps_ie()
492 msg->wps_vendor_ext[i] = attr.vendor_ext[i]; in p2p_parse_wps_ie()
493 msg->wps_vendor_ext_len[i] = attr.vendor_ext_len[i]; in p2p_parse_wps_ie()
496 msg->manufacturer = attr.manufacturer; in p2p_parse_wps_ie()
497 msg->manufacturer_len = attr.manufacturer_len; in p2p_parse_wps_ie()
498 msg->model_name = attr.model_name; in p2p_parse_wps_ie()
499 msg->model_name_len = attr.model_name_len; in p2p_parse_wps_ie()
500 msg->model_number = attr.model_number; in p2p_parse_wps_ie()
501 msg->model_number_len = attr.model_number_len; in p2p_parse_wps_ie()
502 msg->serial_number = attr.serial_number; in p2p_parse_wps_ie()
503 msg->serial_number_len = attr.serial_number_len; in p2p_parse_wps_ie()
505 msg->oob_dev_password = attr.oob_dev_password; in p2p_parse_wps_ie()
506 msg->oob_dev_password_len = attr.oob_dev_password_len; in p2p_parse_wps_ie()
525 int p2p_parse_ies(const u8 *data, size_t len, struct p2p_message *msg) in p2p_parse_ies() argument
531 msg->ds_params = elems.ds_params; in p2p_parse_ies()
533 msg->ssid = elems.ssid - 2; in p2p_parse_ies()
535 msg->wps_attributes = ieee802_11_vendor_ie_concat(data, len, in p2p_parse_ies()
537 if (msg->wps_attributes && in p2p_parse_ies()
538 p2p_parse_wps_ie(msg->wps_attributes, msg)) { in p2p_parse_ies()
539 p2p_parse_free(msg); in p2p_parse_ies()
543 msg->p2p_attributes = ieee802_11_vendor_ie_concat(data, len, in p2p_parse_ies()
545 if (msg->p2p_attributes && in p2p_parse_ies()
546 p2p_parse_p2p_ie(msg->p2p_attributes, msg)) { in p2p_parse_ies()
548 if (msg->p2p_attributes) in p2p_parse_ies()
550 msg->p2p_attributes); in p2p_parse_ies()
551 p2p_parse_free(msg); in p2p_parse_ies()
557 msg->wfd_subelems = ieee802_11_vendor_ie_concat( in p2p_parse_ies()
562 msg->pref_freq_list = elems.pref_freq_list; in p2p_parse_ies()
563 msg->pref_freq_list_len = elems.pref_freq_list_len; in p2p_parse_ies()
579 int p2p_parse(const u8 *data, size_t len, struct p2p_message *msg) in p2p_parse() argument
581 os_memset(msg, 0, sizeof(*msg)); in p2p_parse()
587 msg->dialog_token = data[0]; in p2p_parse()
588 wpa_printf(MSG_DEBUG, "P2P: * Dialog Token: %d", msg->dialog_token); in p2p_parse()
590 return p2p_parse_ies(data + 1, len - 1, msg); in p2p_parse()
595 size_t p2p_len, struct p2p_message *msg) in p2p_parse_ies_separate() argument
597 os_memset(msg, 0, sizeof(*msg)); in p2p_parse_ies_separate()
599 msg->wps_attributes = wpabuf_alloc_copy(wsc, wsc_len); in p2p_parse_ies_separate()
600 if (msg->wps_attributes && in p2p_parse_ies_separate()
601 p2p_parse_wps_ie(msg->wps_attributes, msg)) { in p2p_parse_ies_separate()
602 p2p_parse_free(msg); in p2p_parse_ies_separate()
606 msg->p2p_attributes = wpabuf_alloc_copy(p2p, p2p_len); in p2p_parse_ies_separate()
607 if (msg->p2p_attributes && in p2p_parse_ies_separate()
608 p2p_parse_p2p_ie(msg->p2p_attributes, msg)) { in p2p_parse_ies_separate()
610 if (msg->p2p_attributes) in p2p_parse_ies_separate()
612 msg->p2p_attributes); in p2p_parse_ies_separate()
613 p2p_parse_free(msg); in p2p_parse_ies_separate()
625 void p2p_parse_free(struct p2p_message *msg) in p2p_parse_free() argument
627 wpabuf_free(msg->p2p_attributes); in p2p_parse_free()
628 msg->p2p_attributes = NULL; in p2p_parse_free()
629 wpabuf_free(msg->wps_attributes); in p2p_parse_free()
630 msg->wps_attributes = NULL; in p2p_parse_free()
632 wpabuf_free(msg->wfd_subelems); in p2p_parse_free()
633 msg->wfd_subelems = NULL; in p2p_parse_free()
785 struct p2p_message msg; in p2p_attr_text() local
789 os_memset(&msg, 0, sizeof(msg)); in p2p_attr_text()
790 if (p2p_parse_p2p_ie(data, &msg)) in p2p_attr_text()
793 if (msg.capability) { in p2p_attr_text()
797 msg.capability[0], msg.capability[1]); in p2p_attr_text()
803 if (msg.pri_dev_type) { in p2p_attr_text()
807 wps_dev_type_bin2str(msg.pri_dev_type, in p2p_attr_text()
816 msg.device_name); in p2p_attr_text()
821 if (msg.p2p_device_addr) { in p2p_attr_text()
824 MAC2STR(msg.p2p_device_addr)); in p2p_attr_text()
831 msg.config_methods); in p2p_attr_text()
836 ret = p2p_group_info_text(msg.group_info, msg.group_info_len, in p2p_attr_text()
848 struct p2p_message msg; in p2p_get_cross_connect_disallowed() local
850 os_memset(&msg, 0, sizeof(msg)); in p2p_get_cross_connect_disallowed()
851 if (p2p_parse_p2p_ie(p2p_ie, &msg)) in p2p_get_cross_connect_disallowed()
854 if (!msg.manageability) in p2p_get_cross_connect_disallowed()
857 return !(msg.manageability[0] & P2P_MAN_CROSS_CONNECTION_PERMITTED); in p2p_get_cross_connect_disallowed()
863 struct p2p_message msg; in p2p_get_group_capab() local
865 os_memset(&msg, 0, sizeof(msg)); in p2p_get_group_capab()
866 if (p2p_parse_p2p_ie(p2p_ie, &msg)) in p2p_get_group_capab()
869 if (!msg.capability) in p2p_get_group_capab()
872 return msg.capability[1]; in p2p_get_group_capab()
878 struct p2p_message msg; in p2p_get_go_dev_addr() local
880 os_memset(&msg, 0, sizeof(msg)); in p2p_get_go_dev_addr()
881 if (p2p_parse_p2p_ie(p2p_ie, &msg)) in p2p_get_go_dev_addr()
884 if (msg.p2p_device_addr) in p2p_get_go_dev_addr()
885 return msg.p2p_device_addr; in p2p_get_go_dev_addr()
886 if (msg.device_id) in p2p_get_go_dev_addr()
887 return msg.device_id; in p2p_get_go_dev_addr()