2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / ada / g-soccon.ads
blobb7f8fe4be77950f5582ad97e330b3b2bacc9a8c4
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- G N A T . S O C K E T S . C O N S T A N T S --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 -- This package provides target dependent definitions of constant for use
35 -- by the GNAT.Sockets package (g-socket.ads). This package should not be
36 -- directly with'ed by an applications program.
38 -- WARNING! This file is a default version that must be replaced for
39 -- each platform by running gen-soccon.c which automatically generates
40 -- the appropriate target specific values.
42 -- The values below were computed from a i686-pc-linux-gnu environment,
43 -- but are for illustration purposes only. As noted above, part of a port
44 -- to a new target is to replace this file appropriately.
46 -- This file is generated automatically, do not modify it by hand! Instead,
47 -- make changes to gen-soccon.c and re-run it on each target.
49 with Interfaces.C;
50 package GNAT.Sockets.Constants is
52 --------------
53 -- Families --
54 --------------
56 AF_INET : constant := 2; -- IPv4 address family
57 AF_INET6 : constant := 10; -- IPv6 address family
59 -----------
60 -- Modes --
61 -----------
63 SOCK_STREAM : constant := 1; -- Stream socket
64 SOCK_DGRAM : constant := 2; -- Datagram socket
66 -------------------
67 -- Socket errors --
68 -------------------
70 EACCES : constant := 13; -- Permission denied
71 EADDRINUSE : constant := 98; -- Address already in use
72 EADDRNOTAVAIL : constant := 99; -- Cannot assign address
73 EAFNOSUPPORT : constant := 97; -- Addr family not supported
74 EALREADY : constant := 114; -- Operation in progress
75 EBADF : constant := 9; -- Bad file descriptor
76 ECONNABORTED : constant := 103; -- Connection aborted
77 ECONNREFUSED : constant := 111; -- Connection refused
78 ECONNRESET : constant := 104; -- Connection reset by peer
79 EDESTADDRREQ : constant := 89; -- Destination addr required
80 EFAULT : constant := 14; -- Bad address
81 EHOSTDOWN : constant := 112; -- Host is down
82 EHOSTUNREACH : constant := 113; -- No route to host
83 EINPROGRESS : constant := 115; -- Operation now in progress
84 EINTR : constant := 4; -- Interrupted system call
85 EINVAL : constant := 22; -- Invalid argument
86 EIO : constant := 5; -- Input output error
87 EISCONN : constant := 106; -- Socket already connected
88 ELOOP : constant := 40; -- Too many symbolic links
89 EMFILE : constant := 24; -- Too many open files
90 EMSGSIZE : constant := 90; -- Message too long
91 ENAMETOOLONG : constant := 36; -- Name too long
92 ENETDOWN : constant := 100; -- Network is down
93 ENETRESET : constant := 102; -- Disconn. on network reset
94 ENETUNREACH : constant := 101; -- Network is unreachable
95 ENOBUFS : constant := 105; -- No buffer space available
96 ENOPROTOOPT : constant := 92; -- Protocol not available
97 ENOTCONN : constant := 107; -- Socket not connected
98 ENOTSOCK : constant := 88; -- Operation on non socket
99 EOPNOTSUPP : constant := 95; -- Operation not supported
100 EPFNOSUPPORT : constant := 96; -- Unknown protocol family
101 EPROTONOSUPPORT : constant := 93; -- Unknown protocol
102 EPROTOTYPE : constant := 91; -- Unknown protocol type
103 ESHUTDOWN : constant := 108; -- Cannot send once shutdown
104 ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
105 ETIMEDOUT : constant := 110; -- Connection timed out
106 ETOOMANYREFS : constant := 109; -- Too many references
107 EWOULDBLOCK : constant := 11; -- Operation would block
109 -----------------
110 -- Host errors --
111 -----------------
113 HOST_NOT_FOUND : constant := 1; -- Unknown host
114 TRY_AGAIN : constant := 2; -- Host name lookup failure
115 NO_DATA : constant := 4; -- No data record for name
116 NO_RECOVERY : constant := 3; -- Non recoverable errors
118 -------------------
119 -- Control flags --
120 -------------------
122 FIONBIO : constant := 21537; -- Set/clear non-blocking io
123 FIONREAD : constant := 21531; -- How many bytes to read
125 --------------------
126 -- Shutdown modes --
127 --------------------
129 SHUT_RD : constant := 0; -- No more recv
130 SHUT_WR : constant := 1; -- No more send
131 SHUT_RDWR : constant := 2; -- No more recv/send
133 ---------------------
134 -- Protocol levels --
135 ---------------------
137 SOL_SOCKET : constant := 1; -- Options for socket level
138 IPPROTO_IP : constant := 0; -- Dummy protocol for IP
139 IPPROTO_UDP : constant := 17; -- UDP
140 IPPROTO_TCP : constant := 6; -- TCP
142 -------------------
143 -- Request flags --
144 -------------------
146 MSG_OOB : constant := 1; -- Process out-of-band data
147 MSG_PEEK : constant := 2; -- Peek at incoming data
148 MSG_EOR : constant := 128; -- Send end of record
149 MSG_WAITALL : constant := 256; -- Wait for full reception
150 MSG_NOSIGNAL : constant := 16384; -- No SIGPIPE on send
151 MSG_Forced_Flags : constant := MSG_NOSIGNAL;
152 -- Flags set on all send(2) calls
154 --------------------
155 -- Socket options --
156 --------------------
158 TCP_NODELAY : constant := 1; -- Do not coalesce packets
159 SO_REUSEADDR : constant := 2; -- Bind reuse local address
160 SO_REUSEPORT : constant := -1; -- Bind reuse port number
161 SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs
162 SO_LINGER : constant := 13; -- Defer close to flush data
163 SO_BROADCAST : constant := 6; -- Can send broadcast msgs
164 SO_SNDBUF : constant := 7; -- Set/get send buffer size
165 SO_RCVBUF : constant := 8; -- Set/get recv buffer size
166 SO_SNDTIMEO : constant := 21; -- Emission timeout
167 SO_RCVTIMEO : constant := 20; -- Reception timeout
168 SO_ERROR : constant := 4; -- Get/clear error status
169 IP_MULTICAST_IF : constant := 32; -- Set/get mcast interface
170 IP_MULTICAST_TTL : constant := 33; -- Set/get multicast TTL
171 IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
172 IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
173 IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
174 IP_PKTINFO : constant := 8; -- Get datagram info
176 -------------------
177 -- System limits --
178 -------------------
180 IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
182 ----------------------
183 -- Type definitions --
184 ----------------------
186 -- Sizes (in bytes) of the components of struct timeval
188 SIZEOF_tv_sec : constant := 4; -- tv_sec
189 SIZEOF_tv_usec : constant := 4; -- tv_usec
191 -- Sizes of protocol specific address types (for sockaddr.sa_len)
193 SIZEOF_sockaddr_in : constant := 16; -- struct sockaddr_in
194 SIZEOF_sockaddr_in6 : constant := 28; -- struct sockaddr_in6
196 -- Size of file descriptor sets
198 SIZEOF_fd_set : constant := 128; -- fd_set
200 -- Fields of struct hostent
202 subtype H_Addrtype_T is Interfaces.C.int;
203 subtype H_Length_T is Interfaces.C.int;
205 ----------------------------------------
206 -- Properties of supported interfaces --
207 ----------------------------------------
209 Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
210 Has_Sockaddr_Len : constant := 0; -- Sockaddr has sa_len field
212 Thread_Blocking_IO : constant Boolean := True;
213 -- Set False for contexts where socket i/o are process blocking
215 end GNAT.Sockets.Constants;