Data Structures | Macros | Typedefs
dns_structs.h File Reference

Go to the source code of this file.

Data Structures

struct  pending_connection_t
struct  cached_resolve_t


#define MAX_ADDRESSLEN   256
#define CACHED_RESOLVE_MAGIC   0x1234F00D
#define CACHE_STATE_DONE   1
status values for a single DNS request.
#define RES_STATUS_DONE_OK   2


typedef struct pending_connection_t pending_connection_t
typedef struct cached_resolve_t cached_resolve_t

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



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

Definition at line 43 of file dns_structs.h.


#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 40 of file dns_structs.h.



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 36 of file dns_structs.h.


#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 27 of file dns_structs.h.


#define MAX_ADDRESSLEN   256

Longest hostname we're willing to resolve.

Definition at line 17 of file dns_structs.h.



The DNS request finished and gave an error

Definition at line 53 of file dns_structs.h.


#define RES_STATUS_DONE_OK   2

The DNS request finished and gave an answer

Definition at line 51 of file dns_structs.h.



The DNS request is in progress.

Definition at line 49 of file dns_structs.h.

Typedef Documentation

◆ cached_resolve_t

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.

◆ pending_connection_t

Linked list of connections waiting for a DNS answer.