Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /**
  2.  * This file has no copyright assigned and is placed in the Public Domain.
  3.  * This file is part of the w64 mingw-runtime package.
  4.  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5.  */
  6.  
  7. #ifndef _MINGW_IP_TYPES_H
  8. #define _MINGW_IP_TYPES_H
  9.  
  10. #include <_bsd_types.h>
  11.  
  12. #define h_addr h_addr_list[0]
  13.  
  14. struct hostent {
  15.         char    *h_name;
  16.         char    **h_aliases;
  17.         short   h_addrtype;
  18.         short   h_length;
  19.         char    **h_addr_list;
  20. };
  21.  
  22. struct netent {
  23.         char    *n_name;
  24.         char    **n_aliases;
  25.         short   n_addrtype;
  26.         u_long  n_net;
  27. };
  28.  
  29. struct servent {
  30.         char    *s_name;
  31.         char    **s_aliases;
  32. #ifdef _WIN64
  33.         char    *s_proto;
  34.         short   s_port;
  35. #else
  36.         short   s_port;
  37.         char    *s_proto;
  38. #endif
  39. };
  40.  
  41. struct protoent {
  42.         char    *p_name;
  43.         char    **p_aliases;
  44.         short   p_proto;
  45. };
  46.  
  47. typedef struct hostent          HOSTENT;
  48. typedef struct hostent          *PHOSTENT;
  49. typedef struct hostent          *LPHOSTENT;
  50.  
  51. typedef struct servent          SERVENT;
  52. typedef struct servent          *PSERVENT;
  53. typedef struct servent          *LPSERVENT;
  54.  
  55. typedef struct protoent         PROTOENT;
  56. typedef struct protoent         *PPROTOENT;
  57. typedef struct protoent         *LPPROTOENT;
  58.  
  59.  
  60. #include <inaddr.h>
  61.  
  62. struct sockaddr_in {
  63.         short   sin_family;
  64.         u_short sin_port;
  65.         struct in_addr  sin_addr;
  66.         char    sin_zero[8];
  67. };
  68.  
  69. struct sockaddr {
  70.         u_short sa_family;
  71.         char    sa_data[14];
  72. };
  73.  
  74. struct sockproto {
  75.         u_short sp_family;
  76.         u_short sp_protocol;
  77. };
  78.  
  79. struct linger {
  80.         u_short l_onoff;
  81.         u_short l_linger;
  82. };
  83.  
  84. typedef struct sockaddr         SOCKADDR;
  85. typedef struct sockaddr         *PSOCKADDR;
  86. typedef struct sockaddr         *LPSOCKADDR;
  87.  
  88. typedef struct sockaddr_in      SOCKADDR_IN;
  89. typedef struct sockaddr_in      *PSOCKADDR_IN;
  90. typedef struct sockaddr_in      *LPSOCKADDR_IN;
  91.  
  92. typedef struct linger           LINGER;
  93. typedef struct linger           *PLINGER;
  94. typedef struct linger           *LPLINGER;
  95.  
  96.  
  97. #include <_timeval.h>
  98.  
  99. typedef struct timeval          TIMEVAL;
  100. typedef struct timeval          *PTIMEVAL;
  101. typedef struct timeval          *LPTIMEVAL;
  102.  
  103. #endif  /* _MINGW_IP_TYPES_H */
  104.  
  105.