mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
Kernel: Convert network adapter names to Kernel::KString
Another step of incremental progress of removing `AK::String` from the kernel, to harden against OOM.
This commit is contained in:
parent
33a9f908a6
commit
2770433d30
16 changed files with 64 additions and 68 deletions
|
@ -50,7 +50,7 @@ public:
|
|||
|
||||
virtual StringView class_name() const = 0;
|
||||
|
||||
const String& name() const { return m_name; }
|
||||
StringView name() const { return m_name->view(); }
|
||||
MACAddress mac_address() { return m_mac_address; }
|
||||
IPv4Address ipv4_address() const { return m_ipv4_address; }
|
||||
IPv4Address ipv4_netmask() const { return m_ipv4_netmask; }
|
||||
|
@ -94,14 +94,11 @@ public:
|
|||
void send_packet(ReadonlyBytes);
|
||||
|
||||
protected:
|
||||
NetworkAdapter();
|
||||
void set_interface_name(const PCI::Address&);
|
||||
NetworkAdapter(NonnullOwnPtr<KString>);
|
||||
void set_mac_address(const MACAddress& mac_address) { m_mac_address = mac_address; }
|
||||
void did_receive(ReadonlyBytes);
|
||||
virtual void send_raw(ReadonlyBytes) = 0;
|
||||
|
||||
void set_loopback_name();
|
||||
|
||||
private:
|
||||
MACAddress m_mac_address;
|
||||
IPv4Address m_ipv4_address;
|
||||
|
@ -116,7 +113,7 @@ private:
|
|||
PacketList m_packet_queue;
|
||||
size_t m_packet_queue_size { 0 };
|
||||
PacketList m_unused_packets;
|
||||
String m_name;
|
||||
NonnullOwnPtr<KString> m_name;
|
||||
u32 m_packets_in { 0 };
|
||||
u32 m_bytes_in { 0 };
|
||||
u32 m_packets_out { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue