123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #ifndef TOR_DNS_STRUCTS_H
- #define TOR_DNS_STRUCTS_H
- #define MAX_ADDRESSLEN 256
- typedef struct pending_connection_t {
- edge_connection_t *conn;
- struct pending_connection_t *next;
- } pending_connection_t;
- #define CACHED_RESOLVE_MAGIC 0x1234F00D
- #define CACHE_STATE_PENDING 0
- #define CACHE_STATE_DONE 1
- #define CACHE_STATE_CACHED 2
- #define RES_STATUS_INFLIGHT 1
- #define RES_STATUS_DONE_OK 2
- #define RES_STATUS_DONE_ERR 3
- typedef struct cached_resolve_t {
- HT_ENTRY(cached_resolve_t) node;
- 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;
-
- unsigned int res_status_ipv4 : 2;
- unsigned int res_status_ipv6 : 2;
- unsigned int res_status_hostname : 2;
-
- 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;
- } cached_resolve_t;
- #endif
|