summaryrefslogtreecommitdiff
path: root/Kernel/Net/LoopbackAdapter.h
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-06-04 07:43:16 +0300
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-06-09 22:44:09 +0430
commit1c94b5e8eb9723149a76ef54d38224c995c1a765 (patch)
treeaee54ac8ce3e7f2195f3a575aa8848e0e7635343 /Kernel/Net/LoopbackAdapter.h
parent8b1d4d1b8ea7cc0a801b097c977f4d39a39ba5aa (diff)
downloadserenity-1c94b5e8eb9723149a76ef54d38224c995c1a765.zip
Kernel: Introduce the NetworkingManagement singleton
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.
Diffstat (limited to 'Kernel/Net/LoopbackAdapter.h')
-rw-r--r--Kernel/Net/LoopbackAdapter.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Kernel/Net/LoopbackAdapter.h b/Kernel/Net/LoopbackAdapter.h
index ab5c3906f1..b7949793db 100644
--- a/Kernel/Net/LoopbackAdapter.h
+++ b/Kernel/Net/LoopbackAdapter.h
@@ -12,10 +12,12 @@ namespace Kernel {
class LoopbackAdapter final : public NetworkAdapter {
AK_MAKE_ETERNAL
-public:
+
+private:
LoopbackAdapter();
- static LoopbackAdapter& the();
+public:
+ static NonnullRefPtr<LoopbackAdapter> create();
virtual ~LoopbackAdapter() override;
virtual void send_raw(ReadonlyBytes) override;