]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/HTTPUtilities.h
mDNSResponder-1310.80.1.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / HTTPUtilities.h
1 /*
2 * Copyright (c) 2019-2020 Apple Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef __HTTPUtilities_h
18 #define __HTTPUtilities_h
19
20 #include <dispatch/dispatch.h>
21 #include <nw/private.h>
22
23 CFStringRef
24 create_base64_string(dispatch_data_t message);
25
26 void
27 http_set_resolver_queue(dispatch_queue_t queue);
28
29 typedef void (^http_task_dns_query_response_handler_t)(dispatch_data_t data, CFErrorRef error);
30
31 void *
32 http_task_create_dns_query(nw_endpoint_t endpoint,
33 const char *url_string,
34 dispatch_data_t message,
35 uint16_t query_type,
36 bool use_post,
37 http_task_dns_query_response_handler_t response_handler);
38
39 void *
40 http_task_create_pvd_query(dispatch_queue_t queue,
41 const char *host,
42 const char *path,
43 void (^response_handler)(xpc_object_t json_object));
44
45 void
46 http_task_start(void *task);
47
48 void
49 http_task_cancel(void *task);
50
51 #endif // __HTTPUtilities_h