Lines Matching +full:precondition +full:- +full:timeout
2 * UPnP WPS Device - Web connections
3 * Copyright (c) 2000-2003 Intel Corporation
4 * Copyright (c) 2006-2007 Sony Corporation
5 * Copyright (c) 2008-2009 Atheros Communications
34 "urn:schemas-wifialliance-org:service:WFAWLANConfig:1";
47 "<scpd xmlns=\"urn:schemas-upnp-org:service-1-0\">\n"
154 "<root xmlns=\"urn:schemas-upnp-org:device-1-0\">\n"
160 "<deviceType>urn:schemas-wifialliance-org:device:WFADevice:1"
166 "<serviceType>urn:schemas-wifialliance-org:service:WFAWLANConfig:1"
168 "<serviceId>urn:wifialliance-org:serviceId:WFAWLANConfig1</serviceId>"
179 /* format_wps_device_xml -- produce content of "file" wps_device.xml
195 s = iface->wps->friendly_name; in format_wps_device_xml()
199 s = iface->wps->dev.manufacturer; in format_wps_device_xml()
203 if (iface->wps->manufacturer_url) in format_wps_device_xml()
205 iface->wps->manufacturer_url); in format_wps_device_xml()
207 if (iface->wps->model_description) in format_wps_device_xml()
209 iface->wps->model_description); in format_wps_device_xml()
211 s = iface->wps->dev.model_name; in format_wps_device_xml()
215 if (iface->wps->dev.model_number) in format_wps_device_xml()
217 iface->wps->dev.model_number); in format_wps_device_xml()
219 if (iface->wps->model_url) in format_wps_device_xml()
220 xml_add_tagged_data(buf, "modelURL", iface->wps->model_url); in format_wps_device_xml()
222 if (iface->wps->dev.serial_number) in format_wps_device_xml()
224 iface->wps->dev.serial_number); in format_wps_device_xml()
226 uuid_bin2str(iface->wps->uuid, uuid_string, sizeof(uuid_string)); in format_wps_device_xml()
235 if (iface->wps->upc) in format_wps_device_xml()
236 xml_add_tagged_data(buf, "UPC", iface->wps->upc); in format_wps_device_xml()
253 wpabuf_put_str(buf, "412 Precondition failed\r\n"); in http_put_reply_code()
279 wpabuf_put_str(buf, "Content-Length: 0\r\n" in http_put_empty()
286 * Format of GET (case-insensitive):
295 * Content-Type: text/xml
296 * Date: <rfc1123-date>
299 * Per RFC 2616, content-length: is not required but connection:close
318 iface = dl_list_first(&sm->interfaces, in web_connection_parse_get()
333 if (iface->wps->friendly_name) in web_connection_parse_get()
334 extra_len += os_strlen(iface->wps->friendly_name); in web_connection_parse_get()
335 if (iface->wps->manufacturer_url) in web_connection_parse_get()
336 extra_len += os_strlen(iface->wps->manufacturer_url); in web_connection_parse_get()
337 if (iface->wps->model_description) in web_connection_parse_get()
338 extra_len += os_strlen(iface->wps->model_description); in web_connection_parse_get()
339 if (iface->wps->model_url) in web_connection_parse_get()
340 extra_len += os_strlen(iface->wps->model_url); in web_connection_parse_get()
341 if (iface->wps->upc) in web_connection_parse_get()
342 extra_len += os_strlen(iface->wps->upc); in web_connection_parse_get()
376 "Content-Type: text/xml; charset=\"utf-8\"\r\n"); in web_connection_parse_get()
379 wpabuf_put_str(buf, "Content-Length: "); in web_connection_parse_get()
404 body_length = (char *) wpabuf_put(buf, 0) - body_start; in web_connection_parse_get()
415 dl_list_del(&peer->list); in wps_upnp_peer_del()
416 if (peer->wps) in wps_upnp_peer_del()
417 wps_deinit(peer->wps); in wps_upnp_peer_del()
431 iface = dl_list_first(&sm->interfaces, in web_process_get_device_info()
436 if (!iface || iface->ctx->ap_pin == NULL) in web_process_get_device_info()
452 cfg.wps = iface->wps; in web_process_get_device_info()
453 cfg.pin = (u8 *) iface->ctx->ap_pin; in web_process_get_device_info()
454 cfg.pin_len = os_strlen(iface->ctx->ap_pin); in web_process_get_device_info()
455 peer->wps = wps_init(&cfg); in web_process_get_device_info()
456 if (peer->wps) { in web_process_get_device_info()
458 *reply = wps_get_msg(peer->wps, &op_code); in web_process_get_device_info()
460 wps_deinit(peer->wps); in web_process_get_device_info()
461 peer->wps = NULL; in web_process_get_device_info()
471 if (dl_list_len(&iface->peers) > 3) { in web_process_get_device_info()
474 old = dl_list_first(&iface->peers, struct upnp_wps_peer, list); in web_process_get_device_info()
480 dl_list_add_tail(&iface->peers, &peer->list); in web_process_get_device_info()
481 /* TODO: Could schedule a timeout to free the entry */ in web_process_get_device_info()
501 iface = dl_list_first(&sm->interfaces, in web_process_put_message()
507 * PutMessage is used by external UPnP-based Registrar to perform WPS in web_process_put_message()
518 "WPS UPnP: Could not parse PutMessage - NewInMessage"); in web_process_put_message()
525 dl_list_for_each(tmp, &iface->peers, struct upnp_wps_peer, list) { in web_process_put_message()
526 if (!tmp->wps) in web_process_put_message()
529 os_memcmp(tmp->wps->nonce_e, attr.enrollee_nonce, in web_process_put_message()
536 os_memcmp(tmp->wps->nonce_r, attr.registrar_nonce, in web_process_put_message()
549 peer = dl_list_first(&iface->peers, struct upnp_wps_peer, list); in web_process_put_message()
551 if (!peer || !peer->wps) { in web_process_put_message()
557 res = wps_process_msg(peer->wps, WSC_UPnP, msg); in web_process_put_message()
563 *reply = wps_get_msg(peer->wps, &op_code); in web_process_put_message()
587 * External UPnP-based Registrar is passing us a message to be proxied in web_process_put_wlan_response()
588 * over to a Wi-Fi -based client of ours. in web_process_put_wlan_response()
630 * using dot-deliminated MAC address format here. in web_process_put_wlan_response()
632 wpa_printf(MSG_DEBUG, "WPS UPnP: Workaround - allow " in web_process_put_wlan_response()
634 "NewWLANEventMAC: %s -> " MACSTR, in web_process_put_wlan_response()
647 type = -1; in web_process_put_wlan_response()
652 type = -1; in web_process_put_wlan_response()
653 dl_list_for_each(iface, &sm->interfaces, in web_process_put_wlan_response()
655 if (iface->ctx->rx_req_put_wlan_response && in web_process_put_wlan_response()
656 iface->ctx->rx_req_put_wlan_response(iface->priv, ev_type, in web_process_put_wlan_response()
663 wpa_printf(MSG_INFO, "WPS UPnP: Fail: sm->ctx->" in web_process_put_wlan_response()
679 dl_list_for_each(a, &s->addr_list, struct subscr_addr, list) { in find_er_addr()
680 if (cli->sin_addr.s_addr == a->saddr.sin_addr.s_addr) in find_er_addr()
691 dl_list_for_each(s, &sm->subscriptions, struct subscription, list) in find_er()
720 dl_list_for_each(iface, &sm->interfaces, in web_process_set_selected_registrar()
722 if (upnp_er_set_selected_registrar(iface->wps->registrar, s, in web_process_set_selected_registrar()
748 "<UPnPError xmlns=\"urn:schemas-upnp-org:control-1-0\">\n";
774 * action(action_len) -- action we are responding to in web_connection_send_reply()
775 * replyname -- a name we need for the reply in web_connection_send_reply()
776 * replydata -- NULL or null-terminated string in web_connection_send_reply()
796 "Content-Type: text/xml; " in web_connection_send_reply()
797 "charset=\"utf-8\"\r\n"); in web_connection_send_reply()
803 wpabuf_put_str(buf, "Content-Length: "); in web_connection_send_reply()
851 int body_length = (char *) wpabuf_put(buf, 0) - body_start; in web_connection_send_reply()
879 match_len = os_strlen(urn_wfawlanconfig) - 1; in web_get_action()
895 *action_len = b - action; in web_get_action()
902 * Format of POST (case-insensitive):
911 * Content-Type: text/xml
912 * Date: <rfc1123-date>
915 * Per RFC 2616, content-length: is not required but connection:close
966 * Format of SUBSCRIBE (case-insensitive):
975 * Timeout: Second-<n>
976 * Content-Length: 0
980 * Per RFC 2616, content-length: is not required but connection:close
1069 len = end - h; in web_connection_parse_subscribe()
1076 if (len > 0 && callback_urls[len - 1] == '\r') in web_connection_parse_subscribe()
1077 callback_urls[len - 1] = '\0'; in web_connection_parse_subscribe()
1103 /* TIMEOUT is requested timeout, but apparently we can in web_connection_parse_subscribe()
1144 wpabuf_put_str(buf, "Content-Length: 0\r\n"); in web_connection_parse_subscribe()
1148 uuid_bin2str(s->uuid, b, 80); in web_connection_parse_subscribe()
1152 wpabuf_printf(buf, "Timeout: Second-%d\r\n", UPNP_SUBSCRIBE_SEC); in web_connection_parse_subscribe()
1169 * 412 Precondition Failed. If CALLBACK header is missing or does not in web_connection_parse_subscribe()
1171 * error 412 Precondition Failed. in web_connection_parse_subscribe()
1173 * 412 Precondition Failed. If NT header does not equal upnp:event, in web_connection_parse_subscribe()
1174 * the publisher must respond with HTTP error 412 Precondition in web_connection_parse_subscribe()
1180 * HTTP 500-series error code. in web_connection_parse_subscribe()
1183 wpa_printf(MSG_DEBUG, "WPS UPnP: SUBSCRIBE failed - return %d", ret); in web_connection_parse_subscribe()
1192 * Format of UNSUBSCRIBE (case-insensitive):
1199 * Content-Length: 0
1202 * Per RFC 2616, content-length: is not required but connection:close
1296 sa = dl_list_first(&s->addr_list, struct subscr_addr, in web_connection_parse_unsubscribe()
1300 s, str, (sa && sa->domain_and_port) ? in web_connection_parse_unsubscribe()
1301 sa->domain_and_port : "-null-"); in web_connection_parse_unsubscribe()
1302 dl_list_del(&s->list); in web_connection_parse_unsubscribe()
1365 htype, inet_ntoa(cli->sin_addr), htons(cli->sin_port)); in web_connection_check_data()
1381 /* We are not required to support M-POST; just plain in web_connection_check_data()
1383 * If for some reason we need to support M-POST, it is in web_connection_check_data()
1402 http_server_deinit(sm->web_srv); in web_listener_stop()
1403 sm->web_srv = NULL; in web_listener_stop()
1410 addr.s_addr = sm->ip_addr; in web_listener_start()
1411 sm->web_srv = http_server_init(&addr, -1, web_connection_check_data, in web_listener_start()
1413 if (sm->web_srv == NULL) { in web_listener_start()
1415 return -1; in web_listener_start()
1417 sm->web_port = http_server_get_port(sm->web_srv); in web_listener_start()