Lines Matching full:response
57 static void gas_server_free_response(struct gas_server_response *response);
62 struct gas_server_response *response = eloop_ctx; in gas_server_response_timeout() local
64 wpa_printf(MSG_DEBUG, "GAS: Response @%p timeout for " MACSTR in gas_server_response_timeout()
66 response, MAC2STR(response->dst), response->dialog_token, in gas_server_response_timeout()
67 response->freq, response->frag_id, in gas_server_response_timeout()
68 (unsigned long) response->offset, in gas_server_response_timeout()
69 (unsigned long) (response->resp ? in gas_server_response_timeout()
70 wpabuf_len(response->resp) : 0)); in gas_server_response_timeout()
71 response->handler->status_cb(response->handler->ctx, in gas_server_response_timeout()
72 response->resp, 0); in gas_server_response_timeout()
73 response->resp = NULL; in gas_server_response_timeout()
74 dl_list_del(&response->list); in gas_server_response_timeout()
75 gas_server_free_response(response); in gas_server_response_timeout()
79 static void gas_server_free_response(struct gas_server_response *response) in gas_server_free_response() argument
81 if (!response) in gas_server_free_response()
83 wpa_printf(MSG_DEBUG, "DPP: Free GAS response @%p", response); in gas_server_free_response()
84 eloop_cancel_timeout(gas_server_response_timeout, response, NULL); in gas_server_free_response()
85 wpabuf_free(response->resp); in gas_server_free_response()
86 os_free(response); in gas_server_free_response()
92 struct gas_server_response *response, in gas_server_send_resp() argument
95 struct gas_server_handler *handler = response->handler; in gas_server_send_resp()
96 size_t max_len = (response->freq > 56160) ? 928 : 1400; in gas_server_send_resp()
102 dl_list_del(&response->list); in gas_server_send_resp()
103 gas_server_free_response(response); in gas_server_send_resp()
108 /* Need more time to prepare the response */ in gas_server_send_resp()
110 response->comeback_delay = comeback_delay; in gas_server_send_resp()
116 /* Full response fits into the initial response */ in gas_server_send_resp()
121 resp = gas_build_initial_resp(response->dialog_token, in gas_server_send_resp()
128 dl_list_del(&response->list); in gas_server_send_resp()
129 gas_server_free_response(response); in gas_server_send_resp()
140 /* Query Response Length */ in gas_server_send_resp()
146 wpa_printf(MSG_DEBUG, "GAS: No response available yet"); in gas_server_send_resp()
149 "GAS: Need to fragment query response"); in gas_server_send_resp()
152 "GAS: Full query response fits in the GAS Initial Response frame"); in gas_server_send_resp()
154 response->offset = resp_frag_len; in gas_server_send_resp()
155 response->resp = query_resp; in gas_server_send_resp()
156 response->initial_resp_sent = true; in gas_server_send_resp()
157 gas->tx(gas->ctx, response->freq, response->dst, resp, in gas_server_send_resp()
161 gas_server_response_timeout, response, NULL); in gas_server_send_resp()
175 struct gas_server_response *response; in gas_server_rx_initial_req() local
221 response = os_zalloc(sizeof(*response)); in gas_server_rx_initial_req()
222 if (!response) in gas_server_rx_initial_req()
225 wpa_printf(MSG_DEBUG, "DPP: Allocated GAS response @%p", response); in gas_server_rx_initial_req()
235 response->freq = freq; in gas_server_rx_initial_req()
236 response->handler = handler; in gas_server_rx_initial_req()
237 os_memcpy(response->dst, sa, ETH_ALEN); in gas_server_rx_initial_req()
238 response->dialog_token = dialog_token; in gas_server_rx_initial_req()
239 dl_list_add(&gas->responses, &response->list); in gas_server_rx_initial_req()
243 resp = handler->req_cb(handler->ctx, response, sa, query_req, in gas_server_rx_initial_req()
245 wpa_hexdump_buf(MSG_MSGDUMP, "GAS: Response from the handler", in gas_server_rx_initial_req()
249 "GAS: Handler requested short delay before sending out the initial response"); in gas_server_rx_initial_req()
256 gas_server_send_resp(gas, response, resp, comeback_delay); in gas_server_rx_initial_req()
262 gas_server_free_response(response); in gas_server_rx_initial_req()
268 gas_server_handle_rx_comeback_req(struct gas_server_response *response) in gas_server_handle_rx_comeback_req() argument
270 struct gas_server_handler *handler = response->handler; in gas_server_handle_rx_comeback_req()
272 size_t max_len = (response->freq > 56160) ? 928 : 1400; in gas_server_handle_rx_comeback_req()
278 if (!response->resp) { in gas_server_handle_rx_comeback_req()
279 resp = gas_build_comeback_resp(response->dialog_token, in gas_server_handle_rx_comeback_req()
281 response->comeback_delay, in gas_server_handle_rx_comeback_req()
284 dl_list_del(&response->list); in gas_server_handle_rx_comeback_req()
285 gas_server_free_response(response); in gas_server_handle_rx_comeback_req()
297 /* Query Response Length */ in gas_server_handle_rx_comeback_req()
302 remaining = wpabuf_len(response->resp) - response->offset; in gas_server_handle_rx_comeback_req()
308 "GAS: Sending out %u/%u remaining Query Response octets", in gas_server_handle_rx_comeback_req()
311 resp = gas_build_comeback_resp(response->dialog_token, in gas_server_handle_rx_comeback_req()
313 response->frag_id++, in gas_server_handle_rx_comeback_req()
318 dl_list_del(&response->list); in gas_server_handle_rx_comeback_req()
319 gas_server_free_response(response); in gas_server_handle_rx_comeback_req()
330 /* Query Response Length */ in gas_server_handle_rx_comeback_req()
332 wpabuf_put_data(resp, wpabuf_head_u8(response->resp) + response->offset, in gas_server_handle_rx_comeback_req()
335 response->offset += resp_frag_len; in gas_server_handle_rx_comeback_req()
341 gas->tx(gas->ctx, response->freq, response->dst, resp, wait_time); in gas_server_handle_rx_comeback_req()
350 struct gas_server_response *response; in gas_server_rx_comeback_req() local
352 dl_list_for_each(response, &gas->responses, struct gas_server_response, in gas_server_rx_comeback_req()
354 if (response->dialog_token != dialog_token || in gas_server_rx_comeback_req()
355 !ether_addr_equal(sa, response->dst)) in gas_server_rx_comeback_req()
357 gas_server_handle_rx_comeback_req(response); in gas_server_rx_comeback_req()
361 wpa_printf(MSG_DEBUG, "GAS: No pending GAS response for " MACSTR in gas_server_rx_comeback_req()
417 static void gas_server_handle_tx_status(struct gas_server_response *response, in gas_server_handle_tx_status() argument
420 if (ack && response->resp && in gas_server_handle_tx_status()
421 response->offset < wpabuf_len(response->resp)) { in gas_server_handle_tx_status()
427 if (ack && !response->resp && response->comeback_delay) { in gas_server_handle_tx_status()
429 "GAS: Waiting for response - keep pending entry"); in gas_server_handle_tx_status()
438 "GAS: Last fragment of the response sent out - drop pending entry"); in gas_server_handle_tx_status()
440 response->handler->status_cb(response->handler->ctx, in gas_server_handle_tx_status()
441 response->resp, ack); in gas_server_handle_tx_status()
442 response->resp = NULL; in gas_server_handle_tx_status()
443 dl_list_del(&response->list); in gas_server_handle_tx_status()
444 gas_server_free_response(response); in gas_server_handle_tx_status()
453 struct gas_server_response *response; in gas_server_tx_status() local
470 dl_list_for_each(response, &gas->responses, struct gas_server_response, in gas_server_tx_status()
472 if (response->dialog_token != dialog_token || in gas_server_tx_status()
473 !ether_addr_equal(dst, response->dst)) in gas_server_tx_status()
475 gas_server_handle_tx_status(response, ack); in gas_server_tx_status()
479 wpa_printf(MSG_DEBUG, "GAS: No pending response matches TX status"); in gas_server_tx_status()
486 struct gas_server_response *tmp, *response = NULL; in gas_server_set_resp() local
491 response = tmp; in gas_server_set_resp()
496 if (!response || response->resp) in gas_server_set_resp()
499 if (!response->initial_resp_sent) { in gas_server_set_resp()
500 wpa_printf(MSG_DEBUG, "GAS: Send the delayed initial response"); in gas_server_set_resp()
501 gas_server_send_resp(gas, response, resp, 0); in gas_server_set_resp()
505 response->resp = resp; in gas_server_set_resp()
513 struct gas_server_response *tmp, *response = NULL; in gas_server_set_comeback_delay() local
518 response = tmp; in gas_server_set_comeback_delay()
523 if (!response || response->initial_resp_sent) in gas_server_set_comeback_delay()
527 "GAS: Send the delayed initial response with comeback delay %u", in gas_server_set_comeback_delay()
529 gas_server_send_resp(gas, response, NULL, comeback_delay); in gas_server_set_comeback_delay()
572 struct gas_server_response *response, *tmp_r; in gas_server_deinit() local
583 dl_list_for_each_safe(response, tmp_r, &gas->responses, in gas_server_deinit()
585 dl_list_del(&response->list); in gas_server_deinit()
586 gas_server_free_response(response); in gas_server_deinit()