Tor  0.4.7.0-alpha-dev
Public Member Functions | Data Fields
cached_resolve_t Struct Reference

#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_tpending_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
 

Detailed Description

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.

Field Documentation

◆ addr_ipv4

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().

◆ addr_ipv6

struct in6_addr addr_ipv6

IPv6 addr for address, if successful

Definition at line 70 of file dns_structs.h.

◆ address

char address[MAX_ADDRESSLEN]

The hostname to be resolved.

Definition at line 65 of file dns_structs.h.

Referenced by assert_resolve_ok(), cached_resolve_hash(), and HT_HEAD().

◆ err_hostname

int err_hostname

A hostname, if PTR lookup happened successfully

Definition at line 79 of file dns_structs.h.

◆ err_ipv4

int err_ipv4

One of DNS_ERR_*, if IPv4 lookup failed.

Definition at line 70 of file dns_structs.h.

◆ err_ipv6

int err_ipv6

One of DNS_ERR_*, if IPv6 lookup failed.

Definition at line 75 of file dns_structs.h.

◆ expire

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_(), and set_expiry().

◆ magic

uint32_t magic

Must be CACHED_RESOLVE_MAGIC

Definition at line 64 of file dns_structs.h.

Referenced by assert_resolve_ok(), and free_cached_resolve_().

◆ minheap_idx

int minheap_idx

Position of this element in the heap

Definition at line 100 of file dns_structs.h.

◆ pending_connections

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_resolve_ok(), free_cached_resolve_(), and inform_pending_connections().

◆ 

union { ... } result_ipv4

Outcome of IPv4 lookup

Referenced by assert_resolve_ok().

◆ 

union { ... } result_ipv6

Outcome of IPv6 lookup, if any

◆ state

uint8_t state

Is this cached entry pending/done/informative?

Definition at line 91 of file dns_structs.h.

Referenced by assert_resolve_ok(), and make_pending_resolve_cached().

◆ ttl_hostname

uint32_t ttl_hostname

What TTL did the nameserver tell us?

Definition at line 96 of file dns_structs.h.

Referenced by set_exitconn_info_from_resolve().

◆ ttl_ipv4

uint32_t ttl_ipv4

What TTL did the nameserver tell us?

Definition at line 94 of file dns_structs.h.

◆ ttl_ipv6

uint32_t ttl_ipv6

What TTL did the nameserver tell us?

Definition at line 95 of file dns_structs.h.


The documentation for this struct was generated from the following file: