socket_type.h 2.1 KB

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