Contiki-NG
|
The uIP DNS resolver functions are used to lookup a hostname and map it to a numerical IP address. More...
Macros | |
#define | RESOLV_CONF_MAX_RETRIES 4 |
The maximum number of retries when asking for a name. More... | |
Functions | |
static void | newdata (void) |
void | resolv_set_hostname (const char *hostname) |
Changes the local hostname advertised by MDNS. More... | |
const char * | resolv_get_hostname (void) |
Returns the local hostname being advertised via MDNS. More... | |
void | resolv_query (const char *name) |
Queues a name so that a question for the name will be sent out. More... | |
resolv_status_t | resolv_lookup (const char *name, uip_ipaddr_t **ipaddr) |
Look up a hostname in the array of known hostnames. More... | |
Variables | |
process_event_t | resolv_event_found |
Event that is broadcasted when a DNS name has been resolved. | |
The uIP DNS resolver functions are used to lookup a hostname and map it to a numerical IP address.
It maintains a list of resolved hostnames that can be queried with the resolv_lookup() function. New hostnames can be resolved using the resolv_query() function.
The event resolv_event_found is posted when a hostname has been resolved. It is up to the receiving process to determine if the correct hostname has been found by calling the resolv_lookup() function with the hostname.
#define RESOLV_CONF_MAX_RETRIES 4 |
|
static |
QUESTION HANDLING SECTION
ANSWER HANDLING SECTION
Definition at line 754 of file resolv.c.
References CLOCK_SECOND, clock_seconds(), process_post(), uip_appdata, UIP_HTONS, uip_htons(), and uip_ipaddr_copy.
Referenced by resolv_get_hostname().
const char* resolv_get_hostname | ( | void | ) |
Returns the local hostname being advertised via MDNS.
Definition at line 1077 of file resolv.c.
References CLOCK_SECOND, etimer_set(), newdata(), process_alloc_event(), PROCESS_BEGIN, PROCESS_END, process_start(), PROCESS_THREAD(), PROCESS_WAIT_EVENT, PROCESS_WAIT_EVENT_UNTIL, random_rand(), resolv_event_found, resolv_query(), resolv_set_hostname(), tcpip_event, tcpip_poll_udp(), udp_new(), uip_appdata, UIP_HTONS, uip_newdata, uip_poll, and uip_udp_bind.
resolv_status_t resolv_lookup | ( | const char * | name, |
uip_ipaddr_t ** | ipaddr | ||
) |
Look up a hostname in the array of known hostnames.
Definition at line 1312 of file resolv.c.
References addr, CLOCK_SECOND, clock_seconds(), ipaddr, process_post(), resolv_event_found, RESOLV_STATUS_CACHED, RESOLV_STATUS_EXPIRED, RESOLV_STATUS_NOT_FOUND, RESOLV_STATUS_RESOLVING, RESOLV_STATUS_UNCACHED, uip_lladdr, and UIP_LLADDR_LEN.
void resolv_query | ( | const char * | name | ) |
Queues a name so that a question for the name will be sent out.
name | The hostname that is to be queried. |
Definition at line 1233 of file resolv.c.
References clock_seconds(), and process_post().
Referenced by resolv_get_hostname().
void resolv_set_hostname | ( | const char * | hostname | ) |
Changes the local hostname advertised by MDNS.
hostname | The new hostname to advertise. |
Definition at line 1057 of file resolv.c.
Referenced by resolv_get_hostname().