Tor  0.4.6.0-alpha-dev
Data Structures | Macros
dns_structs.h File Reference

Structures used in dns.c. Exposed to dns.c, and to the unit tests that declare DNS_PRIVATE. More...

#include "ext/ht.h"

Go to the source code of this file.

Data Structures

struct  pending_connection_t
 
struct  cached_resolve_t
 

Macros

#define MAX_ADDRESSLEN   256
 
#define CACHED_RESOLVE_MAGIC   0x1234F00D
 
#define CACHE_STATE_PENDING   0
 
#define CACHE_STATE_DONE   1
 
#define CACHE_STATE_CACHED   2
 
status values for a single DNS request.
#define RES_STATUS_INFLIGHT   1
 
#define RES_STATUS_DONE_OK   2
 
#define RES_STATUS_DONE_ERR   3
 

Detailed Description

Structures used in dns.c. Exposed to dns.c, and to the unit tests that declare DNS_PRIVATE.

Definition in file dns_structs.h.

Macro Definition Documentation

◆ CACHE_STATE_CACHED

#define CACHE_STATE_CACHED   2

We are caching an answer for this address. This should have no pending connections, and should appear in the hash table.

Definition at line 45 of file dns_structs.h.

◆ CACHE_STATE_DONE

#define CACHE_STATE_DONE   1

This used to be a pending cached_resolve_t, and we got an answer for it. Now we're waiting for this cached_resolve_t to expire. This should have no pending connections, and should not appear in the hash table.

Definition at line 42 of file dns_structs.h.

◆ CACHE_STATE_PENDING

#define CACHE_STATE_PENDING   0

We are waiting for the resolver system to tell us an answer here. When we get one, or when we time out, the state of this cached_resolve_t will become "DONE" and we'll possibly add a CACHED entry. This cached_resolve_t will be in the hash table so that we will know not to launch more requests for this addr, but rather to add more connections to the pending list for the addr.

Definition at line 38 of file dns_structs.h.

◆ CACHED_RESOLVE_MAGIC

#define CACHED_RESOLVE_MAGIC   0x1234F00D

Value of 'magic' field for cached_resolve_t. Used to try to catch bad pointers and memory stomping.

Definition at line 29 of file dns_structs.h.

◆ MAX_ADDRESSLEN

#define MAX_ADDRESSLEN   256

Longest hostname we're willing to resolve.

Definition at line 19 of file dns_structs.h.

◆ RES_STATUS_DONE_ERR

#define RES_STATUS_DONE_ERR   3

The DNS request finished and gave an error

Definition at line 55 of file dns_structs.h.

◆ RES_STATUS_DONE_OK

#define RES_STATUS_DONE_OK   2

The DNS request finished and gave an answer

Definition at line 53 of file dns_structs.h.

◆ RES_STATUS_INFLIGHT

#define RES_STATUS_INFLIGHT   1

The DNS request is in progress.

Definition at line 51 of file dns_structs.h.