TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := 512; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
-- by the GNAT.Sockets package (g-socket.ads). This package should not be
-- directly with'ed by an applications program.
--- This is the version for powerpc-apple-darwin8.8.0
+-- This is the version for powerpc-apple-darwin8.9.0
-- This file is generated automatically, do not modify it by hand! Instead,
-- make changes to gen-soccon.c and re-run it on each target.
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := 512; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
-- Properties of supported interfaces --
----------------------------------------
- Need_Netdb_Buffer : constant := 1; -- Need buffer for Netdb ops
+ Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops
----------------------
-- Additional flags --
-- by the GNAT.Sockets package (g-socket.ads). This package should not be
-- directly with'ed by an applications program.
--- This is the version for i386-unknown-freebsd6.1
+-- This is the version for i386-unknown-freebsd6.2
-- This file is generated automatically, do not modify it by hand! Instead,
-- make changes to gen-soccon.c and re-run it on each target.
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := 512; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := 512; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 4; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 5; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 6; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := 512; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 4; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 5; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 6; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := 512; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 22; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 23; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 24; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
-- by the GNAT.Sockets package (g-socket.ads). This package should not be
-- directly with'ed by an applications program.
--- This is the version for ia64-hp-linux-gnu
+-- This is the version for x86_64-pc-linux-gnu
-- This file is generated automatically, do not modify it by hand! Instead,
-- make changes to gen-soccon.c and re-run it on each target.
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 2; -- Bind reuse local address
+ SO_REUSEPORT : constant := -1; -- Bind reuse port number
SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs
SO_LINGER : constant := 13; -- Defer close to flush data
SO_BROADCAST : constant := 6; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
+ IP_PKTINFO : constant := 8; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 2; -- Bind reuse local address
+ SO_REUSEPORT : constant := -1; -- Bind reuse port number
SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs
SO_LINGER : constant := 13; -- Defer close to flush data
SO_BROADCAST : constant := 6; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
+ IP_PKTINFO : constant := 8; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := 512; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := -1; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
+ IP_PKTINFO : constant := 19; -- Get datagram info
-------------------
-- System limits --
Need_Netdb_Buffer : constant := 0; -- Need buffer for Netdb ops
- ----------------------
- -- Additional flags --
- ----------------------
-
- Thread_Blocking_IO : constant Boolean := True;
- -- Set False for contexts where socket i/o are process blocking
-
------------------------------
-- MinGW-specific constants --
------------------------------
WSANOTINITIALISED : constant := 10093; -- Winsock not intialized
WSAEDISCON : constant := 10101; -- Disconnected
+ ----------------------
+ -- Additional flags --
+ ----------------------
+
+ Thread_Blocking_IO : constant Boolean := True;
+ -- Set False for contexts where socket i/o are process blocking
+
end GNAT.Sockets.Constants;
-- by the GNAT.Sockets package (g-socket.ads). This package should not be
-- directly with'ed by an applications program.
--- This is the version for sparc-sun-solaris2.8/64
+-- This is the version for sparc64-sun-solaris2.8
-- This file is generated automatically, do not modify it by hand! Instead,
-- make changes to gen-soccon.c and re-run it on each target.
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := -1; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 18; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 19; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 20; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := -1; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 18; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 19; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 20; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := 512; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_REUSEPORT : constant := 512; -- Bind reuse port number
SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
SO_LINGER : constant := 128; -- Defer close to flush data
SO_BROADCAST : constant := 32; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
+ IP_PKTINFO : constant := -1; -- Get datagram info
-------------------
-- System limits --
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 2; -- Bind reuse local address
+ SO_REUSEPORT : constant := -1; -- Bind reuse port number
SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs
SO_LINGER : constant := 13; -- Defer close to flush data
SO_BROADCAST : constant := 6; -- Can send broadcast msgs
IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
+ IP_PKTINFO : constant := 8; -- Get datagram info
-------------------
-- System limits --
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, AdaCore --
+-- Copyright (C) 2001-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
N_Bytes_To_Read => Constants.FIONREAD);
Options : constant array (Option_Name) of C.int :=
- (Keep_Alive => Constants.SO_KEEPALIVE,
- Reuse_Address => Constants.SO_REUSEADDR,
- Broadcast => Constants.SO_BROADCAST,
- Send_Buffer => Constants.SO_SNDBUF,
- Receive_Buffer => Constants.SO_RCVBUF,
- Linger => Constants.SO_LINGER,
- Error => Constants.SO_ERROR,
- No_Delay => Constants.TCP_NODELAY,
- Add_Membership => Constants.IP_ADD_MEMBERSHIP,
- Drop_Membership => Constants.IP_DROP_MEMBERSHIP,
- Multicast_If => Constants.IP_MULTICAST_IF,
- Multicast_TTL => Constants.IP_MULTICAST_TTL,
- Multicast_Loop => Constants.IP_MULTICAST_LOOP,
- Send_Timeout => Constants.SO_SNDTIMEO,
- Receive_Timeout => Constants.SO_RCVTIMEO);
+ (Keep_Alive => Constants.SO_KEEPALIVE,
+ Reuse_Address => Constants.SO_REUSEADDR,
+ Broadcast => Constants.SO_BROADCAST,
+ Send_Buffer => Constants.SO_SNDBUF,
+ Receive_Buffer => Constants.SO_RCVBUF,
+ Linger => Constants.SO_LINGER,
+ Error => Constants.SO_ERROR,
+ No_Delay => Constants.TCP_NODELAY,
+ Add_Membership => Constants.IP_ADD_MEMBERSHIP,
+ Drop_Membership => Constants.IP_DROP_MEMBERSHIP,
+ Multicast_If => Constants.IP_MULTICAST_IF,
+ Multicast_TTL => Constants.IP_MULTICAST_TTL,
+ Multicast_Loop => Constants.IP_MULTICAST_LOOP,
+ Receive_Packet_Info => Constants.IP_PKTINFO,
+ Send_Timeout => Constants.SO_SNDTIMEO,
+ Receive_Timeout => Constants.SO_RCVTIMEO);
+ -- ??? Note: for OpenSolaris, Receive_Packet_Info should be IP_RECVPKTINFO,
+ -- but for Linux compatibility this constant is the same as IP_PKTINFO.
Flags : constant array (0 .. 3) of C.int :=
(0 => Constants.MSG_OOB, -- Process_Out_Of_Band_Data
begin
if Safe_Getservbyname (SN, SP, Res'Access, Buf'Address, Buflen) /= 0 then
- Ada.Exceptions.Raise_Exception
- (Service_Error'Identity, "Service not found");
+ raise Service_Error with "Service not found";
end if;
-- Translate from the C format to the API format
(C.int (Short_To_Network (C.unsigned_short (Port))), SP,
Res'Access, Buf'Address, Buflen) /= 0
then
- Ada.Exceptions.Raise_Exception
- (Service_Error'Identity, "Service not found");
+ raise Service_Error with "Service not found";
end if;
-- Translate from the C format to the API format
begin
case Name is
- when Multicast_Loop |
- Multicast_TTL =>
+ when Multicast_Loop |
+ Multicast_TTL |
+ Receive_Packet_Info =>
Len := V1'Size / 8;
Add := V1'Address;
when Multicast_TTL =>
Opt.Time_To_Live := Integer (V1);
- when Multicast_Loop =>
+ when Multicast_Loop |
+ Receive_Packet_Info =>
Opt.Enabled := (V1 /= 0);
when Send_Timeout |
procedure Raise_Host_Error (H_Error : Integer) is
begin
- Ada.Exceptions.Raise_Exception (Host_Error'Identity,
+ raise Host_Error with
Err_Code_Image (H_Error)
- & C.Strings.Value (Host_Error_Messages.Host_Error_Message (H_Error)));
+ & C.Strings.Value (Host_Error_Messages.Host_Error_Message (H_Error));
end Raise_Host_Error;
------------------------
procedure Raise_Socket_Error (Error : Integer) is
use type C.Strings.chars_ptr;
begin
- Ada.Exceptions.Raise_Exception (Socket_Error'Identity,
+ raise Socket_Error with
Err_Code_Image (Error)
- & C.Strings.Value (Socket_Error_Message (Error)));
+ & C.Strings.Value (Socket_Error_Message (Error));
end Raise_Socket_Error;
----------
Len := V1'Size / 8;
Add := V1'Address;
- when Multicast_Loop =>
+ when Multicast_Loop |
+ Receive_Packet_Info =>
V1 := C.unsigned_char (Boolean'Pos (Option.Enabled));
Len := V1'Size / 8;
Add := V1'Address;
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2007, AdaCore --
+-- Copyright (C) 2001-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- a boolean to enable or disable this option.
type Option_Name is (
- Keep_Alive, -- Enable sending of keep-alive messages
- Reuse_Address, -- Allow bind to reuse local address
- Broadcast, -- Enable datagram sockets to recv/send broadcasts
- Send_Buffer, -- Set/get the maximum socket send buffer in bytes
- Receive_Buffer, -- Set/get the maximum socket recv buffer in bytes
- Linger, -- Shutdown wait for msg to be sent or timeout occur
- Error, -- Get and clear the pending socket error
- No_Delay, -- Do not delay send to coalesce packets (TCP_NODELAY)
- Add_Membership, -- Join a multicast group
- Drop_Membership, -- Leave a multicast group
- Multicast_If, -- Set default outgoing interface for multicast packets
- Multicast_TTL, -- Indicate the time-to-live of sent multicast packets
- Multicast_Loop, -- Sent multicast packets are looped to local socket
- Send_Timeout, -- Set timeout value for output
- Receive_Timeout); -- Set timeout value for input
+ Keep_Alive, -- Enable sending of keep-alive messages
+ Reuse_Address, -- Allow bind to reuse local address
+ Broadcast, -- Enable datagram sockets to recv/send broadcasts
+ Send_Buffer, -- Set/get the maximum socket send buffer in bytes
+ Receive_Buffer, -- Set/get the maximum socket recv buffer in bytes
+ Linger, -- Shutdown wait for msg to be sent or timeout occur
+ Error, -- Get and clear the pending socket error
+ No_Delay, -- Do not delay send to coalesce data (TCP_NODELAY)
+ Add_Membership, -- Join a multicast group
+ Drop_Membership, -- Leave a multicast group
+ Multicast_If, -- Set default out interface for multicast packets
+ Multicast_TTL, -- Set the time-to-live of sent multicast packets
+ Multicast_Loop, -- Sent multicast packets are looped to local socket
+ Receive_Packet_Info, -- Receive low level packet info as ancillary data
+ Send_Timeout, -- Set timeout value for output
+ Receive_Timeout); -- Set timeout value for input
type Option_Type (Name : Option_Name := Keep_Alive) is record
case Name is
- when Keep_Alive |
- Reuse_Address |
- Broadcast |
- Linger |
- No_Delay |
- Multicast_Loop =>
+ when Keep_Alive |
+ Reuse_Address |
+ Broadcast |
+ Linger |
+ No_Delay |
+ Receive_Packet_Info |
+ Multicast_Loop =>
Enabled : Boolean;
case Name is