2
0

sockbits.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License version 2 as
  4. * published by the Free Software Foundation, or (at your option) any
  5. * later version. See the COPYING file in the top-level directory.
  6. */
  7. #ifndef MIPS_SOCKBITS_H
  8. #define MIPS_SOCKBITS_H
  9. /* MIPS special values for constants */
  10. /*
  11. * For setsockopt(2)
  12. *
  13. * This defines are ABI conformant as far as Linux supports these ...
  14. */
  15. #define TARGET_SOL_SOCKET 0xffff
  16. #define TARGET_SO_DEBUG 0x0001 /* Record debugging information. */
  17. #define TARGET_SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. */
  18. #define TARGET_SO_KEEPALIVE 0x0008 /* Keep connections alive and send
  19. SIGPIPE when they die. */
  20. #define TARGET_SO_DONTROUTE 0x0010 /* Don't do local routing. */
  21. #define TARGET_SO_BROADCAST 0x0020 /* Allow transmission of
  22. broadcast messages. */
  23. #define TARGET_SO_LINGER 0x0080 /* Block on close of a reliable
  24. * socket to transmit pending data.
  25. */
  26. #define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band.
  27. */
  28. #define TARGET_SO_REUSEPORT 0x0200
  29. #define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */
  30. #define TARGET_SO_STYLE SO_TYPE /* Synonym */
  31. #define TARGET_SO_ERROR 0x1007 /* get error status and clear */
  32. #define TARGET_SO_SNDBUF 0x1001 /* Send buffer size. */
  33. #define TARGET_SO_RCVBUF 0x1002 /* Receive buffer. */
  34. #define TARGET_SO_SNDLOWAT 0x1003 /* send low-water mark */
  35. #define TARGET_SO_RCVLOWAT 0x1004 /* receive low-water mark */
  36. #define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */
  37. #define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */
  38. #define TARGET_SO_ACCEPTCONN 0x1009
  39. #define TARGET_SO_PROTOCOL 0x1028 /* protocol type */
  40. #define TARGET_SO_DOMAIN 0x1029 /* domain/socket family */
  41. /* linux-specific, might as well be the same as on i386 */
  42. #define TARGET_SO_NO_CHECK 11
  43. #define TARGET_SO_PRIORITY 12
  44. #define TARGET_SO_BSDCOMPAT 14
  45. #define TARGET_SO_PASSCRED 17
  46. #define TARGET_SO_PEERCRED 18
  47. /* Security levels - as per NRL IPv6 - don't actually do anything */
  48. #define TARGET_SO_SECURITY_AUTHENTICATION 22
  49. #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23
  50. #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24
  51. #define TARGET_SO_BINDTODEVICE 25
  52. /* Socket filtering */
  53. #define TARGET_SO_ATTACH_FILTER 26
  54. #define TARGET_SO_DETACH_FILTER 27
  55. #define TARGET_SO_PEERNAME 28
  56. #define TARGET_SO_TIMESTAMP 29
  57. #define SCM_TIMESTAMP SO_TIMESTAMP
  58. #define TARGET_SO_PEERSEC 30
  59. #define TARGET_SO_SNDBUFFORCE 31
  60. #define TARGET_SO_RCVBUFFORCE 33
  61. #define TARGET_SO_PASSSEC 34
  62. /** sock_type - Socket types
  63. *
  64. * Please notice that for binary compat reasons MIPS has to
  65. * override the enum sock_type in include/linux/net.h, so
  66. * we define ARCH_HAS_SOCKET_TYPES here.
  67. *
  68. * @SOCK_DGRAM - datagram (conn.less) socket
  69. * @SOCK_STREAM - stream (connection) socket
  70. * @SOCK_RAW - raw socket
  71. * @SOCK_RDM - reliably-delivered message
  72. * @SOCK_SEQPACKET - sequential packet socket
  73. * @SOCK_DCCP - Datagram Congestion Control Protocol socket
  74. * @SOCK_PACKET - linux specific way of getting packets at the dev level.
  75. * For writing rarp and other similar things on the user
  76. * level.
  77. * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
  78. * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
  79. */
  80. #define TARGET_ARCH_HAS_SOCKET_TYPES 1
  81. enum sock_type {
  82. TARGET_SOCK_DGRAM = 1,
  83. TARGET_SOCK_STREAM = 2,
  84. TARGET_SOCK_RAW = 3,
  85. TARGET_SOCK_RDM = 4,
  86. TARGET_SOCK_SEQPACKET = 5,
  87. TARGET_SOCK_DCCP = 6,
  88. TARGET_SOCK_PACKET = 10,
  89. };
  90. #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
  91. #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */
  92. /* Flags for socket, socketpair, paccept */
  93. #define TARGET_SOCK_CLOEXEC TARGET_O_CLOEXEC
  94. #define TARGET_SOCK_NONBLOCK TARGET_O_NONBLOCK
  95. #endif