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-2003 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,  59 Temple Place - Suite 330,  Boston, --
20-- MA 02111-1307, 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------------------------------------------------------------------------------
33
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.
37
38--  This is the version for Alpha/VMS
39
40package GNAT.Sockets.Constants is
41
42   --------------
43   -- Families --
44   --------------
45
46   AF_INET            : constant :=            2; --  IPv4 address family
47   AF_INET6           : constant :=           26; --  IPv6 address family
48
49   -----------
50   -- Modes --
51   -----------
52
53   SOCK_STREAM        : constant :=            1; --  Stream socket
54   SOCK_DGRAM         : constant :=            2; --  Datagram socket
55
56   -------------------
57   -- Socket errors --
58   -------------------
59
60   EACCES             : constant :=           13; --  Permission denied
61   EADDRINUSE         : constant :=           48; --  Address already in use
62   EADDRNOTAVAIL      : constant :=           49; --  Cannot assign address
63   EAFNOSUPPORT       : constant :=           47; --  Addr family not supported
64   EALREADY           : constant :=           37; --  Operation in progress
65   EBADF              : constant :=            9; --  Bad file descriptor
66   ECONNABORTED       : constant :=           53; --  Connection aborted
67   ECONNREFUSED       : constant :=           61; --  Connection refused
68   ECONNRESET         : constant :=           54; --  Connection reset by peer
69   EDESTADDRREQ       : constant :=           39; --  Destination addr required
70   EFAULT             : constant :=           45; --  Bad address
71   EHOSTDOWN          : constant :=           64; --  Host is down
72   EHOSTUNREACH       : constant :=           65; --  No route to host
73   EINPROGRESS        : constant :=           36; --  Operation now in progress
74   EINTR              : constant :=            4; --  Interrupted system call
75   EINVAL             : constant :=           22; --  Invalid argument
76   EIO                : constant :=            5; --  Input output error
77   EISCONN            : constant :=           56; --  Socket already connected
78   ELOOP              : constant :=           62; --  Too many symbolic lynks
79   EMFILE             : constant :=           24; --  Too many open files
80   EMSGSIZE           : constant :=           40; --  Message too long
81   ENAMETOOLONG       : constant :=           63; --  Name too long
82   ENETDOWN           : constant :=           50; --  Network is down
83   ENETRESET          : constant :=           52; --  Disconn. on network reset
84   ENETUNREACH        : constant :=           51; --  Network is unreachable
85   ENOBUFS            : constant :=           55; --  No buffer space available
86   ENOPROTOOPT        : constant :=           42; --  Protocol not available
87   ENOTCONN           : constant :=           57; --  Socket not connected
88   ENOTSOCK           : constant :=           38; --  Operation on non socket
89   EOPNOTSUPP         : constant :=           95; --  Operation not supported
90   EPFNOSUPPORT       : constant :=           46; --  Unknown protocol family
91   EPROTONOSUPPORT    : constant :=           43; --  Unknown protocol
92   EPROTOTYPE         : constant :=           41; --  Unknown protocol type
93   ESHUTDOWN          : constant :=           58; --  Cannot send once shutdown
94   ESOCKTNOSUPPORT    : constant :=           44; --  Socket type not supported
95   ETIMEDOUT          : constant :=           60; --  Connection timed out
96   ETOOMANYREFS       : constant :=           59; --  Too many references
97   EWOULDBLOCK        : constant :=           35; --  Operation would block
98
99   -----------------
100   -- Host errors --
101   -----------------
102
103   HOST_NOT_FOUND     : constant :=            1; --  Unknown host
104   TRY_AGAIN          : constant :=            2; --  Host name lookup failure
105   NO_DATA            : constant :=            4; --  No data record for name
106   NO_RECOVERY        : constant :=            3; --  Non recoverable errors
107
108   -------------------
109   -- Control flags --
110   -------------------
111
112   FIONBIO            : constant :=  -2147195266; --  Set/clear non-blocking io
113   FIONREAD           : constant :=   1074030207; --  How many bytes to read
114
115   --------------------
116   -- Shutdown modes --
117   --------------------
118
119   SHUT_RD            : constant :=            0; --  No more recv
120   SHUT_WR            : constant :=            1; --  No more send
121   SHUT_RDWR          : constant :=            2; --  No more recv/send
122
123   ---------------------
124   -- Protocol levels --
125   ---------------------
126
127   SOL_SOCKET         : constant :=     16#FFFF#; --  Options for socket level
128   IPPROTO_IP         : constant :=            0; --  Dummy protocol for IP
129   IPPROTO_UDP        : constant :=           17; --  UDP
130   IPPROTO_TCP        : constant :=            6; --  TCP
131
132   -------------------
133   -- Request flags --
134   -------------------
135
136   MSG_OOB            : constant :=            1; --  Process out-of-band data
137   MSG_PEEK           : constant :=            2; --  Peek at incoming data
138   MSG_EOR            : constant :=            8; --  Send end of record
139   MSG_WAITALL        : constant :=           64; --  Wait for full reception
140
141   --------------------
142   -- Socket options --
143   --------------------
144
145   TCP_NODELAY        : constant :=            1; --  Do not coalesce packets
146   SO_SNDBUF          : constant :=     16#1001#; --  Set/get send buffer size
147   SO_RCVBUF          : constant :=     16#1002#; --  Set/get recv buffer size
148   SO_REUSEADDR       : constant :=     16#0004#; --  Bind reuse local address
149   SO_KEEPALIVE       : constant :=     16#0008#; --  Enable keep-alive msgs
150   SO_LINGER          : constant :=     16#0080#; --  Defer close to flush data
151   SO_ERROR           : constant :=     16#1007#; --  Get/clear error status
152   SO_BROADCAST       : constant :=     16#0020#; --  Can send broadcast msgs
153   IP_ADD_MEMBERSHIP  : constant :=           12; --  Join a multicast group
154   IP_DROP_MEMBERSHIP : constant :=           13; --  Leave a multicast group
155   IP_MULTICAST_TTL   : constant :=           10; --  Set/get multicast TTL
156   IP_MULTICAST_LOOP  : constant :=           11; --  Set/get mcast loopback
157
158end GNAT.Sockets.Constants;
159