PageRenderTime 113ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/development/ndk/platforms/android-3/include/linux/socket.h

https://gitlab.com/brian0218/rk3188_r-box_android4.2.2_sdk
C Header | 227 lines | 183 code | 33 blank | 11 comment | 3 complexity | f7f3045f67e85c889b25d60aac110b40 MD5 | raw file
  1. /****************************************************************************
  2. ****************************************************************************
  3. ***
  4. *** This header was automatically generated from a Linux kernel header
  5. *** of the same name, to make information necessary for userspace to
  6. *** call into the kernel available to libc. It contains only constants,
  7. *** structures, and macros generated from the original header, and thus,
  8. *** contains no copyrightable information.
  9. ***
  10. ****************************************************************************
  11. ****************************************************************************/
  12. #ifndef _LINUX_SOCKET_H
  13. #define _LINUX_SOCKET_H
  14. #define _K_SS_MAXSIZE 128
  15. #define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
  16. struct __kernel_sockaddr_storage {
  17. unsigned short ss_family;
  18. char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
  19. } __attribute__ ((aligned(_K_SS_ALIGNSIZE)));
  20. #if !defined(__GLIBC__) || __GLIBC__ < 2
  21. #include <asm/socket.h>
  22. #include <linux/sockios.h>
  23. #include <linux/uio.h>
  24. #include <linux/types.h>
  25. #include <linux/compiler.h>
  26. typedef unsigned short sa_family_t;
  27. struct sockaddr {
  28. sa_family_t sa_family;
  29. char sa_data[14];
  30. };
  31. struct linger {
  32. int l_onoff;
  33. int l_linger;
  34. };
  35. #define sockaddr_storage __kernel_sockaddr_storage
  36. struct msghdr {
  37. void * msg_name;
  38. int msg_namelen;
  39. struct iovec * msg_iov;
  40. __kernel_size_t msg_iovlen;
  41. void * msg_control;
  42. __kernel_size_t msg_controllen;
  43. unsigned msg_flags;
  44. };
  45. struct cmsghdr {
  46. __kernel_size_t cmsg_len;
  47. int cmsg_level;
  48. int cmsg_type;
  49. };
  50. #define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
  51. #define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
  52. #define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
  53. #define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
  54. #define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
  55. #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
  56. #define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? (struct cmsghdr *)(ctl) : (struct cmsghdr *)NULL)
  57. #define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
  58. #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && (cmsg)->cmsg_len <= (unsigned long) ((mhdr)->msg_controllen - ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
  59. #ifdef __GNUC__
  60. #define __KINLINE static __inline__
  61. #elif defined(__cplusplus)
  62. #define __KINLINE static inline
  63. #else
  64. #define __KINLINE static
  65. #endif
  66. __KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
  67. struct cmsghdr *__cmsg)
  68. {
  69. struct cmsghdr * __ptr;
  70. __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len));
  71. if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
  72. return (struct cmsghdr *)0;
  73. return __ptr;
  74. }
  75. __KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
  76. {
  77. return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
  78. }
  79. #define SCM_RIGHTS 0x01
  80. #define SCM_CREDENTIALS 0x02
  81. #define SCM_SECURITY 0x03
  82. struct ucred {
  83. __u32 pid;
  84. __u32 uid;
  85. __u32 gid;
  86. };
  87. #define AF_UNSPEC 0
  88. #define AF_UNIX 1
  89. #define AF_LOCAL 1
  90. #define AF_INET 2
  91. #define AF_AX25 3
  92. #define AF_IPX 4
  93. #define AF_APPLETALK 5
  94. #define AF_NETROM 6
  95. #define AF_BRIDGE 7
  96. #define AF_ATMPVC 8
  97. #define AF_X25 9
  98. #define AF_INET6 10
  99. #define AF_ROSE 11
  100. #define AF_DECnet 12
  101. #define AF_NETBEUI 13
  102. #define AF_SECURITY 14
  103. #define AF_KEY 15
  104. #define AF_NETLINK 16
  105. #define AF_ROUTE AF_NETLINK
  106. #define AF_PACKET 17
  107. #define AF_ASH 18
  108. #define AF_ECONET 19
  109. #define AF_ATMSVC 20
  110. #define AF_SNA 22
  111. #define AF_IRDA 23
  112. #define AF_PPPOX 24
  113. #define AF_WANPIPE 25
  114. #define AF_LLC 26
  115. #define AF_TIPC 30
  116. #define AF_BLUETOOTH 31
  117. #define AF_MAX 32
  118. #define PF_UNSPEC AF_UNSPEC
  119. #define PF_UNIX AF_UNIX
  120. #define PF_LOCAL AF_LOCAL
  121. #define PF_INET AF_INET
  122. #define PF_AX25 AF_AX25
  123. #define PF_IPX AF_IPX
  124. #define PF_APPLETALK AF_APPLETALK
  125. #define PF_NETROM AF_NETROM
  126. #define PF_BRIDGE AF_BRIDGE
  127. #define PF_ATMPVC AF_ATMPVC
  128. #define PF_X25 AF_X25
  129. #define PF_INET6 AF_INET6
  130. #define PF_ROSE AF_ROSE
  131. #define PF_DECnet AF_DECnet
  132. #define PF_NETBEUI AF_NETBEUI
  133. #define PF_SECURITY AF_SECURITY
  134. #define PF_KEY AF_KEY
  135. #define PF_NETLINK AF_NETLINK
  136. #define PF_ROUTE AF_ROUTE
  137. #define PF_PACKET AF_PACKET
  138. #define PF_ASH AF_ASH
  139. #define PF_ECONET AF_ECONET
  140. #define PF_ATMSVC AF_ATMSVC
  141. #define PF_SNA AF_SNA
  142. #define PF_IRDA AF_IRDA
  143. #define PF_PPPOX AF_PPPOX
  144. #define PF_WANPIPE AF_WANPIPE
  145. #define PF_LLC AF_LLC
  146. #define PF_TIPC AF_TIPC
  147. #define PF_BLUETOOTH AF_BLUETOOTH
  148. #define PF_MAX AF_MAX
  149. #define SOMAXCONN 128
  150. #define MSG_OOB 1
  151. #define MSG_PEEK 2
  152. #define MSG_DONTROUTE 4
  153. #define MSG_TRYHARD 4
  154. #define MSG_CTRUNC 8
  155. #define MSG_PROBE 0x10
  156. #define MSG_TRUNC 0x20
  157. #define MSG_DONTWAIT 0x40
  158. #define MSG_EOR 0x80
  159. #define MSG_WAITALL 0x100
  160. #define MSG_FIN 0x200
  161. #define MSG_SYN 0x400
  162. #define MSG_CONFIRM 0x800
  163. #define MSG_RST 0x1000
  164. #define MSG_ERRQUEUE 0x2000
  165. #define MSG_NOSIGNAL 0x4000
  166. #define MSG_MORE 0x8000
  167. #define MSG_EOF MSG_FIN
  168. #define MSG_CMSG_COMPAT 0
  169. #define SOL_IP 0
  170. #define SOL_TCP 6
  171. #define SOL_UDP 17
  172. #define SOL_IPV6 41
  173. #define SOL_ICMPV6 58
  174. #define SOL_SCTP 132
  175. #define SOL_RAW 255
  176. #define SOL_IPX 256
  177. #define SOL_AX25 257
  178. #define SOL_ATALK 258
  179. #define SOL_NETROM 259
  180. #define SOL_ROSE 260
  181. #define SOL_DECNET 261
  182. #define SOL_X25 262
  183. #define SOL_PACKET 263
  184. #define SOL_ATM 264
  185. #define SOL_AAL 265
  186. #define SOL_IRDA 266
  187. #define SOL_NETBEUI 267
  188. #define SOL_LLC 268
  189. #define SOL_DCCP 269
  190. #define SOL_NETLINK 270
  191. #define SOL_TIPC 271
  192. #define IPX_TYPE 1
  193. #endif
  194. #endif