Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /**
6 * @section DNS APIS
7 * This module contains method definitions to be implemented by the platform.
8 * SIP Stack uses these methods to perform DNS queries
9 */
12 #ifndef _DNS_UTIL_H_
13 #define _DNS_UTIL_H_
15 #include "cc_constants.h"
16 #include "cpr_types.h"
18 /**
19 * Defines the return values for DNS query.
20 */
21 #define CC_DNS_OK 0
22 #define CC_DNS_ERR_NOBUF 1
23 #define CC_DNS_ERR_INUSE 2
24 #define CC_DNS_ERR_TIMEOUT 3
25 #define CC_DNS_ERR_NOHOST 4
26 #define CC_DNS_ERR_HOST_UNAVAIL 5
28 typedef void *srv_handle_t;
30 /**
31 * Perform an DNS lookup of the name specified
32 *
33 * @param[in] hname host name
34 * @param[out] ipaddr_ptr the ip address returned by DNS for host with name hname.
35 * @param[in] timeout the timeout for the query
36 * @param[in] retries the retry times for the query
37 *
38 * @return CC_DNS_OK or CC_DNS_ERR_NOHOST
39 */
40 cc_int32_t dnsGetHostByName(const char *hname,
41 cpr_ip_addr_t *ipaddr_ptr,
42 cc_int32_t timeout,
43 cc_int32_t retries);
45 /**
46 * This function calls the dns api to perform a dns srv query.
47 *
48 * @param[in] service the service name, e.g. "sip"
49 * @param[in] protocol the protocol name, e.g. "udp"
50 * @param[in] domain the domain name
51 * @param[out] ipaddr_ptr the returned ip address
52 * @param[out] port the port
53 * @param[in] timeout the timeout for the query
54 * @param[in] retries the number of retries for the query
55 * @param[in,out] psrv_handle the handle for this query
56 *
57 * @note if handle is NULL an new query needs to be made and the
58 * first response needs to be returned along with a valid handle.
59 * Subsequent calls should return the next result if a valid handle has been provided.
60 *
61 * @returns CC_DNS_OK for success or
62 * CC_DNS_ERR_NOHOST, CC_DNS_ERR_HOST_UNAVAIL
63 */
64 cc_int32_t dnsGetHostBySRV(cc_int8_t *service,
65 cc_int8_t *protocol,
66 cc_int8_t *domain,
67 cpr_ip_addr_t *ipaddr_ptr,
68 cc_uint16_t *port,
69 cc_int32_t timeout,
70 cc_int32_t retries,
71 srv_handle_t *psrv_handle);
73 /**
74 * Free the srvhandle allocated in dnsGetHostBySRV.
75 *
76 * @param[in] srv_handle handle to be freed.
77 *
78 */
80 void dnsFreeSrvHandle(srv_handle_t srv_handle);
82 #endif /* _DNS_UTIL_H_ */