tor  master
Public Member Functions | Data Fields
cached_resolve_t Struct Reference

#include <dns_structs.h>

Collaboration diagram for cached_resolve_t:
Collaboration graph
[legend]

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.

Field Documentation

◆ addr_ipv4

uint32_t addr_ipv4

IPv4 addr for address, if successful. (In host order.)

◆ addr_ipv6

struct in6_addr addr_ipv6

IPv6 addr for address, if successful

◆ address

char address[MAX_ADDRESSLEN]

The hostname to be resolved.

◆ err_hostname

int err_hostname

A hostname, if PTR lookup happened successfully

◆ err_ipv4

int err_ipv4

One of DNS_ERR_*, if IPv4 lookup failed.

◆ err_ipv6

int err_ipv6

One of DNS_ERR_*, if IPv6 lookup failed.

◆ expire

time_t expire

Remove items from cache after this time.

◆ magic

uint32_t magic

Must be CACHED_RESOLVE_MAGIC

◆ minheap_idx

int minheap_idx

Position of this element in the heap

◆ pending_connections

pending_connection_t* pending_connections

Connections that want to know when we get an answer for this resolve.

◆ result_ipv4

union { ... } result_ipv4

Outcome of IPv4 lookup

◆ result_ipv6

union { ... } result_ipv6

Outcome of IPv6 lookup, if any

◆ state

uint8_t state

Is this cached entry pending/done/informative?

◆ ttl_hostname

uint32_t ttl_hostname

What TTL did the nameserver tell us?

◆ ttl_ipv4

uint32_t ttl_ipv4

What TTL did the nameserver tell us?

◆ ttl_ipv6

uint32_t ttl_ipv6

What TTL did the nameserver tell us?


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