Commit graph

32 commits

Author SHA1 Message Date
Andreas Kling
649c81a714 Kernel: Move networking related files into Kernel/Net/. 2019-04-02 19:54:38 +02:00
Andreas Kling
718bea73b3 Kernel: Add a LoopbackAdapter for talking to yourself via 127.0.0.1.
Choosing adapter for transmit is done by adapter_for_route_to(IPv4Address).
This is just hard-coded logic right now but can be expanded to support a
proper routing table.

Also start moving kernel networking code into Kernel/Net/.
2019-04-02 15:46:44 +02:00
Andreas Kling
bc1da7f1fd Kernel: Snooze the NetworkTask until there are incoming packets to process.
This is accomplished using a new Alarm class and a BlockedSnoozing state.
Basically, you call Process::snooze_until(some_alarm) and then the scheduler
won't wake up the process until some_alarm.is_ringing() returns true.
2019-03-20 17:09:46 +01:00
Andreas Kling
1c6dfc3282 AK: Make ByteBuffer's copy() and wrap() take void*.
This way we don't have to cast whatever we're passing to copy()/wrap().
2019-03-17 00:36:41 +01:00
Andreas Kling
313ee8dd19 Move Lock from AK to Kernel, since it only works inside the kernel. 2019-03-16 13:18:22 +01:00
Andreas Kling
f9569db1e5 TCP: Collect the payload if present in a packet with FIN set. 2019-03-14 15:28:23 +01:00
Andreas Kling
25e521f510 TCP: Start working on auto-closing connections when we get FIN. 2019-03-14 15:23:32 +01:00
Andreas Kling
edb986c276 IPv4: Factor out UDP parts of IPv4Socket into a UDPSocket class. 2019-03-14 12:43:18 +01:00
Andreas Kling
274b500bac IPv4: Move more stuff from IPv4Socket to TCPSocket. 2019-03-14 12:28:30 +01:00
Andreas Kling
d2176eddfc Kernel: Factor out TCP parts of IPv4Socket into a TCPSocket class. 2019-03-14 12:20:38 +01:00
Andreas Kling
8014473918 TCP: Update our side's ack number based on the other side's seq number. 2019-03-14 11:45:22 +01:00
Andreas Kling
54e7df0586 Kernel: Add SocketHandle helper class that wraps locked sockets.
This allows us to have a comfy IPv4Socket::from_tcp_port() API that returns
a socket that's locked and safe to access. No need to worry about locking
at the client site.
2019-03-14 09:19:24 +01:00
Andreas Kling
3d5296a901 IPv4: Last burst of TCP hacking for today.
Connecting to a test server and exchanging data back and forth works.
2019-03-14 01:44:42 +01:00
Andreas Kling
be46f1bb1f IPv4: More work on the TCP implementation.
Reading from the peer now kinda works. Something still going wrong with
sending packets but it's getting closer.
2019-03-14 01:00:10 +01:00
Andreas Kling
66d55f8e0c IPv4: More work on the TCP implementation.
I can now establish a connection to my little test server on the host.
2019-03-14 00:20:44 +01:00
Andreas Kling
032d9d7065 IPv4: More hacking on bringing up TCP support.
This was a bit more complicated than I expected, but it's moving forward.
2019-03-13 23:14:30 +01:00
Andreas Kling
c588653f76 IPv4: Begin fleshing out TCP support. 2019-03-13 17:17:07 +01:00
Andreas Kling
3ad9561b80 IPv4: Use the UDP-to-socket map to handle incoming UDP packets. 2019-03-13 16:23:22 +01:00
Andreas Kling
4dddf949c8 IPv4: More work on UDP support.
I'm now able to connect to a simple UDP server on my host machine and
exchange some data. Very cool! :^)
2019-03-13 15:40:30 +01:00
Andreas Kling
b59d588c04 Kernel: Start fleshing out an UDP implementation. 2019-03-13 14:22:27 +01:00
Andreas Kling
a7d5e9781a Kernel+LibC+Userland: Yet more networking bringup hacking.
All ICMP sockets now receive all ICMP packets. All this buffering is gonna
need some limits and such.
2019-03-12 17:27:07 +01:00
Andreas Kling
8e667747f0 Kernel: Add a way to look up NetworkAdapters by IPv4 address. 2019-03-12 13:30:36 +01:00
Andreas Kling
c6a2012fe9 Kernel: Collect IPv4 stuff in IPv4.h and ARP stuff in ARP.h. 2019-03-12 12:49:01 +01:00
Andreas Kling
87ecf290f4 Kernel: More work on the ICMP and IPv4 support. 2019-03-12 12:43:30 +01:00
Andreas Kling
9858be636f Kernel: Fix up the ICMP implementation to generate correct Echo replies.
Serenity now responds to ping. :^)
2019-03-12 11:44:38 +01:00
Andreas Kling
75e0ddd46a Kernel: More work on ICMP support.
We can now kinda sorta respond to ICMP::EchoRequest although there's
still something not entirely right with the packets.
2019-03-12 04:40:13 +01:00
Andreas Kling
5bd9844dd6 Kernel: Start adding IPv4 support, starting with ICMP echo messages.
This doesn't work correctly yet, but it's getting nice enough to commit.
2019-03-12 04:11:20 +01:00
Andreas Kling
d5dbb602b8 Kernel: Tidy up networking code with some named constants. 2019-03-12 01:30:49 +01:00
Andreas Kling
90f60d2f65 Kernel: Cache MAC<->IP mappings (from ARP responses) seen on the wire. 2019-03-12 00:56:33 +01:00
Andreas Kling
05c1a79454 Kernel: Minor style cleanup in NetworkTask. 2019-03-12 00:01:07 +01:00
Andreas Kling
318b01e055 Kernel: Bring up enough networking code that we can respond to ARP requests.
This is all pretty rickety but we can now respond to "arping" from the host
while running inside QEMU. Very cool. :^)
2019-03-11 23:21:38 +01:00
Andreas Kling
35098cbde1 Kernel: Add a NetworkTask and a received network packet queue.
It will be easier to deal with incoming packets in a separate task.
2019-03-11 12:43:45 +01:00