ladybird/Kernel/Net
Tom 75f61fe3d9 AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe
This makes most operations thread safe, especially so that they
can safely be used in the Kernel. This includes obtaining a strong
reference from a weak reference, which now requires an explicit
call to WeakPtr::strong_ref(). Another major change is that
Weakable::make_weak_ref() may require the explicit target type.
Previously we used reinterpret_cast in WeakPtr, assuming that it
can be properly converted. But WeakPtr does not necessarily have
the knowledge to be able to do this. Instead, we now ask the class
itself to deliver a WeakPtr to the type that we want.

Also, WeakLink is no longer specific to a target type. The reason
for this is that we want to be able to safely convert e.g. WeakPtr<T>
to WeakPtr<U>, and before this we just reinterpret_cast the internal
WeakLink<T> to WeakLink<U>, which is a bold assumption that it would
actually produce the correct code. Instead, WeakLink now operates
on just a raw pointer and we only make those constructors/operators
available if we can verify that it can be safely cast.

In order to guarantee thread safety, we now use the least significant
bit in the pointer for locking purposes. This also means that only
properly aligned pointers can be used.
2020-11-10 19:11:52 +01:00
..
ARP.h AK: Add Endian.h header to replace NetworkOrdered.h. 2020-08-25 16:22:14 +02:00
E1000NetworkAdapter.cpp Kernel: Add more detailed debug output for E1000 {in,out}{8,16,32} 2020-08-31 18:54:04 +02:00
E1000NetworkAdapter.h Kernel: Use AK::Span a bunch in the network adapter code 2020-07-28 20:19:22 +02:00
EthernetFrameHeader.h AK: Add Endian.h header to replace NetworkOrdered.h. 2020-08-25 16:22:14 +02:00
EtherType.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
ICMP.h Meta+Kernel: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
IPv4.h AK: Add Endian.h header to replace NetworkOrdered.h. 2020-08-25 16:22:14 +02:00
IPv4Socket.cpp IPv4: Include IP headers when receiving from a raw socket 2020-10-31 13:56:21 +01:00
IPv4Socket.h Kernel: Plumb packet receive timestamp from NetworkAdapter to Socket::recvfrom 2020-09-17 17:23:01 +02:00
IPv4SocketTuple.h SinglyLinkedList: Remove unused includes 2020-10-08 09:54:41 +02:00
LocalSocket.cpp Kernel: Plumb packet receive timestamp from NetworkAdapter to Socket::recvfrom 2020-09-17 17:23:01 +02:00
LocalSocket.h Kernel: Plumb packet receive timestamp from NetworkAdapter to Socket::recvfrom 2020-09-17 17:23:01 +02:00
LoopbackAdapter.cpp Kernel: Switch singletons to use new Singleton class 2020-08-25 09:48:48 +02:00
LoopbackAdapter.h Kernel: Switch singletons to use new Singleton class 2020-08-25 09:48:48 +02:00
NetworkAdapter.cpp Meta+Kernel: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
NetworkAdapter.h Kernel: Plumb packet receive timestamp from NetworkAdapter to Socket::recvfrom 2020-09-17 17:23:01 +02:00
NetworkTask.cpp IPv4: Take the socket lock more (fixes TCP connection to localhost) 2020-10-21 20:51:02 +02:00
NetworkTask.h Kernel: Move NetworkTask startup into NetworkTask::spawn() 2020-04-09 13:31:05 +02:00
Routing.cpp Kernel: Switch singletons to use new Singleton class 2020-08-25 09:48:48 +02:00
Routing.h Kernel: Add the SO_BINDTODEVICE socket option 2020-04-05 09:50:48 +02:00
RTL8139NetworkAdapter.cpp Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
RTL8139NetworkAdapter.h Kernel: Use AK::Span a bunch in the network adapter code 2020-07-28 20:19:22 +02:00
Socket.cpp IPv4: Take the socket lock more (fixes TCP connection to localhost) 2020-10-21 20:51:02 +02:00
Socket.h Kernel+LibC+UserspaceEmulator: Add SO_TIMESTAMP, and cmsg definitions 2020-09-17 17:23:01 +02:00
TCP.h TCP: Remove unnecessarily defined constructor and destructor 2020-10-08 10:01:10 +02:00
TCPSocket.cpp AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
TCPSocket.h AK: Make RefPtr, NonnullRefPtr, WeakPtr thread safe 2020-11-10 19:11:52 +01:00
UDP.h Meta+Kernel: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
UDPSocket.cpp Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00
UDPSocket.h Kernel: Make copy_to/from_user safe and remove unnecessary checks 2020-09-13 21:19:15 +02:00