socket_type.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* System-specific socket constants and types. Linux/MIPS version.
  2. Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006
  3. Free Software Foundation, Inc.
  4. This file is part of the GNU C Library.
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with the GNU C Library; if not, see
  15. <http://www.gnu.org/licenses/>. */
  16. #ifndef _SYS_SOCKET_H
  17. # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
  18. #endif
  19. /* Types of sockets. */
  20. enum __socket_type
  21. {
  22. SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams
  23. of fixed maximum length. */
  24. #define SOCK_DGRAM SOCK_DGRAM
  25. SOCK_STREAM = 2, /* Sequenced, reliable, connection-based
  26. byte streams. */
  27. #define SOCK_STREAM SOCK_STREAM
  28. SOCK_RAW = 3, /* Raw protocol interface. */
  29. #define SOCK_RAW SOCK_RAW
  30. SOCK_RDM = 4, /* Reliably-delivered messages. */
  31. #define SOCK_RDM SOCK_RDM
  32. SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  33. datagrams of fixed maximum length. */
  34. #define SOCK_SEQPACKET SOCK_SEQPACKET
  35. SOCK_DCCP = 6,
  36. #define SOCK_DCCP SOCK_DCCP /* Datagram Congestion Control Protocol. */
  37. SOCK_PACKET = 10, /* Linux specific way of getting packets
  38. at the dev level. For writing rarp and
  39. other similar things on the user level. */
  40. #define SOCK_PACKET SOCK_PACKET
  41. /* Flags to be ORed into the type parameter of socket and socketpair. */
  42. SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the
  43. new descriptor(s). */
  44. #define SOCK_CLOEXEC SOCK_CLOEXEC
  45. SOCK_NONBLOCK = 00000200 /* Atomically mark descriptor(s) as
  46. non-blocking. */
  47. #define SOCK_NONBLOCK SOCK_NONBLOCK
  48. };