1 /* Copyright (c) 2001 Matej Pfajfar.
2 * Copyright (c) 2001-2004, Roger Dingledine.
3 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4 * Copyright (c) 2007-2016, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
9 * \brief Header file for dns.c.
16 int has_dns_init_failed(void);
17 void dns_free_all(void);
18 uint32_t dns_clip_ttl(uint32_t ttl
);
20 void connection_dns_remove(edge_connection_t
*conn
);
21 void assert_connection_edge_not_dns_pending(edge_connection_t
*conn
);
22 void assert_all_pending_dns_resolves_ok(void);
23 MOCK_DECL(void,dns_cancel_pending_resolve
,(const char *question
));
24 int dns_resolve(edge_connection_t
*exitconn
);
25 void dns_launch_correctness_checks(void);
26 int dns_seems_to_be_broken(void);
27 int dns_seems_to_be_broken_for_ipv6(void);
28 void dns_reset_correctness_checks(void);
29 void dump_dns_mem_usage(int severity
);
32 #include "dns_structs.h"
34 STATIC
uint32_t dns_get_expiry_ttl(uint32_t ttl
);
36 MOCK_DECL(STATIC
int,dns_resolve_impl
,(edge_connection_t
*exitconn
,
37 int is_resolve
,or_circuit_t
*oncirc
, char **hostname_out
,
38 int *made_connection_pending_out
, cached_resolve_t
**resolve_out
));
40 MOCK_DECL(STATIC
void,send_resolved_cell
,(edge_connection_t
*conn
,
41 uint8_t answer_type
,const cached_resolve_t
*resolved
));
43 MOCK_DECL(STATIC
void,send_resolved_hostname_cell
,(edge_connection_t
*conn
,
44 const char *hostname
));
46 cached_resolve_t
*dns_get_cache_entry(cached_resolve_t
*query
);
47 void dns_insert_cache_entry(cached_resolve_t
*new_entry
);
50 set_exitconn_info_from_resolve
,(edge_connection_t
*exitconn
,
51 const cached_resolve_t
*resolve
,
52 char **hostname_out
));
55 launch_resolve
,(cached_resolve_t
*resolve
));