OSDN Git Service

2008-03-26 Thomas Quinot <quinot@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Mar 2008 07:34:57 +0000 (07:34 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Mar 2008 07:34:57 +0000 (07:34 +0000)
PR ada/33688

* g-socket.ads, g-socket.adb (Options, Set_Socket_Option,
Get_Socket_Option): Add support for Receive_Packet_Info.

* g-soccon.ads, g-soccon-tru64.ads, g-soccon-aix.ads,
g-soccon-irix.ads, g-soccon-hpux.ads, g-soccon-solaris.ads,
g-soccon-vms.ads, g-soccon-mingw.ads, g-soccon-freebsd.ads,
g-soccon-hpux-ia64.ads, g-soccon-solaris-64.ads, g-soccon-darwin.ads,
g-soccon-lynxos.ads, g-soccon-linux-64.ads, g-soccon-linux-x86.ads: Add
new constants SO_REUSEPORT and IP_PKTINFO

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133545 138bc75d-0d04-0410-961f-82ee72b054a4

17 files changed:
gcc/ada/g-soccon-aix.ads
gcc/ada/g-soccon-darwin.ads
gcc/ada/g-soccon-freebsd.ads
gcc/ada/g-soccon-hpux-ia64.ads
gcc/ada/g-soccon-hpux.ads
gcc/ada/g-soccon-irix.ads
gcc/ada/g-soccon-linux-64.ads
gcc/ada/g-soccon-linux-x86.ads
gcc/ada/g-soccon-lynxos.ads
gcc/ada/g-soccon-mingw.ads
gcc/ada/g-soccon-solaris-64.ads
gcc/ada/g-soccon-solaris.ads
gcc/ada/g-soccon-tru64.ads
gcc/ada/g-soccon-vms.ads
gcc/ada/g-soccon.ads
gcc/ada/g-socket.adb
gcc/ada/g-socket.ads

index f96cad4..b1f6376 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index 7d82375..b48c4df 100644 (file)
@@ -35,7 +35,7 @@
 --  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.
 
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -182,7 +183,7 @@ package GNAT.Sockets.Constants is
    -- 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 --
index 045c8a0..c07fc18 100644 (file)
@@ -35,7 +35,7 @@
 --  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.
 
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index 04cfc15..3caa99c 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index d226217..9be66ad 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index 7beb802..1f36754 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index 5c2946b..0cbafed 100644 (file)
@@ -35,7 +35,7 @@
 --  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.
 
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index cb42441..ca1418f 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index 851bfbe..f93e88e 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index 3e612a1..dc39f81 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
@@ -184,13 +186,6 @@ package GNAT.Sockets.Constants is
 
    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 --
    ------------------------------
@@ -203,4 +198,11 @@ package GNAT.Sockets.Constants is
    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;
index 46300e0..5f57e17 100644 (file)
@@ -35,7 +35,7 @@
 --  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.
 
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index 26638a9..4b433bf 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index 5537151..8e16fbe 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index a8aff61..44b8523 100644 (file)
@@ -149,6 +149,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -162,6 +163,7 @@ package GNAT.Sockets.Constants is
    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 --
index 6890c65..b57711d 100644 (file)
@@ -156,6 +156,7 @@ package GNAT.Sockets.Constants is
 
    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
@@ -169,6 +170,7 @@ package GNAT.Sockets.Constants is
    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 --
index 04cfdd7..e491eed 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 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- --
@@ -87,21 +87,24 @@ package body GNAT.Sockets is
                  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
@@ -865,8 +868,7 @@ package body GNAT.Sockets is
 
    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
@@ -892,8 +894,7 @@ package body GNAT.Sockets is
         (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
@@ -946,8 +947,9 @@ package body GNAT.Sockets is
 
    begin
       case Name is
-         when Multicast_Loop  |
-              Multicast_TTL   =>
+         when Multicast_Loop      |
+              Multicast_TTL       |
+              Receive_Packet_Info =>
             Len := V1'Size / 8;
             Add := V1'Address;
 
@@ -1015,7 +1017,8 @@ package body GNAT.Sockets is
          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    |
@@ -1320,9 +1323,9 @@ package body GNAT.Sockets is
 
    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;
 
    ------------------------
@@ -1332,9 +1335,9 @@ package body GNAT.Sockets is
    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;
 
    ----------
@@ -1795,7 +1798,8 @@ package body GNAT.Sockets is
             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;
index cbbb133..105f285 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 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- --
@@ -623,30 +623,32 @@ package GNAT.Sockets is
    --  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