dns_server.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _DNS_SERVER_H_
  13. #define _DNS_SERVER_H_
  14. #include "lwip/dns.h"
  15. /* register callback funtion */
  16. typedef void (*dns_server_found_callback)(struct pbuf *p, void *callback_arg);
  17. enum
  18. {
  19. ERR_DNS_PACKAGE = -17,
  20. ERR_CACHE_NUM = -18,
  21. ERR_DOMAIN = -19
  22. };
  23. /**
  24. * ///Nonblock function///
  25. * Receive dns requst by RNDIS, it will call lwip dns to get ipaddr, when revice dns answer package
  26. * it will call callback function to write back the dns answer package.
  27. * p: input pbuf.
  28. * callback: input callback function.
  29. * callbackarg: input param for callback.
  30. * return: ERR_LOCAL_OK /Find the ipaddr in local cache, callback will be called immediately
  31. * ERR_INPROGRESS /Requst ipaddr from remote server. Waiting for callback
  32. * other error message.
  33. */
  34. err_t dnsServer_gethostbyname(struct pbuf *p, dns_server_found_callback callback, void *callbackarg);
  35. #endif