History log of /haiku/headers/private/net/ProtocolUtilities.h
Revision Date Author Comments
# 73eb0321 22-Nov-2023 Augustin Cavalier <waddlesplash@gmail.com>

net/ProtocolUtilities: Return EOPNOTSUPP when unhandled flags are specified.

Same as has already been done for UNIX domain sockets and TCP
(this is used in the implementation of UDP.)


# 42e4cb75 22-Nov-2023 Augustin Cavalier <waddlesplash@gmail.com>

net/ProtocolUtilities: Correct implementation of MSG_DONTWAIT.

We don't want to restore the timeout from a restarted syscall
if MSG_DONTWAIT has been specified.


# 1a84d6b3 04-May-2013 Philippe Houdoin <philippe.houdoin@gmail.com>

Skip timeout computation in is_syscall_restarted case.


# 4e78098e 03-May-2013 Axel Dörfler <axeld@pinc-software.de>

DatagramSocket: don't use absolute timeout 0.

* Use relative instead, or else the return value will be B_TIMED_OUT instead
of B_WOULD_BLOCK.
* This fixes bug #9734.


# 2651e51d 02-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed net_datalink_module::send_data() to send_routed_data(), and
send_datagram() to send_data().
* Renamed DatagramSocket::SocketEnqueue() to EnqueueClone(), SocketDequeue()
to Dequeue().
* Ordered the methods in ProtocolUtilities.h according to their declaration.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37870 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 690acf8b 03-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Got rid of _SocketEnqueue().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37867 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d62ee168 23-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Corrected naming/visibility of the DatagramSocket methods (protected methods
do not get the '_' prefix, only private ones do).
* Added a "peek" argument to SocketStatus() (and generally renamed "clone" to
"peek" where it made sense).
* Implemented the base version of SocketStatus() to return the actual socket
error. This enables returning ICMP errors back to the socket user.
* Other minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37712 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 866e21d3 21-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Moved DatagramSocket::Socket() up to its parent.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37645 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 65b5dd50 25-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* DatagramSocket::InitCheck() returned the sem_id instead of a status_t, causing
pings to fail (raw socket initialization) after r31079.
* Further cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31238 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c4c2a619 11-Oct-2008 Oliver Tappe <zooey@hirschkaefer.de>

* we no longer demand the socket that receives a broadcast
datagram to have the SO_BROADCAST flags set (the flag
is only needed for sending a broadcast) - fixes part of
#2065

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27973 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b07b8e0 28-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Replaced all instances of benaphores in the kernel code by mutexes.
* Removed kernel benaphores.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25690 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 05849428 17-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

axeld + bonefish:
* Added syscall restart support for connect(), accept(), send(), recv(),
which are implemented via ioctl()s. The actual restart support is done
in the net stack driver's ioctl() hook. Lower layers need to correctly
deal with socket timeouts, though, for which the stack module provides
support functions.
* TCPEndpoint::_WaitForEstablished() does abort now when an error
occurred earlier, so that trying to connect to an unused port fails
immediately, as it should.
* Fixed and refactored TCP connection reset handling. The new
TCPEndpoint::_HandleReset() does the job. Got rid of
TCPEndpoint::fError.
* Fixed sequence numbers for SYNC/FINI packets.
* The former two fix the problem that connections wouldn't be closed
correctly and could even be reused when trying to connect again (as
was reproducible with svnserve + svn).
* Some style cleanup in CPEndpoint.h.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23984 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15ab0bcf 21-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* int32_t, uint32_t are now of type "int", and no longer of type "long".
This should help to reduce the number of warnings imported code will throw
during compilation (helps a lot with tcpdump, for example).
* Since long is 64 bit on 64 bit platforms, we might want to think about doing
that change for the Haiku types int32 and uint32 as well.
* Fixed several occurences of hidden type problems.
* Fixed build of the stack and TCP under BeOS.
* Fixed incorrect typedef in socket_interface.h.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22643 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4b55736d 27-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

added new helper ProtocolSocket. Moved some stuff together to achieve better inlining.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20848 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74b0e858 19-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

merged a bit more of functionality into DatagramSocket so we don't require a custom ReadData in the link protocol.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20765 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 49f3c71e 13-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

respect SO_BROADCAST for received and sent datagrams.

- check if the destination address is specified in IPv4's SendData()
- minor cleanups to IPv4's TRACE()s.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20681 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 658a5506 13-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

use module_dependencies to load the required modules by udp, tcp, ipv4, icmp and arp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20676 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 57e2a3d5 12-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

only deliver frames to IPv4 raw sockets of the specified protocol.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20675 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d438fa4c 12-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

added buffer, datalink and socket module references to the stack module so we don't have to load them in each other module.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20673 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bfb45f71 12-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

introduced a new helper class DatagramSocket which provides a consistent base interface and functionality for the implementation of datagram-based sockets.

- made the ipv4 raw, udp and link protocols use DatagramSocket.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20672 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1a84d6b362cdb05577f739d1d0bdc06c9a23b197 04-May-2013 Philippe Houdoin <philippe.houdoin@gmail.com>

