/include/openenclave/internal/syscall/netdb.h

https://github.com/Microsoft/openenclave · C Header · 67 lines · 54 code · 11 blank · 2 comment · 0 complexity · 6888a9d86dd003b53b5f6fd4b1810057 MD5 · raw file

  1. // Copyright (c) Open Enclave SDK contributors.
  2. // Licensed under the MIT License.
  3. #ifndef _OE_SYSCALL_NETDB_H_
  4. #define _OE_SYSCALL_NETDB_H_
  5. #include <openenclave/internal/bits/socket.h>
  6. #include <openenclave/internal/syscall/sys/socket.h>
  7. OE_EXTERNC_BEGIN
  8. #define OE_AI_PASSIVE 0x01
  9. #define OE_AI_CANONNAME 0x02
  10. #define OE_AI_NUMERICHOST 0x04
  11. #define OE_AI_V4MAPPED 0x08
  12. #define OE_AI_ALL 0x10
  13. #define OE_AI_ADDRCONFIG 0x20
  14. #define OE_AI_NUMERICSERV 0x400
  15. #define OE_NI_NUMERICHOST 0x01
  16. #define OE_NI_NUMERICSERV 0x02
  17. #define OE_NI_NOFQDN 0x04
  18. #define OE_NI_NAMEREQD 0x08
  19. #define OE_NI_DGRAM 0x10
  20. #define OE_NI_NUMERICSCOPE 0x100
  21. #define OE_EAI_BADFLAGS -1
  22. #define OE_EAI_NONAME -2
  23. #define OE_EAI_AGAIN -3
  24. #define OE_EAI_FAIL -4
  25. #define OE_EAI_FAMILY -6
  26. #define OE_EAI_SOCKTYPE -7
  27. #define OE_EAI_SERVICE -8
  28. #define OE_EAI_MEMORY -10
  29. #define OE_EAI_SYSTEM -11
  30. #define OE_EAI_OVERFLOW -12
  31. #define OE_EAI_NODATA -5
  32. #define OE_EAI_ADDRFAMILY -9
  33. #define OE_EAI_INPROGRESS -100
  34. #define OE_EAI_CANCELED -101
  35. #define OE_EAI_NOTCANCELED -102
  36. #define OE_EAI_ALLDONE -103
  37. #define OE_EAI_INTR -104
  38. #define OE_EAI_IDN_ENCODE -105
  39. #define OE_NI_MAXHOST 255
  40. #define OE_NI_MAXSERV 32
  41. int oe_getaddrinfo(
  42. const char* node,
  43. const char* service,
  44. const struct oe_addrinfo* hints,
  45. struct oe_addrinfo** res);
  46. void oe_freeaddrinfo(struct oe_addrinfo* res);
  47. int oe_getnameinfo(
  48. const struct oe_sockaddr* sa,
  49. oe_socklen_t salen,
  50. char* host,
  51. oe_socklen_t hostlen,
  52. char* serv,
  53. oe_socklen_t servlen,
  54. int flags);
  55. OE_EXTERNC_END
  56. #endif /* netinet/netdb.h */