Lines Matching refs:msg

444 static int p2ps_validate_pd_req(struct p2p_data *p2p, struct p2p_message *msg,  in p2ps_validate_pd_req()  argument
456 if ((_val) && !msg->_attr) { \ in p2ps_validate_pd_req()
475 if (msg->status && *msg->status != P2P_SC_SUCCESS_DEFERRED) in p2ps_validate_pd_req()
490 if (msg->feature_cap_len < sizeof(struct p2ps_feature_capab)) { in p2ps_validate_pd_req()
495 switch (*msg->conn_cap) { in p2ps_validate_pd_req()
532 if (msg->persistent_dev) { in p2ps_validate_pd_req()
535 if (os_memcmp(msg->persistent_dev, addr, ETH_ALEN) == 0) { in p2ps_validate_pd_req()
557 struct p2p_message msg; in p2p_process_prov_disc_req() local
578 if (p2p_parse(data, len, &msg)) in p2p_process_prov_disc_req()
583 MAC2STR(sa), msg.wps_config_methods, rx_freq); in p2p_process_prov_disc_req()
584 group_mac = msg.intended_addr; in p2p_process_prov_disc_req()
607 } else if (msg.wfd_subelems) { in p2p_process_prov_disc_req()
609 dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems); in p2p_process_prov_disc_req()
612 if (!msg.adv_id) { in p2p_process_prov_disc_req()
614 if (!(msg.wps_config_methods & allowed_config_methods)) { in p2p_process_prov_disc_req()
621 if (msg.group_id) { in p2p_process_prov_disc_req()
627 msg.group_id, msg.group_id_len)) in p2p_process_prov_disc_req()
643 adv_id = WPA_GET_LE32(msg.adv_id); in p2p_process_prov_disc_req()
644 if (p2ps_validate_pd_req(p2p, &msg, sa) < 0) { in p2p_process_prov_disc_req()
649 req_fcap = (struct p2ps_feature_capab *) msg.feature_cap; in p2p_process_prov_disc_req()
651 os_memcpy(session_mac, msg.session_mac, ETH_ALEN); in p2p_process_prov_disc_req()
652 os_memcpy(adv_mac, msg.adv_mac, ETH_ALEN); in p2p_process_prov_disc_req()
654 session_id = WPA_GET_LE32(msg.session_id); in p2p_process_prov_disc_req()
656 if (msg.conn_cap) in p2p_process_prov_disc_req()
657 conncap = *msg.conn_cap; in p2p_process_prov_disc_req()
664 if ((!msg.status || *msg.status == P2P_SC_SUCCESS_DEFERRED) && in p2p_process_prov_disc_req()
665 !(msg.wps_config_methods & allowed_config_methods)) { in p2p_process_prov_disc_req()
681 if (msg.wps_config_methods & WPS_CONFIG_DISPLAY) { in p2p_process_prov_disc_req()
686 } else if (msg.wps_config_methods & WPS_CONFIG_KEYPAD) { in p2p_process_prov_disc_req()
692 } else if (msg.wps_config_methods & WPS_CONFIG_P2PS) { in p2p_process_prov_disc_req()
703 msg.persistent_dev, in p2p_process_prov_disc_req()
704 msg.persistent_ssid, msg.persistent_ssid_len); in p2p_process_prov_disc_req()
713 if (!msg.adv_id) in p2p_process_prov_disc_req()
718 if (!msg.status) { in p2p_process_prov_disc_req()
721 if (os_memcmp(p2p->cfg->dev_addr, msg.adv_mac, ETH_ALEN)) { in p2p_process_prov_disc_req()
758 !(msg.wps_config_methods & in p2p_process_prov_disc_req()
763 msg.wps_config_methods); in p2p_process_prov_disc_req()
773 if (msg.wps_config_methods & WPS_CONFIG_KEYPAD) { in p2p_process_prov_disc_req()
779 msg.persistent_dev) && conncap != P2PS_SETUP_NEW && in p2p_process_prov_disc_req()
780 msg.channel_list && msg.channel_list_len && in p2p_process_prov_disc_req()
782 msg.channel_list, in p2p_process_prov_disc_req()
783 msg.channel_list_len) < 0) { in p2p_process_prov_disc_req()
790 msg.persistent_dev) && msg.operating_channel) { in p2p_process_prov_disc_req()
801 msg.operating_channel[3], in p2p_process_prov_disc_req()
802 msg.operating_channel[4])) { in p2p_process_prov_disc_req()
807 msg.operating_channel[3]; in p2p_process_prov_disc_req()
809 msg.operating_channel[4]; in p2p_process_prov_disc_req()
828 msg.wps_config_methods, in p2p_process_prov_disc_req()
850 if (!msg.status && !auto_accept && in p2p_process_prov_disc_req()
860 msg.wps_config_methods, in p2p_process_prov_disc_req()
871 if (!msg.status) in p2p_process_prov_disc_req()
874 if (*msg.status && *msg.status != P2P_SC_SUCCESS_DEFERRED) { in p2p_process_prov_disc_req()
875 reject = *msg.status; in p2p_process_prov_disc_req()
879 if (*msg.status != P2P_SC_SUCCESS_DEFERRED || !p2p->p2ps_prov) in p2p_process_prov_disc_req()
883 os_memcmp(p2p->p2ps_prov->adv_mac, msg.adv_mac, ETH_ALEN)) { in p2p_process_prov_disc_req()
890 os_memcmp(p2p->p2ps_prov->session_mac, msg.session_mac, ETH_ALEN)) { in p2p_process_prov_disc_req()
921 if (!conncap || !(msg.wps_config_methods & method)) { in p2p_process_prov_disc_req()
932 msg.persistent_dev) && conncap != P2PS_SETUP_NEW && in p2p_process_prov_disc_req()
933 msg.channel_list && msg.channel_list_len && in p2p_process_prov_disc_req()
935 msg.channel_list, in p2p_process_prov_disc_req()
936 msg.channel_list_len) < 0) { in p2p_process_prov_disc_req()
948 if (msg.operating_channel) in p2p_process_prov_disc_req()
950 p2p_channel_to_freq(msg.operating_channel[3], in p2p_process_prov_disc_req()
951 msg.operating_channel[4]); in p2p_process_prov_disc_req()
964 config_methods = msg.wps_config_methods; in p2p_process_prov_disc_req()
972 if (!msg.status || *msg.status == P2P_SC_SUCCESS_DEFERRED) { in p2p_process_prov_disc_req()
973 resp = p2p_build_prov_disc_resp(p2p, dev, msg.dialog_token, in p2p_process_prov_disc_req()
975 msg.group_id, msg.group_id_len, in p2p_process_prov_disc_req()
976 msg.persistent_ssid, in p2p_process_prov_disc_req()
977 msg.persistent_ssid_len, in p2p_process_prov_disc_req()
981 p2p_parse_free(&msg); in p2p_process_prov_disc_req()
993 p2p_parse_free(&msg); in p2p_process_prov_disc_req()
1009 p2p_parse_free(&msg); in p2p_process_prov_disc_req()
1023 } else if (msg.status && *msg.status != P2P_SC_SUCCESS && in p2p_process_prov_disc_req()
1024 *msg.status != P2P_SC_SUCCESS_DEFERRED) { in p2p_process_prov_disc_req()
1025 reject = *msg.status; in p2p_process_prov_disc_req()
1029 0, 0, msg.persistent_ssid, in p2p_process_prov_disc_req()
1030 msg.persistent_ssid_len, in p2p_process_prov_disc_req()
1033 } else if (msg.status && *msg.status == P2P_SC_SUCCESS_DEFERRED && in p2p_process_prov_disc_req()
1043 msg.persistent_ssid, in p2p_process_prov_disc_req()
1044 msg.persistent_ssid_len, 0, in p2p_process_prov_disc_req()
1049 *msg.status, in p2p_process_prov_disc_req()
1054 msg.persistent_ssid, in p2p_process_prov_disc_req()
1055 msg.persistent_ssid_len, 0, in p2p_process_prov_disc_req()
1060 } else if (msg.status && p2p->p2ps_prov) { in p2p_process_prov_disc_req()
1062 p2p->cfg->p2ps_prov_complete(p2p->cfg->cb_ctx, *msg.status, sa, in p2p_process_prov_disc_req()
1066 msg.persistent_ssid, in p2p_process_prov_disc_req()
1067 msg.persistent_ssid_len, in p2p_process_prov_disc_req()
1071 } else if (msg.status) { in p2p_process_prov_disc_req()
1077 msg.persistent_ssid, in p2p_process_prov_disc_req()
1078 msg.persistent_ssid_len, in p2p_process_prov_disc_req()
1082 msg.group_id ? in p2p_process_prov_disc_req()
1083 msg.group_id + ETH_ALEN : NULL, in p2p_process_prov_disc_req()
1084 msg.group_id ? in p2p_process_prov_disc_req()
1085 msg.group_id_len - ETH_ALEN : 0); in p2p_process_prov_disc_req()
1087 (!msg.session_info || !msg.session_info_len)) { in p2p_process_prov_disc_req()
1088 p2p->p2ps_prov->method = msg.wps_config_methods; in p2p_process_prov_disc_req()
1094 msg.persistent_ssid, in p2p_process_prov_disc_req()
1095 msg.persistent_ssid_len, in p2p_process_prov_disc_req()
1100 size_t buf_len = msg.session_info_len; in p2p_process_prov_disc_req()
1104 p2p->p2ps_prov->method = msg.wps_config_methods; in p2p_process_prov_disc_req()
1106 utf8_escape((char *) msg.session_info, buf_len, in p2p_process_prov_disc_req()
1113 msg.persistent_ssid, msg.persistent_ssid_len, in p2p_process_prov_disc_req()
1141 ((reject == P2P_SC_SUCCESS && !msg.adv_id) || in p2p_process_prov_disc_req()
1142 (!msg.status && in p2p_process_prov_disc_req()
1146 (!msg.status && in p2p_process_prov_disc_req()
1150 msg.status && *msg.status == P2P_SC_SUCCESS_DEFERRED && in p2p_process_prov_disc_req()
1154 if (msg.p2p_device_addr) in p2p_process_prov_disc_req()
1155 dev_addr = msg.p2p_device_addr; in p2p_process_prov_disc_req()
1157 msg.wps_config_methods, in p2p_process_prov_disc_req()
1158 dev_addr, msg.pri_dev_type, in p2p_process_prov_disc_req()
1159 msg.device_name, msg.config_methods, in p2p_process_prov_disc_req()
1160 msg.capability ? msg.capability[0] : 0, in p2p_process_prov_disc_req()
1161 msg.capability ? msg.capability[1] : in p2p_process_prov_disc_req()
1163 msg.group_id, msg.group_id_len); in p2p_process_prov_disc_req()
1185 if (msg.intended_addr) in p2p_process_prov_disc_req()
1186 os_memcpy(dev->interface_addr, msg.intended_addr, in p2p_process_prov_disc_req()
1189 p2p_parse_free(&msg); in p2p_process_prov_disc_req()
1194 struct p2p_message *msg) in p2p_validate_p2ps_pd_resp() argument
1203 if ((_val) && !msg->_attr) { \ in p2p_validate_p2ps_pd_resp()
1218 session_id = WPA_GET_LE32(msg->session_id); in p2p_validate_p2ps_pd_resp()
1219 adv_id = WPA_GET_LE32(msg->adv_id); in p2p_validate_p2ps_pd_resp()
1227 if (os_memcmp(p2p->p2ps_prov->session_mac, msg->session_mac, in p2p_validate_p2ps_pd_resp()
1240 if (os_memcmp(p2p->p2ps_prov->adv_mac, msg->adv_mac, ETH_ALEN) != 0) { in p2p_validate_p2ps_pd_resp()
1246 if (msg->listen_channel) { in p2p_validate_p2ps_pd_resp()
1252 if (*msg->status == P2P_SC_SUCCESS && in p2p_validate_p2ps_pd_resp()
1253 !(!!msg->conn_cap ^ !!msg->persistent_dev)) { in p2p_validate_p2ps_pd_resp()
1259 if (msg->persistent_dev && *msg->status != P2P_SC_SUCCESS) { in p2p_validate_p2ps_pd_resp()
1265 if (msg->conn_cap) { in p2p_validate_p2ps_pd_resp()
1266 conn_cap_go = *msg->conn_cap == P2PS_SETUP_GROUP_OWNER; in p2p_validate_p2ps_pd_resp()
1267 conn_cap_cli = *msg->conn_cap == P2PS_SETUP_CLIENT; in p2p_validate_p2ps_pd_resp()
1270 P2PS_PD_RESP_CHECK(msg->persistent_dev || conn_cap_go || conn_cap_cli, in p2p_validate_p2ps_pd_resp()
1272 P2PS_PD_RESP_CHECK(msg->persistent_dev || conn_cap_go || conn_cap_cli, in p2p_validate_p2ps_pd_resp()
1295 struct p2p_message msg; in p2p_process_prov_disc_resp() local
1306 if (p2p_parse(data, len, &msg)) in p2p_process_prov_disc_resp()
1309 if (p2p->p2ps_prov && p2p_validate_p2ps_pd_resp(p2p, &msg)) { in p2p_process_prov_disc_resp()
1310 p2p_parse_free(&msg); in p2p_process_prov_disc_resp()
1315 if (msg.status) in p2p_process_prov_disc_resp()
1316 status = *msg.status; in p2p_process_prov_disc_resp()
1318 group_mac = msg.intended_addr; in p2p_process_prov_disc_resp()
1320 if (msg.adv_mac) in p2p_process_prov_disc_resp()
1321 os_memcpy(adv_mac, msg.adv_mac, ETH_ALEN); in p2p_process_prov_disc_resp()
1325 if (msg.adv_id) in p2p_process_prov_disc_resp()
1326 adv_id = WPA_GET_LE32(msg.adv_id); in p2p_process_prov_disc_resp()
1328 if (msg.conn_cap) { in p2p_process_prov_disc_resp()
1329 conncap = *msg.conn_cap; in p2p_process_prov_disc_resp()
1344 MAC2STR(sa), msg.wps_config_methods); in p2p_process_prov_disc_resp()
1350 p2p_parse_free(&msg); in p2p_process_prov_disc_resp()
1352 } else if (msg.wfd_subelems) { in p2p_process_prov_disc_resp()
1354 dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems); in p2p_process_prov_disc_resp()
1357 if (dev->dialog_token != msg.dialog_token) { in p2p_process_prov_disc_resp()
1359 msg.dialog_token, dev->dialog_token); in p2p_process_prov_disc_resp()
1360 p2p_parse_free(&msg); in p2p_process_prov_disc_resp()
1385 if (msg.wps_config_methods != req_config_methods) { in p2p_process_prov_disc_resp()
1387 msg.wps_config_methods, req_config_methods); in p2p_process_prov_disc_resp()
1392 p2p_parse_free(&msg); in p2p_process_prov_disc_resp()
1406 } else if (msg.wps_config_methods & WPS_CONFIG_KEYPAD) { in p2p_process_prov_disc_resp()
1412 } else if (msg.wps_config_methods & WPS_CONFIG_P2PS) { in p2p_process_prov_disc_resp()
1431 if (msg.channel_list && msg.channel_list_len && in p2p_process_prov_disc_resp()
1433 msg.channel_list, in p2p_process_prov_disc_resp()
1434 msg.channel_list_len) < 0) in p2p_process_prov_disc_resp()
1437 if (msg.operating_channel) { in p2p_process_prov_disc_resp()
1439 msg.operating_channel[3], in p2p_process_prov_disc_resp()
1440 msg.operating_channel[4]) && in p2p_process_prov_disc_resp()
1442 msg.operating_channel[3], in p2p_process_prov_disc_resp()
1443 msg.operating_channel[4])) { in p2p_process_prov_disc_resp()
1446 msg.operating_channel[3], in p2p_process_prov_disc_resp()
1447 msg.operating_channel[4]); in p2p_process_prov_disc_resp()
1479 conncap, passwd_id, msg.persistent_ssid, in p2p_process_prov_disc_resp()
1480 msg.persistent_ssid_len, 1, 0, NULL, in p2p_process_prov_disc_resp()
1481 msg.feature_cap, msg.feature_cap_len, freq, in p2p_process_prov_disc_resp()
1482 msg.group_id ? msg.group_id + ETH_ALEN : NULL, in p2p_process_prov_disc_resp()
1483 msg.group_id ? msg.group_id_len - ETH_ALEN : 0); in p2p_process_prov_disc_resp()
1505 if (msg.session_info && msg.session_info_len) { in p2p_process_prov_disc_resp()
1506 size_t info_len = msg.session_info_len; in p2p_process_prov_disc_resp()
1510 p2p_parse_free(&msg); in p2p_process_prov_disc_resp()
1514 utf8_escape((char *) msg.session_info, info_len, in p2p_process_prov_disc_resp()
1536 p2p_parse_free(&msg); in p2p_process_prov_disc_resp()
1542 dev->wps_prov_info = msg.wps_config_methods; in p2p_process_prov_disc_resp()
1543 if (msg.intended_addr) in p2p_process_prov_disc_resp()
1544 os_memcpy(dev->interface_addr, msg.intended_addr, ETH_ALEN); in p2p_process_prov_disc_resp()
1546 p2p_parse_free(&msg); in p2p_process_prov_disc_resp()