Skip timeout computation in is_syscall_restarted case.


# 4e78098e7c4508d8e72d02807a12f88ba74c3c85 03-May-2013 Axel Dörfler <axeld@pinc-software.de>

DatagramSocket: don't use absolute timeout 0.

* Use relative instead, or else the return value will be B_TIMED_OUT instead
of B_WOULD_BLOCK.
* This fixes bug #9734.


# 2651e51d92770a979fee2e99c4a4b27c3ac03e82 02-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed net_datalink_module::send_data() to send_routed_data(), and
send_datagram() to send_data().
* Renamed DatagramSocket::SocketEnqueue() to EnqueueClone(), SocketDequeue()
to Dequeue().
* Ordered the methods in ProtocolUtilities.h according to their declaration.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37870 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 690acf8bd2246f865df87cbb266c0a78f7f6d3ed 03-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Got rid of _SocketEnqueue().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37867 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d62ee168ed34ed29e6d11d84ea0712733ad1041f 23-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Corrected naming/visibility of the DatagramSocket methods (protected methods
do not get the '_' prefix, only private ones do).
* Added a "peek" argument to SocketStatus() (and generally renamed "clone" to
"peek" where it made sense).
* Implemented the base version of SocketStatus() to return the actual socket
error. This enables returning ICMP errors back to the socket user.
* Other minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37712 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 866e21d3a6f8a23a6ebc67201cca9a5221f74a3a 21-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

* Moved DatagramSocket::Socket() up to its parent.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37645 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 65b5dd506434be335f769b95531fafa1f184a6fb 25-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* DatagramSocket::InitCheck() returned the sem_id instead of a status_t, causing
pings to fail (raw socket initialization) after r31079.
* Further cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31238 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c4c2a6192da433dc769ea0323936aef1016fdf06 11-Oct-2008 Oliver Tappe <zooey@hirschkaefer.de>

* we no longer demand the socket that receives a broadcast
datagram to have the SO_BROADCAST flags set (the flag
is only needed for sending a broadcast) - fixes part of
#2065

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27973 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b07b8e0f1a7f1e76f31db24a21a42cbb01d7b9c 28-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Replaced all instances of benaphores in the kernel code by mutexes.
* Removed kernel benaphores.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25690 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 058494285aafd433af5618aeb52abd76a4b39c6a 17-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

axeld + bonefish:
* Added syscall restart support for connect(), accept(), send(), recv(),
which are implemented via ioctl()s. The actual restart support is done
in the net stack driver's ioctl() hook. Lower layers need to correctly
deal with socket timeouts, though, for which the stack module provides
support functions.
* TCPEndpoint::_WaitForEstablished() does abort now when an error
occurred earlier, so that trying to connect to an unused port fails
immediately, as it should.
* Fixed and refactored TCP connection reset handling. The new
TCPEndpoint::_HandleReset() does the job. Got rid of
TCPEndpoint::fError.
* Fixed sequence numbers for SYNC/FINI packets.
* The former two fix the problem that connections wouldn't be closed
correctly and could even be reused when trying to connect again (as
was reproducible with svnserve + svn).
* Some style cleanup in CPEndpoint.h.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23984 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15ab0bcf01ef7bd7323d9b2da55906bafbb40fd3 21-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* int32_t, uint32_t are now of type "int", and no longer of type "long".
This should help to reduce the number of warnings imported code will throw
during compilation (helps a lot with tcpdump, for example).
* Since long is 64 bit on 64 bit platforms, we might want to think about doing
that change for the Haiku types int32 and uint32 as well.
* Fixed several occurences of hidden type problems.
* Fixed build of the stack and TCP under BeOS.
* Fixed incorrect typedef in socket_interface.h.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22643 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4b55736dde3c03e6732d2d550b53218b35c37e21 27-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

added new helper ProtocolSocket. Moved some stuff together to achieve better inlining.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20848 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74b0e8584522bf131e46c544e9abbd3ee4a21011 19-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

merged a bit more of functionality into DatagramSocket so we don't require a custom ReadData in the link protocol.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20765 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 49f3c71e21b3b4f09905bf967b84e909fa24cd2b 13-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

respect SO_BROADCAST for received and sent datagrams.

- check if the destination address is specified in IPv4's SendData()
- minor cleanups to IPv4's TRACE()s.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20681 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 658a550639d1b3ec33c934583d065c81bee46298 13-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

use module_dependencies to load the required modules by udp, tcp, ipv4, icmp and arp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20676 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 57e2a3d5842686e03674ee3f61b1740d56034960 12-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

only deliver frames to IPv4 raw sockets of the specified protocol.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20675 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d438fa4c124c7dd113ccfb6f9badae5d18354af0 12-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

added buffer, datalink and socket module references to the stack module so we don't have to load them in each other module.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20673 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bfb45f717c648c5cd68e84c8ca1f805d099ba3c5 12-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

introduced a new helper class DatagramSocket which provides a consistent base interface and functionality for the implementation of datagram-based sockets.

- made the ipv4 raw, udp and link protocols use DatagramSocket.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20672 a95241bf-73f2-0310-859d-f6bbb57e9c96