Commit d4ba738c by Dmitriy Anisimkov Committed by Pierre-Marie de Rodat

[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
parent ae59bda9
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
......
......@@ -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,
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment