dns.h 539 B

1234567891011121314
  1. /* Minimal DNS resolver (A records over UDP, RFC 1035): see dns.c. */
  2. #ifndef DNS_H
  3. #define DNS_H
  4. /* Resolve `name` to an IPv4 address with a recursive query to the configured
  5. * resolver (DHCP option 6, else the gateway). Prints a `dns:` line.
  6. * Returns 0 on success. The caller must own the NIC (netdev_acquire). */
  7. int dns_resolve(const char *name, unsigned char ip[4]);
  8. /* `netdns [a.b.c.d]` (show/set the resolver) and `host <name>`. */
  9. void program_netdns_main(const char *arg);
  10. void program_host_main(const char *arg);
  11. #endif