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