History log of /haiku/headers/private/net/net_stack.h
Revision Date Author Comments
# 4cde5cc2 01-Jul-2011 Michael Lotz <mmlr@mlotz.ch>

* Fix binding to link level sockets. The bound type was constructed using the
sdl_e_type in network byte order, causing such a socket not to receive
anything.
When working around that by not using htons() on bind, sending would then fail
on such a socket because the byte order is actually required to be swapped
there.
* Extend the comment for the B_NET_FRAME_TYPE macro to document that the input
types are supposed to be in host byte order to avoid future confusion.


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


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

* Introduced a datalink layer (2) independent way of specifying the packet
type one wants to receive. Changed ipv6_datagram to use that (but note that
it currently does not compile).
* Header cleanup.


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


# 491da20d 19-Sep-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a is_timer_running() function.


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


# 8f3c0d9f 17-Sep-2008 Axel Dörfler <axeld@pinc-software.de>

* wait_for_timer() now returns a status code.
* wait_for_timer() now detects if it has been called from within the timer
execution thread, and will return in error instead of waiting for itself
forever. This fixes bug #2682.


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


# 9e8be8bb 15-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a net_timer::flags field, and used it to implement the new
wait_for_timer() function.
* Moved the internal Fifo class into utility.cpp - we should probably just
remove it again.
* Fixed uninit_timers() so that it would even work in combination with the
timer thread if there are timers left to be scheduled.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26980 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


# 49e00d1f 02-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved the container management for ancillary data from the net_buffer
module to the stack module. There's a dedicated struct
ancillary_data_container, now. One can just set the container on a
net_buffer.


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


# 75015ff5 11-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed THREAD_FLAGS_IOCTL_SYSCALL to THREAD_FLAGS_SYSCALL,
syscall_restart_ioctl_is_restarted() to syscall_restart_is_restarted,
IoctlSyscallFlagUnsetter to SyscallFlagUnsetter, and
IoctlSyscallRestartWrapper to SyscallRestartWrapper, as they are no
longer only used for ioctl().
* Removed unused syscall_restart_ioctl_handle_post().
* Made SyscallRestartWrapper a lot fancier. Instead of storing a
reference to the result value, it stores the value itself, and it
features all the interesting operators that make it appear like that
value. This simplifies the use of the class quite a bit.
* THREAD_FLAGS_SYSCALL is now set for all socket function and the
read[v](), write[v]() syscalls.
* Added is_syscall() function and net_stack hook to the net stack.
* Removed "kernel" parameter from all net_stack_interface and net_socket
module hooks. They aren't need any longer, since is_syscall() can be
used instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24914 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


# 969885b8 23-May-2007 Hugo Santos <hugosantos@nowhere.fake>

loop: no longer requires a reader thread, it delivers directly to the device's receive queue


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


# 6d043beb 03-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: added mii placeholders, callout implementation.


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


# 8a819b17 19-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

retrieve the incoming interface on the domain_receive_adapter(). This should fix potential issues with packets addressed to the IP broadcast address, such as in with some DHCP implementations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20767 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


# 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


# e53357d5 08-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

Prepared net_device_monitor to accept device removal events.

- Introduced public net_device_monitor.
- Changed the link protocol to maintain a lock per instance instead of inside the FIFO. Now all of the link instance data is protected.
- Adapted the link protocol to use net_device_monitor.
- Introduced a private Fifo class which doesn't maintain it's own lock.
- Maybe we should add something like a public net_protocol_implementation which maintains a fifo and a benaphore? With the fifo using the structure's lock instead of maintaining it's own.


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


# 0d5afa4d 05-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

introduced fifo_socket_enqueue_buffer which clones the buffer, enqueues it to the fifo and notifies the socket.

- changed the link, ipv4 and udp modules to use fifo_socket_enqueue_buffer


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


# 9206bb37 04-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Changed ETHER_GET_LINK_STATE ethernet driver interface, added ETHER_SET_LINK_STATE_SEM.
* The device interface list now uses class DoublyLinkedList instead of struct list.
* Implemented SIOC[SG]IFMEDIA for setting (not supported by any device yet), and
retrieving the device media information.
* Fixed a locking bug in list_domain_interfaces().
* Added new stack function device_link_changed() that should be called in case the
link state (media) changed.
* The ethernet device module now spawns a thread and will periodically check the media
state of all ethernet devices that support this (if any).
* Minor cleanup.


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


# 2bd388f6 29-Nov-2006 Axel Dörfler <axeld@pinc-software.de>

Added two more utility functions to the timer service:
* cancel_timer() cancels a timer, and returns true if the timer was running
* is_timer_active() determines if the timer is currently running or not.


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


# a7028ce6 06-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented select support for sockets and notifications, not yet tested, though;
this closes ticket #811.
* Added notification support to IPv4 and UDP.
* Implemented reading out SO_ERROR.


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


# c22d69bf 08-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

* Completed the previous commit and merger of the team/network/new_stack branch.
* Removed ppp_up and pppcontrol from the image for now.


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


# 4cde5cc2281605a6aae698448132d807011cab79 01-Jul-2011 Michael Lotz <mmlr@mlotz.ch>

* Fix binding to link level sockets. The bound type was constructed using the
sdl_e_type in network byte order, causing such a socket not to receive
anything.
When working around that by not using htons() on bind, sending would then fail
on such a socket because the byte order is actually required to be swapped
there.
* Extend the comment for the B_NET_FRAME_TYPE macro to document that the input
types are supposed to be in host byte order to avoid future confusion.


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


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

