Tor 0.4.9.3-alpha-dev
|
#include <dns_structs.h>
Public Member Functions | |
HT_ENTRY (cached_resolve_t) node | |
Data Fields | ||
uint32_t | magic | |
char | address [MAX_ADDRESSLEN] | |
union { | ||
uint32_t addr_ipv4 | ||
int err_ipv4 | ||
} | result_ipv4 | |
union { | ||
struct in6_addr addr_ipv6 | ||
int err_ipv6 | ||
} | result_ipv6 | |
union { | ||
char * hostname | ||
int err_hostname | ||
} | result_ptr | |
uint8_t | state | |
time_t | expire | |
uint32_t | ttl_ipv4 | |
uint32_t | ttl_ipv6 | |
uint32_t | ttl_hostname | |
pending_connection_t * | pending_connections | |
int | minheap_idx | |
Status fields | ||
These take one of the RES_STATUS_* values, depending on the state of the corresponding lookup. | ||
unsigned int | res_status_ipv4: 2 | |
unsigned int | res_status_ipv6: 2 | |
unsigned int | res_status_hostname: 2 | |
A DNS request: possibly completed, possibly pending; cached_resolve structs are stored at the OR side in a hash table, and as a linked list from oldest to newest.
Definition at line 62 of file dns_structs.h.
uint32_t addr_ipv4 |
IPv4 addr for address, if successful. (In host order.)
Definition at line 68 of file dns_structs.h.
Referenced by assert_resolve_ok(), send_resolved_cell(), and set_exitconn_info_from_resolve().
struct in6_addr addr_ipv6 |
IPv6 addr for address, if successful
Definition at line 73 of file dns_structs.h.
Referenced by send_resolved_cell(), and set_exitconn_info_from_resolve().
char address[MAX_ADDRESSLEN] |
The hostname to be resolved.
Definition at line 65 of file dns_structs.h.
Referenced by assert_connection_edge_not_dns_pending(), assert_resolve_ok(), cached_resolve_hash(), connection_dns_remove(), dns_cancel_pending_resolve(), dns_found_answer(), dns_resolve_impl(), HT_HEAD(), launch_resolve(), make_pending_resolve_cached(), and purge_expired_resolves().
int err_hostname |
A hostname, if PTR lookup happened successfully
Definition at line 79 of file dns_structs.h.
int err_ipv4 |
One of DNS_ERR_*, if IPv4 lookup failed.
Definition at line 70 of file dns_structs.h.
Referenced by set_exitconn_info_from_resolve().
int err_ipv6 |
One of DNS_ERR_*, if IPv6 lookup failed.
Definition at line 75 of file dns_structs.h.
Referenced by set_exitconn_info_from_resolve().
time_t expire |
Remove items from cache after this time.
Definition at line 93 of file dns_structs.h.
Referenced by compare_cached_resolves_by_expiry_(), dns_resolve_impl(), make_pending_resolve_cached(), purge_expired_resolves(), and set_expiry().
char* hostname |
Definition at line 78 of file dns_structs.h.
uint32_t magic |
Must be CACHED_RESOLVE_MAGIC
Definition at line 64 of file dns_structs.h.
Referenced by assert_resolve_ok(), dns_resolve_impl(), free_cached_resolve_(), and purge_expired_resolves().
int minheap_idx |
Position of this element in the heap
Definition at line 100 of file dns_structs.h.
Referenced by dns_resolve_impl().
pending_connection_t* pending_connections |
Connections that want to know when we get an answer for this resolve.
Definition at line 98 of file dns_structs.h.
Referenced by assert_connection_edge_not_dns_pending(), assert_resolve_ok(), connection_dns_remove(), dns_cancel_pending_resolve(), dns_found_answer(), dns_resolve_impl(), free_cached_resolve_(), inform_pending_connections(), and purge_expired_resolves().
unsigned int res_status_hostname |
Definition at line 89 of file dns_structs.h.
unsigned int res_status_ipv4 |
Definition at line 87 of file dns_structs.h.
unsigned int res_status_ipv6 |
Definition at line 88 of file dns_structs.h.
union { ... } result_ipv4 |
Outcome of IPv4 lookup
Referenced by assert_resolve_ok(), send_resolved_cell(), and set_exitconn_info_from_resolve().
union { ... } result_ipv6 |
Outcome of IPv6 lookup, if any
Referenced by send_resolved_cell(), and set_exitconn_info_from_resolve().
uint8_t state |
Is this cached entry pending/done/informative?
Definition at line 91 of file dns_structs.h.
Referenced by assert_resolve_ok(), dns_cancel_pending_resolve(), dns_found_answer(), dns_resolve_impl(), make_pending_resolve_cached(), and purge_expired_resolves().
uint32_t ttl_hostname |
What TTL did the nameserver tell us?
Definition at line 96 of file dns_structs.h.
Referenced by make_pending_resolve_cached(), and set_exitconn_info_from_resolve().
uint32_t ttl_ipv4 |
What TTL did the nameserver tell us?
Definition at line 94 of file dns_structs.h.
Referenced by make_pending_resolve_cached(), and set_exitconn_info_from_resolve().
uint32_t ttl_ipv6 |
What TTL did the nameserver tell us?
Definition at line 95 of file dns_structs.h.
Referenced by make_pending_resolve_cached(), and set_exitconn_info_from_resolve().