/* Minimal DNS resolver (A records over UDP, RFC 1035): see dns.c. */ #ifndef DNS_H #define DNS_H /* Resolve `name` to an IPv4 address with a recursive query to the configured * resolver (DHCP option 6, else the gateway). Prints a `dns:` line. * Returns 0 on success. A raw owner polls the NIC directly; stack users are * driven by net_pump(). */ int dns_resolve(const char *name, unsigned char ip[4]); /* Feed one received frame to the pending stack-mode query. Returns 1 when it * was a reply to that query (consumed), 0 otherwise. Called by net_pump(). */ int dns_input(const unsigned char *frame, unsigned int len); /* Called by the reaper when a resolver process dies. */ void dns_reap(unsigned int pid); /* `netdns [a.b.c.d]` (show/set the resolver) and `host `. */ void program_netdns_main(const char *arg); void program_host_main(const char *arg); #endif