* Introduced a datalink layer (2) independent way of specifying the packet
type one wants to receive. Changed ipv6_datagram to use that (but note that
it currently does not compile).
* Header cleanup.


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


# 491da20dbf296d9fdf44ae5fffde54f254059f4d 19-Sep-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a is_timer_running() function.


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


# 8f3c0d9fcc9be04b38f8a9fee6ff315d8710ef76 17-Sep-2008 Axel Dörfler <axeld@pinc-software.de>

* wait_for_timer() now returns a status code.
* wait_for_timer() now detects if it has been called from within the timer
execution thread, and will return in error instead of waiting for itself
forever. This fixes bug #2682.


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


# 9e8be8bb9c7c2f02c2b109654c4bdab659654a82 15-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a net_timer::flags field, and used it to implement the new
wait_for_timer() function.
* Moved the internal Fifo class into utility.cpp - we should probably just
remove it again.
* Fixed uninit_timers() so that it would even work in combination with the
timer thread if there are timers left to be scheduled.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26980 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


# 49e00d1f99fa525355674427039e360eb96c574b 02-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved the container management for ancillary data from the net_buffer
module to the stack module. There's a dedicated struct
ancillary_data_container, now. One can just set the container on a
net_buffer.


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


# 75015ff525050d1d716f499732c566956c6078ad 11-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed THREAD_FLAGS_IOCTL_SYSCALL to THREAD_FLAGS_SYSCALL,
syscall_restart_ioctl_is_restarted() to syscall_restart_is_restarted,
IoctlSyscallFlagUnsetter to SyscallFlagUnsetter, and
IoctlSyscallRestartWrapper to SyscallRestartWrapper, as they are no
longer only used for ioctl().
* Removed unused syscall_restart_ioctl_handle_post().
* Made SyscallRestartWrapper a lot fancier. Instead of storing a
reference to the result value, it stores the value itself, and it
features all the interesting operators that make it appear like that
value. This simplifies the use of the class quite a bit.
* THREAD_FLAGS_SYSCALL is now set for all socket function and the
read[v](), write[v]() syscalls.
* Added is_syscall() function and net_stack hook to the net stack.
* Removed "kernel" parameter from all net_stack_interface and net_socket
module hooks. They aren't need any longer, since is_syscall() can be
used instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24914 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


# 969885b848f0c40027ab6b13df58b4f656e6274f 23-May-2007 Hugo Santos <hugosantos@nowhere.fake>

loop: no longer requires a reader thread, it delivers directly to the device's receive queue


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


# 6d043beb03c572d3fd2f6995c83e13516913790a 03-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: added mii placeholders, callout implementation.


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


# 8a819b17e4ebb40461954432b6b8cfb29946b32f 19-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

retrieve the incoming interface on the domain_receive_adapter(). This should fix potential issues with packets addressed to the IP broadcast address, such as in with some DHCP implementations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20767 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


# 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


# e53357d57adc145e4c36a3dc35cecde8bea07297 08-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

Prepared net_device_monitor to accept device removal events.

- Introduced public net_device_monitor.
- Changed the link protocol to maintain a lock per instance instead of inside the FIFO. Now all of the link instance data is protected.
- Adapted the link protocol to use net_device_monitor.
- Introduced a private Fifo class which doesn't maintain it's own lock.
- Maybe we should add something like a public net_protocol_implementation which maintains a fifo and a benaphore? With the fifo using the structure's lock instead of maintaining it's own.


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


# 0d5afa4decb83fc03232a420d85c7838f70d2266 05-Apr-2007 Hugo Santos <hugosantos@nowhere.fake>

introduced fifo_socket_enqueue_buffer which clones the buffer, enqueues it to the fifo and notifies the socket.

- changed the link, ipv4 and udp modules to use fifo_socket_enqueue_buffer


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


# 9206bb37797df1a6448d3f1c336e954b4ddb790d 04-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Changed ETHER_GET_LINK_STATE ethernet driver interface, added ETHER_SET_LINK_STATE_SEM.
* The device interface list now uses class DoublyLinkedList instead of struct list.
* Implemented SIOC[SG]IFMEDIA for setting (not supported by any device yet), and
retrieving the device media information.
* Fixed a locking bug in list_domain_interfaces().
* Added new stack function device_link_changed() that should be called in case the
link state (media) changed.
* The ethernet device module now spawns a thread and will periodically check the media
state of all ethernet devices that support this (if any).
* Minor cleanup.


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


# 2bd388f69679fcc496cb2c376d7ec5ec20be6f72 29-Nov-2006 Axel Dörfler <axeld@pinc-software.de>

Added two more utility functions to the timer service:
* cancel_timer() cancels a timer, and returns true if the timer was running
* is_timer_active() determines if the timer is currently running or not.


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


# a7028ce6802b20c7fea03c8b4defa0770a50b850 06-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented select support for sockets and notifications, not yet tested, though;
this closes ticket #811.
* Added notification support to IPv4 and UDP.
* Implemented reading out SO_ERROR.


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


# c22d69bf1f5f60f7ebddd79108a53c8f97f300fe 08-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

* Completed the previous commit and merger of the team/network/new_stack branch.
* Removed ppp_up and pppcontrol from the image for now.


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