resolver.txt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. Linux FreeBSD Solaris Cygwin
  2. gethostbyname y y y y
  3. gethostbyname_r n n y -
  4. gethostbyname2 y y y(*) -
  5. getaddrinfo y y y -
  6. res_search (res_*) y y y -
  7. Linux, Solaris, Cygwin:
  8. struct sockaddr_in{
  9. sa_family_t sin_family;
  10. in_port_t sin_port;
  11. struct in_addr sin_addr;
  12. /* ...*/
  13. };
  14. FreeBSD:
  15. struct sockaddr_in {
  16. u_char sin_len;
  17. u_char sin_family;
  18. u_short sin_port;
  19. struct in_addr sin_addr;
  20. char sin_zero[8];
  21. };
  22. Linux, Solaris, Cygwin:
  23. struct sockaddr_in6 {
  24. sa_family_t sin6_family;
  25. in_port_t sin6_port;
  26. uint32_t sin6_flowinfo;
  27. struct in6_addr sin6_addr;
  28. /*...*/
  29. };
  30. FreeBSD:
  31. struct sockaddr_in6 {
  32. u_int8_t sin6_len; /* length of this struct(sa_family_t)*/
  33. u_int8_t sin6_family; /* AF_INET6 (sa_family_t) */
  34. u_int16_t sin6_port; /* Transport layer port # (in_port_t)*/
  35. u_int32_t sin6_flowinfo; /* IP6 flow information */
  36. struct in6_addr sin6_addr; /* IP6 address */
  37. u_int32_t sin6_scope_id; /* intface scope id */
  38. };
  39. sockaddr_in sockaddr_in6
  40. Linux <netinet/in.h> or <linux/in.h> <netinet/in.h> or <linux/in6.h> (*)
  41. FreeBSD <netinet/in.h> <netinet6/in6.h>
  42. Solaris <netinet/in.h> <netinet/in.h>
  43. Cygwin <netinet/in.h> or <cywin/in.h> <netinet/in.h> or <cygwin/in.h>
  44. (*) - on linux netinet/in.h -> from GNU libc, linux/in*.h from the kernel.
  45. struct sockaddr:
  46. Linux:
  47. (sa_family_t= unsigned short)
  48. struct sockaddr {
  49. sa_family_t sa_family; /* address family, AF_xxx */
  50. char sa_data[14]; /* 14 bytes of protocol address */
  51. };
  52. FreeBSD:
  53. (sa_family_t = u_char)
  54. struct sockaddr {
  55. u_char sa_len; /* total length */
  56. sa_family_t sa_family; /* address family */
  57. char sa_data[14]; /* actually longer; address value */
  58. };