tor  0.4.1.0-alpha-dev
Functions
dnsserv.h File Reference

Go to the source code of this file.

Functions

void dnsserv_configure_listener (connection_t *conn)
 
void dnsserv_close_listener (connection_t *conn)
 
void dnsserv_resolved (entry_connection_t *conn, int answer_type, size_t answer_len, const char *answer, int ttl)
 
void dnsserv_reject_request (entry_connection_t *conn)
 
int dnsserv_launch_request (const char *name, int is_reverse, control_connection_t *control_conn)
 

Detailed Description

Header file for dnsserv.c.

Definition in file dnsserv.h.

Function Documentation

◆ dnsserv_close_listener()

void dnsserv_close_listener ( connection_t conn)

Free the evdns server port for conn, which must be an AP_DNS_LISTENER.

Definition at line 407 of file dnsserv.c.

References CONN_TYPE_AP_DNS_LISTENER, listener_connection_t::dns_server_port, TO_LISTENER_CONN(), tor_assert(), and connection_t::type.

◆ dnsserv_configure_listener()

void dnsserv_configure_listener ( connection_t conn)

Set up the evdns server port for the UDP socket on conn, which must be an AP_DNS_LISTENER

Definition at line 391 of file dnsserv.c.

References CONN_TYPE_AP_DNS_LISTENER, listener_connection_t::dns_server_port, connection_t::s, SOCKET_OK, TO_LISTENER_CONN(), tor_assert(), and connection_t::type.

◆ dnsserv_launch_request()

int dnsserv_launch_request ( const char *  name,
int  reverse,
control_connection_t control_conn 
)

Helper function: called whenever the client sends a resolve request to our controller. We need to eventually answer the request req. Returns 0 if the controller will be getting (or has gotten) an event in response; -1 if we couldn't launch the request.

Definition at line 210 of file dnsserv.c.

◆ dnsserv_reject_request()

void dnsserv_reject_request ( entry_connection_t conn)

If there is a pending request on conn that's waiting for an answer, send back an error and free the request.

Definition at line 289 of file dnsserv.c.

References entry_connection_t::dns_server_request.

◆ dnsserv_resolved()

void dnsserv_resolved ( entry_connection_t conn,
int  answer_type,
size_t  answer_len,
const char *  answer,
int  ttl 
)

Tell the dns request waiting for an answer on conn that we have an answer of type answer_type (RESOLVE_TYPE_IPV4/IPV6/ERR), of length answer_len, in answer, with TTL ttl. Doesn't do any caching; that's handled elsewhere.

Definition at line 339 of file dnsserv.c.

References entry_connection_t::dns_server_request.