1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- G N A T . S O C K E T S . C O N S T A N T S --
9 -- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
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. --
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. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
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 -- This is the version for OpenVMS
39 -- This file is generated automatically, do not modify it by hand! Instead,
40 -- make changes to gen-soccon.c and re-run it on each target.
43 package GNAT
.Sockets
.Constants
is
49 AF_INET
: constant := 2; -- IPv4 address family
50 AF_INET6
: constant := 26; -- IPv6 address family
56 SOCK_STREAM
: constant := 1; -- Stream socket
57 SOCK_DGRAM
: constant := 2; -- Datagram socket
63 EACCES
: constant := 13; -- Permission denied
64 EADDRINUSE
: constant := 48; -- Address already in use
65 EADDRNOTAVAIL
: constant := 49; -- Cannot assign address
66 EAFNOSUPPORT
: constant := 47; -- Addr family not supported
67 EALREADY
: constant := 37; -- Operation in progress
68 EBADF
: constant := 9; -- Bad file descriptor
69 ECONNABORTED
: constant := 53; -- Connection aborted
70 ECONNREFUSED
: constant := 61; -- Connection refused
71 ECONNRESET
: constant := 54; -- Connection reset by peer
72 EDESTADDRREQ
: constant := 39; -- Destination addr required
73 EFAULT
: constant := 14; -- Bad address
74 EHOSTDOWN
: constant := 64; -- Host is down
75 EHOSTUNREACH
: constant := 65; -- No route to host
76 EINPROGRESS
: constant := 36; -- Operation now in progress
77 EINTR
: constant := 4; -- Interrupted system call
78 EINVAL
: constant := 22; -- Invalid argument
79 EIO
: constant := 5; -- Input output error
80 EISCONN
: constant := 56; -- Socket already connected
81 ELOOP
: constant := 62; -- Too many symbolic links
82 EMFILE
: constant := 24; -- Too many open files
83 EMSGSIZE
: constant := 40; -- Message too long
84 ENAMETOOLONG
: constant := 63; -- Name too long
85 ENETDOWN
: constant := 50; -- Network is down
86 ENETRESET
: constant := 52; -- Disconn. on network reset
87 ENETUNREACH
: constant := 51; -- Network is unreachable
88 ENOBUFS
: constant := 55; -- No buffer space available
89 ENOPROTOOPT
: constant := 42; -- Protocol not available
90 ENOTCONN
: constant := 57; -- Socket not connected
91 ENOTSOCK
: constant := 38; -- Operation on non socket
92 EOPNOTSUPP
: constant := 45; -- Operation not supported
93 EPFNOSUPPORT
: constant := 46; -- Unknown protocol family
94 EPROTONOSUPPORT
: constant := 43; -- Unknown protocol
95 EPROTOTYPE
: constant := 41; -- Unknown protocol type
96 ESHUTDOWN
: constant := 58; -- Cannot send once shutdown
97 ESOCKTNOSUPPORT
: constant := 44; -- Socket type not supported
98 ETIMEDOUT
: constant := 60; -- Connection timed out
99 ETOOMANYREFS
: constant := 59; -- Too many references
100 EWOULDBLOCK
: constant := 35; -- Operation would block
106 HOST_NOT_FOUND
: constant := 1; -- Unknown host
107 TRY_AGAIN
: constant := 2; -- Host name lookup failure
108 NO_DATA
: constant := 4; -- No data record for name
109 NO_RECOVERY
: constant := 3; -- Non recoverable errors
115 FIONBIO
: constant := -2147195266; -- Set/clear non-blocking io
116 FIONREAD
: constant := 1074030207; -- How many bytes to read
122 SHUT_RD
: constant := 0; -- No more recv
123 SHUT_WR
: constant := 1; -- No more send
124 SHUT_RDWR
: constant := 2; -- No more recv/send
126 ---------------------
127 -- Protocol levels --
128 ---------------------
130 SOL_SOCKET
: constant := 65535; -- Options for socket level
131 IPPROTO_IP
: constant := 0; -- Dummy protocol for IP
132 IPPROTO_UDP
: constant := 17; -- UDP
133 IPPROTO_TCP
: constant := 6; -- TCP
139 MSG_OOB
: constant := 1; -- Process out-of-band data
140 MSG_PEEK
: constant := 2; -- Peek at incoming data
141 MSG_EOR
: constant := 8; -- Send end of record
142 MSG_WAITALL
: constant := 128; -- Wait for full reception
143 MSG_NOSIGNAL
: constant := -1; -- No SIGPIPE on send
144 MSG_Forced_Flags
: constant := 0;
145 -- Flags set on all send(2) calls
151 TCP_NODELAY
: constant := 1; -- Do not coalesce packets
152 SO_REUSEADDR
: constant := 4; -- Bind reuse local address
153 SO_REUSEPORT
: constant := 512; -- Bind reuse port number
154 SO_KEEPALIVE
: constant := 8; -- Enable keep-alive msgs
155 SO_LINGER
: constant := 128; -- Defer close to flush data
156 SO_BROADCAST
: constant := 32; -- Can send broadcast msgs
157 SO_SNDBUF
: constant := 4097; -- Set/get send buffer size
158 SO_RCVBUF
: constant := 4098; -- Set/get recv buffer size
159 SO_SNDTIMEO
: constant := 4101; -- Emission timeout
160 SO_RCVTIMEO
: constant := 4102; -- Reception timeout
161 SO_ERROR
: constant := 4103; -- Get/clear error status
162 IP_MULTICAST_IF
: constant := 9; -- Set/get mcast interface
163 IP_MULTICAST_TTL
: constant := 10; -- Set/get multicast TTL
164 IP_MULTICAST_LOOP
: constant := 11; -- Set/get mcast loopback
165 IP_ADD_MEMBERSHIP
: constant := 12; -- Join a multicast group
166 IP_DROP_MEMBERSHIP
: constant := 13; -- Leave a multicast group
167 IP_PKTINFO
: constant := -1; -- Get datagram info
173 IOV_MAX
: constant := 1024; -- Maximum writev iovcnt
175 ----------------------
176 -- Type definitions --
177 ----------------------
179 -- Sizes (in bytes) of the components of struct timeval
181 SIZEOF_tv_sec
: constant := 4; -- tv_sec
182 SIZEOF_tv_usec
: constant := 4; -- tv_usec
184 -- Sizes of protocol specific address types (for sockaddr.sa_len)
186 SIZEOF_sockaddr_in
: constant := 16; -- struct sockaddr_in
187 SIZEOF_sockaddr_in6
: constant := 28; -- struct sockaddr_in6
189 -- Size of file descriptor sets
191 SIZEOF_fd_set
: constant := 512; -- fd_set
193 -- Fields of struct hostent
195 subtype H_Addrtype_T
is Interfaces
.C
.int
;
196 subtype H_Length_T
is Interfaces
.C
.int
;
198 ----------------------------------------
199 -- Properties of supported interfaces --
200 ----------------------------------------
202 Need_Netdb_Buffer
: constant := 1; -- Need buffer for Netdb ops
203 Has_Sockaddr_Len
: constant := 0; -- Sockaddr has sa_len field
205 Thread_Blocking_IO
: constant Boolean := True;
206 -- Set False for contexts where socket i/o are process blocking
208 end GNAT
.Sockets
.Constants
;