dns.h 792 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Masami Komiya <mkomiya@sonare.it> 2005
  4. * Copyright 2009, Robin Getz <rgetz@blackfin.uclinux.org>
  5. */
  6. #ifndef __DNS_H__
  7. #define __DNS_H__
  8. #define DNS_SERVICE_PORT 53
  9. #define DNS_TIMEOUT 10000UL
  10. /* http://en.wikipedia.org/wiki/List_of_DNS_record_types */
  11. enum dns_query_type {
  12. DNS_A_RECORD = 0x01,
  13. DNS_CNAME_RECORD = 0x05,
  14. DNS_MX_RECORD = 0x0f,
  15. };
  16. /*
  17. * DNS network packet
  18. */
  19. struct header {
  20. uint16_t tid; /* Transaction ID */
  21. uint16_t flags; /* Flags */
  22. uint16_t nqueries; /* Questions */
  23. uint16_t nanswers; /* Answers */
  24. uint16_t nauth; /* Authority PRs */
  25. uint16_t nother; /* Other PRs */
  26. unsigned char data[1]; /* Data, variable length */
  27. } __attribute__((packed));
  28. void dns_start(void); /* Begin DNS */
  29. #endif