/Lib/plat-beos5/IN.py

http://unladen-swallow.googlecode.com/ · Python · 327 lines · 240 code · 69 blank · 18 comment · 0 complexity · 80a17b6e220f8d4468df8842901e30b0 MD5 · raw file

  1. # Generated by h2py from /boot/develop/headers/be/net/netinet/in.h
  2. # Included from socket.h
  3. # Included from BeBuild.h
  4. B_BEOS_VERSION_4 = 0x0400
  5. B_BEOS_VERSION_4_5 = 0x0450
  6. B_BEOS_VERSION_5 = 0x0500
  7. B_BEOS_VERSION = B_BEOS_VERSION_5
  8. B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5
  9. _PR2_COMPATIBLE_ = 1
  10. _PR3_COMPATIBLE_ = 1
  11. _R4_COMPATIBLE_ = 1
  12. _R4_5_COMPATIBLE_ = 1
  13. _PR2_COMPATIBLE_ = 0
  14. _PR3_COMPATIBLE_ = 0
  15. _R4_COMPATIBLE_ = 1
  16. _R4_5_COMPATIBLE_ = 1
  17. def _UNUSED(x): return x
  18. # Included from sys/types.h
  19. # Included from time.h
  20. # Included from be_setup.h
  21. def __std(ref): return ref
  22. __be_os = 2
  23. __dest_os = __be_os
  24. __MSL__ = 0x4011
  25. __GLIBC__ = -2
  26. __GLIBC_MINOR__ = 1
  27. # Included from null.h
  28. NULL = (0)
  29. NULL = 0L
  30. # Included from size_t.h
  31. # Included from stddef.h
  32. # Included from wchar_t.h
  33. CLOCKS_PER_SEC = 1000
  34. CLK_TCK = CLOCKS_PER_SEC
  35. MAX_TIMESTR = 70
  36. # Included from sys/time.h
  37. # Included from ByteOrder.h
  38. # Included from endian.h
  39. __LITTLE_ENDIAN = 1234
  40. LITTLE_ENDIAN = __LITTLE_ENDIAN
  41. __BYTE_ORDER = __LITTLE_ENDIAN
  42. BYTE_ORDER = __BYTE_ORDER
  43. __BIG_ENDIAN = 0
  44. BIG_ENDIAN = 0
  45. __BIG_ENDIAN = 4321
  46. BIG_ENDIAN = __BIG_ENDIAN
  47. __BYTE_ORDER = __BIG_ENDIAN
  48. BYTE_ORDER = __BYTE_ORDER
  49. __LITTLE_ENDIAN = 0
  50. LITTLE_ENDIAN = 0
  51. __PDP_ENDIAN = 3412
  52. PDP_ENDIAN = __PDP_ENDIAN
  53. # Included from SupportDefs.h
  54. # Included from Errors.h
  55. # Included from limits.h
  56. # Included from float.h
  57. FLT_ROUNDS = 1
  58. FLT_RADIX = 2
  59. FLT_MANT_DIG = 24
  60. FLT_DIG = 6
  61. FLT_MIN_EXP = (-125)
  62. FLT_MIN_10_EXP = (-37)
  63. FLT_MAX_EXP = 128
  64. FLT_MAX_10_EXP = 38
  65. DBL_MANT_DIG = 53
  66. DBL_DIG = 15
  67. DBL_MIN_EXP = (-1021)
  68. DBL_MIN_10_EXP = (-308)
  69. DBL_MAX_EXP = 1024
  70. DBL_MAX_10_EXP = 308
  71. LDBL_MANT_DIG = DBL_MANT_DIG
  72. LDBL_DIG = DBL_DIG
  73. LDBL_MIN_EXP = DBL_MIN_EXP
  74. LDBL_MIN_10_EXP = DBL_MIN_10_EXP
  75. LDBL_MAX_EXP = DBL_MAX_EXP
  76. LDBL_MAX_10_EXP = DBL_MAX_10_EXP
  77. CHAR_BIT = (8)
  78. SCHAR_MIN = (-127-1)
  79. SCHAR_MAX = (127)
  80. CHAR_MIN = SCHAR_MIN
  81. CHAR_MAX = SCHAR_MAX
  82. MB_LEN_MAX = (1)
  83. SHRT_MIN = (-32767-1)
  84. SHRT_MAX = (32767)
  85. LONG_MIN = (-2147483647L-1)
  86. LONG_MAX = (2147483647L)
  87. INT_MIN = LONG_MIN
  88. INT_MAX = LONG_MAX
  89. ARG_MAX = (32768)
  90. ATEXIT_MAX = (32)
  91. CHILD_MAX = (1024)
  92. IOV_MAX = (256)
  93. FILESIZEBITS = (64)
  94. LINK_MAX = (1)
  95. LOGIN_NAME_MAX = (32)
  96. MAX_CANON = (255)
  97. MAX_INPUT = (255)
  98. NAME_MAX = (256)
  99. NGROUPS_MAX = (32)
  100. OPEN_MAX = (128)
  101. PATH_MAX = (1024)
  102. PIPE_MAX = (512)
  103. SSIZE_MAX = (2147483647L)
  104. TTY_NAME_MAX = (256)
  105. TZNAME_MAX = (32)
  106. SYMLINKS_MAX = (16)
  107. _POSIX_ARG_MAX = (32768)
  108. _POSIX_CHILD_MAX = (1024)
  109. _POSIX_LINK_MAX = (1)
  110. _POSIX_LOGIN_NAME_MAX = (9)
  111. _POSIX_MAX_CANON = (255)
  112. _POSIX_MAX_INPUT = (255)
  113. _POSIX_NAME_MAX = (255)
  114. _POSIX_NGROUPS_MAX = (0)
  115. _POSIX_OPEN_MAX = (128)
  116. _POSIX_PATH_MAX = (1024)
  117. _POSIX_PIPE_BUF = (512)
  118. _POSIX_SSIZE_MAX = (2147483647L)
  119. _POSIX_STREAM_MAX = (8)
  120. _POSIX_TTY_NAME_MAX = (256)
  121. _POSIX_TZNAME_MAX = (3)
  122. B_GENERAL_ERROR_BASE = LONG_MIN
  123. B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000
  124. B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000
  125. B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000
  126. B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000
  127. B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800
  128. B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000
  129. B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000
  130. B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000
  131. B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000
  132. B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000
  133. B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000
  134. B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff)
  135. E2BIG = (B_POSIX_ERROR_BASE + 1)
  136. ECHILD = (B_POSIX_ERROR_BASE + 2)
  137. EDEADLK = (B_POSIX_ERROR_BASE + 3)
  138. EFBIG = (B_POSIX_ERROR_BASE + 4)
  139. EMLINK = (B_POSIX_ERROR_BASE + 5)
  140. ENFILE = (B_POSIX_ERROR_BASE + 6)
  141. ENODEV = (B_POSIX_ERROR_BASE + 7)
  142. ENOLCK = (B_POSIX_ERROR_BASE + 8)
  143. ENOSYS = (B_POSIX_ERROR_BASE + 9)
  144. ENOTTY = (B_POSIX_ERROR_BASE + 10)
  145. ENXIO = (B_POSIX_ERROR_BASE + 11)
  146. ESPIPE = (B_POSIX_ERROR_BASE + 12)
  147. ESRCH = (B_POSIX_ERROR_BASE + 13)
  148. EFPOS = (B_POSIX_ERROR_BASE + 14)
  149. ESIGPARM = (B_POSIX_ERROR_BASE + 15)
  150. EDOM = (B_POSIX_ERROR_BASE + 16)
  151. ERANGE = (B_POSIX_ERROR_BASE + 17)
  152. EPROTOTYPE = (B_POSIX_ERROR_BASE + 18)
  153. EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19)
  154. EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20)
  155. EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21)
  156. EADDRINUSE = (B_POSIX_ERROR_BASE + 22)
  157. EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23)
  158. ENETDOWN = (B_POSIX_ERROR_BASE + 24)
  159. ENETUNREACH = (B_POSIX_ERROR_BASE + 25)
  160. ENETRESET = (B_POSIX_ERROR_BASE + 26)
  161. ECONNABORTED = (B_POSIX_ERROR_BASE + 27)
  162. ECONNRESET = (B_POSIX_ERROR_BASE + 28)
  163. EISCONN = (B_POSIX_ERROR_BASE + 29)
  164. ENOTCONN = (B_POSIX_ERROR_BASE + 30)
  165. ESHUTDOWN = (B_POSIX_ERROR_BASE + 31)
  166. ECONNREFUSED = (B_POSIX_ERROR_BASE + 32)
  167. EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33)
  168. ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34)
  169. ENOBUFS = (B_POSIX_ERROR_BASE + 35)
  170. EINPROGRESS = (B_POSIX_ERROR_BASE + 36)
  171. EALREADY = (B_POSIX_ERROR_BASE + 37)
  172. EILSEQ = (B_POSIX_ERROR_BASE + 38)
  173. ENOMSG = (B_POSIX_ERROR_BASE + 39)
  174. ESTALE = (B_POSIX_ERROR_BASE + 40)
  175. EOVERFLOW = (B_POSIX_ERROR_BASE + 41)
  176. EMSGSIZE = (B_POSIX_ERROR_BASE + 42)
  177. EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43)
  178. ENOTSOCK = (B_POSIX_ERROR_BASE + 44)
  179. false = 0
  180. true = 1
  181. NULL = (0)
  182. FALSE = 0
  183. TRUE = 1
  184. # Included from TypeConstants.h
  185. B_HOST_IS_LENDIAN = 1
  186. B_HOST_IS_BENDIAN = 0
  187. def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg)
  188. def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg)
  189. def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg)
  190. def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg)
  191. def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg)
  192. def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg)
  193. def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg)
  194. def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg)
  195. def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg)
  196. def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg)
  197. def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
  198. def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
  199. def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
  200. def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
  201. def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
  202. def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
  203. def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
  204. def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
  205. def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
  206. def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
  207. B_HOST_IS_LENDIAN = 0
  208. B_HOST_IS_BENDIAN = 1
  209. def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg)
  210. def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg)
  211. def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg)
  212. def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg)
  213. def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg)
  214. def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg)
  215. def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg)
  216. def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg)
  217. def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg)
  218. def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg)
  219. def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg)
  220. def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg)
  221. def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg)
  222. def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg)
  223. def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg)
  224. def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg)
  225. def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg)
  226. def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg)
  227. def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg)
  228. def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg)
  229. def B_SWAP_DOUBLE(arg): return __swap_double(arg)
  230. def B_SWAP_FLOAT(arg): return __swap_float(arg)
  231. def B_SWAP_INT64(arg): return __swap_int64(arg)
  232. def B_SWAP_INT32(arg): return __swap_int32(arg)
  233. def B_SWAP_INT16(arg): return __swap_int16(arg)
  234. def htonl(x): return B_HOST_TO_BENDIAN_INT32(x)
  235. def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x)
  236. def htons(x): return B_HOST_TO_BENDIAN_INT16(x)
  237. def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x)
  238. AF_INET = 1
  239. INADDR_ANY = 0x00000000
  240. INADDR_BROADCAST = 0xffffffff
  241. INADDR_LOOPBACK = 0x7f000001
  242. SOL_SOCKET = 1
  243. SO_DEBUG = 1
  244. SO_REUSEADDR = 2
  245. SO_NONBLOCK = 3
  246. SO_REUSEPORT = 4
  247. MSG_OOB = 0x1
  248. SOCK_DGRAM = 1
  249. SOCK_STREAM = 2
  250. IPPROTO_UDP = 1
  251. IPPROTO_TCP = 2
  252. IPPROTO_ICMP = 3
  253. B_UDP_MAX_SIZE = (65536 - 1024)
  254. FD_SETSIZE = 256
  255. FDSETSIZE = FD_SETSIZE
  256. NFDBITS = 32
  257. def _FDMSKNO(fd): return ((fd) / NFDBITS)
  258. def _FDBITNO(fd): return ((fd) % NFDBITS)