1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

Kernel/Net: Make interfaces to have persistent names

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).
This commit is contained in:
Liav A 2021-05-22 01:35:46 +03:00 committed by Linus Groh
parent 1c6d2ff21c
commit 8d0280ca09
6 changed files with 19 additions and 13 deletions

View file

@ -17,6 +17,7 @@
#include <Kernel/Net/ARP.h>
#include <Kernel/Net/ICMP.h>
#include <Kernel/Net/IPv4.h>
#include <Kernel/PCI/Definitions.h>
#include <Kernel/UserOrKernelBuffer.h>
namespace Kernel {
@ -73,11 +74,13 @@ public:
protected:
NetworkAdapter();
void set_interface_name(const StringView& basename);
void set_interface_name(const PCI::Address&);
void set_mac_address(const MACAddress& mac_address) { m_mac_address = mac_address; }
virtual void send_raw(ReadonlyBytes) = 0;
void did_receive(ReadonlyBytes);
void set_loopback_name();
private:
static Lockable<HashTable<NetworkAdapter*>>& all_adapters();