diff options
author | Dmitriy Anisimkov <anisimko@adacore.com> | 2019-07-11 08:02:26 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-07-11 08:02:26 +0000 |
commit | d4ba738c67e5579d5a0dff07f20b36f3df9529d5 (patch) | |
tree | 5c6be16187ae06db87aaa797a15653fc6f40038e | |
parent | ae59bda92bbab1a02562683dd54fb9c287307a9e (diff) | |
download | gcc-d4ba738c67e5579d5a0dff07f20b36f3df9529d5.zip gcc-d4ba738c67e5579d5a0dff07f20b36f3df9529d5.tar.gz gcc-d4ba738c67e5579d5a0dff07f20b36f3df9529d5.tar.bz2 |
[Ada] GNAT.Sockets: add support for RAW sockets
2019-07-11 Dmitriy Anisimkov <anisimko@adacore.com>
gcc/ada/
* libgnat/g-socket.ads (Mode_Type): Add a Socket_Raw enumerator.
* libgnat/g-socket.adb (Modes): Handle Socket_Raw.
From-SVN: r273393
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/libgnat/g-socket.adb | 3 | ||||
-rw-r--r-- | gcc/ada/libgnat/g-socket.ads | 9 |
3 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b51a3cc..e20d10c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-07-11 Dmitriy Anisimkov <anisimko@adacore.com> + + * libgnat/g-socket.ads (Mode_Type): Add a Socket_Raw enumerator. + * libgnat/g-socket.adb (Modes): Handle Socket_Raw. + 2019-07-11 Justin Squirek <squirek@adacore.com> * exp_ch9.adb (Build_Private_Protected_Declaration): Add diff --git a/gcc/ada/libgnat/g-socket.adb b/gcc/ada/libgnat/g-socket.adb index 2c9b8c7..689389f 100644 --- a/gcc/ada/libgnat/g-socket.adb +++ b/gcc/ada/libgnat/g-socket.adb @@ -77,7 +77,8 @@ package body GNAT.Sockets is Modes : constant array (Mode_Type) of C.int := (Socket_Stream => SOSC.SOCK_STREAM, - Socket_Datagram => SOSC.SOCK_DGRAM); + Socket_Datagram => SOSC.SOCK_DGRAM, + Socket_Raw => SOSC.SOCK_RAW); Shutmodes : constant array (Shutmode_Type) of C.int := (Shut_Read => SOSC.SHUT_RD, diff --git a/gcc/ada/libgnat/g-socket.ads b/gcc/ada/libgnat/g-socket.ads index 6db3c54..342577a 100644 --- a/gcc/ada/libgnat/g-socket.ads +++ b/gcc/ada/libgnat/g-socket.ads @@ -475,16 +475,17 @@ package GNAT.Sockets is -- The order of the enumeration elements should not be changed unilaterally -- because the IPv6_TCP_Preferred routine rely on it. - type Mode_Type is (Socket_Stream, Socket_Datagram); + type Mode_Type is (Socket_Stream, Socket_Datagram, Socket_Raw); -- Stream sockets provide connection-oriented byte streams. Datagram - -- sockets support unreliable connectionless message based communication. + -- sockets support unreliable connectionless message-based communication. + -- Raw sockets provide raw network-protocol access. -- The order of the enumeration elements should not be changed unilaterally - -- because the IPv6_TCP_Preferred routine rely on it. + -- because the IPv6_TCP_Preferred routine relies on it. type Shutmode_Type is (Shut_Read, Shut_Write, Shut_Read_Write); -- When a process closes a socket, the policy is to retain any data queued -- until either a delivery or a timeout expiration (in this case, the data - -- are discarded). A finer control is available through shutdown. With + -- are discarded). Finer control is available through shutdown. With -- Shut_Read, no more data can be received from the socket. With_Write, no -- more data can be transmitted. Neither transmission nor reception can be -- performed with Shut_Read_Write. |