summaryrefslogtreecommitdiff
path: root/Kernel/Net/LoopbackAdapter.cpp
AgeCommit message (Collapse)Author
2021-10-01Kernel: Convert network adapter names to Kernel::KStringBrian Gianforcaro
Another step of incremental progress of removing `AK::String` from the kernel, to harden against OOM.
2021-07-11Kernel: LoopbackAdapter::create() => try_create()Andreas Kling
Allow this to fail (although we VERIFY that it succeeds during boot for now, since we don't want to boot without a loopback adapter.)
2021-06-09Kernel: Introduce the NetworkingManagement singletonLiav A
Instead of initializing network adapters in init.cpp, let's move that logic into a separate class to handle this. Also, it seems like a good idea to shift responsiblity on enumeration of network adapters after the boot process, so this singleton will take care of finding the appropriate network adapter when asked to with an IPv4 address or interface name. With this change being merged, we simplify the creation logic of NetworkAdapter derived classes, so we enumerate the PCI bus only once, searching for driver candidates when doing so, and we let each driver to test if it is resposible for the specified PCI device.
2021-05-22Kernel/Net: Make interfaces to have persistent namesLiav A
There's no good reason to distinguish between network interfaces based on their model. It's probably a good idea to try keep the names more persistent so scripts written for a specific network interface will be useable after hotplug event (or after rebooting with new hardware setup).
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-01-11Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.Everything:
2020-08-25Kernel: Switch singletons to use new Singleton classTom
MemoryManager cannot use the Singleton class because MemoryManager::initialize is called before the global constructors are run. That caused the Singleton to be re-initialized, causing it to create another MemoryManager instance. Fixes #3226
2020-08-22Revert "Kernel: Switch singletons to use new Singleton class"Andreas Kling
This reverts commit f48feae0b2a300992479abf0b2ded85e45ac6045.
2020-08-22Revert "Kernel: Move Singleton class to AK"Andreas Kling
This reverts commit f0906250a181c831508a45434b9f645ff98f33e4.
2020-08-22Revert "AK: Get rid of make_singleton function"Andreas Kling
This reverts commit 5a98e329d157a2db8379e0c97c6bdc1328027843.
2020-08-22AK: Get rid of make_singleton functionTom
Just default the InitFunction template argument.
2020-08-22Kernel: Move Singleton class to AKTom
2020-08-21Kernel: Switch singletons to use new Singleton classTom
Fixes #3226
2020-07-28Kernel: Use AK::Span a bunch in the network adapter codeAndreas Kling
2020-02-27LoopbackAdapter: Use dbg() instead of dbgprintf()Liav A
2020-02-16Kernel: Move all code into the Kernel namespaceAndreas Kling
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-01-30Kernel: Some more int => size_t in NetworkAdapter and subclassesAndreas Kling
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2019-11-28Kernel+ifconfig: Add an MTU value to NetworkAdapterAndreas Kling
This defaults to 1500 for all adapters, but LoopbackAdapter increases it to 65536 on construction. If an IPv4 packet is larger than the MTU, we'll need to break it into smaller fragments before transmitting it. This part is a FIXME. :^)
2019-08-29Kernel: Remove IP configuration from LoopbackAdapterConrad Pankoff
This is configured in NetworkTask_main now, so there's no need to do it here as well.
2019-07-03AK: Rename the common integer typedefs to make it obvious what they are.Andreas Kling
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
2019-06-16Kernel+Userland: Expose list of network adapters through /proc/netadapters.Andreas Kling
Added a simple /bin/ifconfig program that just pretty-prints that file. :^)
2019-04-05AK: Revert Eternal<T> for now since it doesn't work as intended.Andreas Kling
2019-04-03AK: Add Eternal<T> and use it in various places.Andreas Kling
This is useful for static locals that never need to be destroyed: Thing& Thing::the() { static Eternal<Thing> the; return the; } The object will be allocated in data segment memory and will never have its destructor invoked.
2019-04-02Kernel: Add a LoopbackAdapter for talking to yourself via 127.0.0.1.Andreas Kling
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/.