socket_type.h 2.1 KB

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