summaryrefslogtreecommitdiff
path: root/Kernel/Net
AgeCommit message (Collapse)Author
2020-03-15Userland: ifconfig can change the IP address of the default gatewaymarprok
ioctl can now perform a request for a specific route and change the address of it's default gateway.
2020-03-11Userland: Set the mask of a network adapter with ifconfig (#1388)Marios Prokopakis
A new IP address or a new network mask can be specified in the command line arguments of ifconfig to replace the old values of a given network adapter. Additionally, more information is being printed for each adapter.
2020-03-09PCI: Enable LogStream output for addressesLiav A
2020-03-08Kernel: Ensure RTL8139NetworkAdapter uses virtual memory correctlyLiav A
2020-03-08Kernel: Ensure E1000NetworkAdapter uses virtual memory correctlyLiav A
2020-03-08AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)Andreas Kling
Use this instead of uintptr_t throughout the codebase. This makes it possible to pass a FlatPtr to something that has u32 and u64 overloads.
2020-03-07IPv4: Keep IPv4 socket locked during receive operationsAndreas Kling
We unlock/relock around blocking, but outside of that we now keep the socket locked. This fixes an intermittent ASSERT(m_can_read) failure.
2020-03-06Kernel: Change HandlerPurpose to HandlerTypeLiav A
Also, GenericInterruptHandler class requires to implement two new methods.
2020-03-02Kernel: Use klog() instead of kprintf()Liav A
Also, duplicate data in dbg() and klog() calls were removed. In addition, leakage of virtual address to kernel log is prevented. This is done by replacing kprintf() calls to dbg() calls with the leaked data instead. Also, other kprintf() calls were replaced with klog().
2020-03-02Kernel: Use IOAddress class in Network adapters' driversLiav A
Also, kprintf() calls were replaced with klog() calls.
2020-03-01Kernel: Remove some unnecessary .characters() when doing dbg()<<StringAndreas Kling
2020-02-27E1000NetworkAdapter: Use dbg() instead of dbgprintf()Liav A
2020-02-27LoopbackAdapter: Use dbg() instead of dbgprintf()Liav A
2020-02-27IPv4Socket: Use dbg() instead of dbgprintf()Liav A
2020-02-25AK: Make Vector use size_t for its size and capacityAndreas Kling
2020-02-24Kernel: Change get_pci_address() to pci_address() in PCI::Device classLiav A
The Serenity Coding Style tends to not accept the word "get" in methods' names if possible.
2020-02-24Kernel: Update Network adapter classes to use the PCI::Device classLiav A
Those classes will inherit from the PCI::Device class, thus, they can still implement IRQ handling.
2020-02-17Kernel: Replace "current" with Thread::current and Process::currentAndreas Kling
Suggested by Sergey. The currently running Thread and Process are now Thread::current and Process::current respectively. :^)
2020-02-16Kernel: More header dependency reduction workAndreas Kling
2020-02-16Kernel: Reduce header dependencies of MemoryManager and RegionAndreas Kling
2020-02-16Kernel: Move all code into the Kernel namespaceAndreas Kling
2020-02-10AK: Remove bitrotted Traits::dump() mechanismAndreas Kling
This was only used by HashTable::dump() which I used when doing the first HashTable implementation. Removing this allows us to also remove most includes of <AK/kstdio.h>.
2020-02-09Kernel: Apply changes to use LibBareMetal definitionsLiav A
2020-02-09Net: Short-circuit routing to the IPv4 address of a local adapterAndreas Kling
This makes it possible to open http://localhost:8000/ in Browser. :^)
2020-02-09Net: When routing to loopback, use the loopback adapter's MAC addressAndreas Kling
Otherwise the routing decision gets interpreted as "host unreachable."
2020-02-09Net: Give the LoopbackAdapter a MAC addressAndreas Kling
Since the routing code currently interprets an all-zero MAC address as an invalid next hop, let's give the loopback adapter an address.
2020-02-08IPv4: Put some TCP close handshake debug spam behind TCP_SOCKET_DEBUGAndreas Kling
2020-02-08IPv4: Sockets should say can_read() after reading is shut downAndreas Kling
This allows clients to get their EOF after shutting down reading.
2020-02-08IPv4: Basic implementation of TCP socket shutdownAndreas Kling
We can now participate in the TCP connection closing handshake. :^) This implementation is definitely not complete and needs to handle a bunch of other cases. But it's a huge improvement over not being able to close connections at all. Note that we hold on to pending-close sockets indefinitely, until they are moved into the Closed state. This should also have a timeout but that's still a FIXME. :^) Fixes #428.
2020-02-08IPv4: Don't ACK empty TCP packetsAndreas Kling
Wireshark was complaining about duplicate ACK's and this was why.
2020-02-08IPv4: Split IPv4Socket::recvfrom() into packet/byte buffered functionsAndreas Kling
This code was really hard to follow since it handles two separate modes of buffering the data.
2020-02-08IPv4: Send TCP packets right away instead of waiting to "retry"Andreas Kling
Also be more explicit about zero-initializing OutgoingPacket objects.
2020-02-08IPv4: Drop incoming packets on sockets that are shut down for readingAndreas Kling
2020-02-08Net: Add a basic sys$shutdown() implementationAndreas Kling
Calling shutdown prevents further reads and/or writes on a socket. We should do a few more things based on the type of socket, but this initial implementation just puts the basic mechanism in place. Work towards #428.
2020-02-08Net: Make NetworkAdapter reference-countedAndreas Kling
The idea behind WeakPtr<NetworkAdapter> was to support hot-pluggable network adapters, but on closer thought, that's super impractical so let's not go down that road.
2020-02-07Kernel: Fix three broken format strings in Socket::{get,set}sockopt()Andreas Kling
These had more %'s than actual arguments, oops!
2020-02-07Kernel: Truncate addresses stored by getsockname() and getpeername()Andreas Kling
If there's not enough space in the output buffer for the whole sockaddr we now simply truncate the address instead of returning EINVAL. This patch also makes getpeername() actually return the peer address rather than the local address.. :^)
2020-02-02Kernel: Detect devices when enumerating the PCI busLiav A
Instead of making each driver to enumerate the PCI bus itself, PCI::Initializer will call detect_devices() to do one enumeration of the bus.
2020-01-30Kernel: LocalSocket should fail with EADDRINUSE for already-bound filesAndreas Kling
2020-01-30Kernel: Some more int => size_t in NetworkAdapter and subclassesAndreas Kling
2020-01-29Kernel: Make IPv4Socket::protocol_send() use a size_t for buffer sizeAndreas Kling
2020-01-26Kernel: read()/write() should respect timeouts when used on a socketsAndreas Kling
Move timeout management to the ReadBlocker and WriteBlocker classes. Also get rid of the specialized ReceiveBlocker since it no longer does anything that ReadBlocker can't do.
2020-01-26IPv4: Mark UDP sockets as connected immediately upon connect()Andreas Kling
This makes it possible to write() to a blocking UDPSocket. Previously this was not possible since can_write() depends on is_connected().
2020-01-26IPv4: Fix bitrot in IPv4Socket debug loggingAndreas Kling
2020-01-26IPv4: Don't hold IPv4Socket lock when blocking on byte-buffered receiveAndreas Kling
2020-01-26Kernel: Zero-initialize LocalSocket::m_addressAndreas Kling
It was possible to read uninitialized kernel memory via getsockname(). Of course, kmalloc() is a good boy and scrubs new allocations with 0xBB so all you got was a bunch of 0xBB.
2020-01-23Kernel: Allow Socket subclasses to fail constructionAndreas Kling
For example, socket(AF_INET) should only succeed for valid SOCK_TYPEs.
2020-01-22Revert "Kernel: Replace IRQHandler with the new InterruptHandler class"Andreas Kling
This reverts commit 6c72736b26a81a8f03d8dd47989bfffe26bb1c95. I am unable to boot on my home machine with this change in the tree.
2020-01-22Kernel: Replace IRQHandler with the new InterruptHandler classLiav A
System components that need an IRQ handling are now inheriting the InterruptHandler class. In addition to that, the initialization process of PATAChannel was changed to fit the changes. PATAChannel, E1000NetworkAdapter and RTL8139NetworkAdapter are now inheriting from PCI::Device instead of InterruptHandler directly.
2020-01-21Kernel: Make O_RDONLY non-zeroAndreas Kling
Sergey suggested that having a non-zero O_RDONLY would make some things less confusing, and it seems like he's right about that. We can now easily check read/write permissions separately instead of dancing around with the bits. This patch also fixes unveil() validation for O_RDWR which previously forgot to check for "r" permission.