Kernel: Stop exposing gateway field

It doesn't make sense after introduction of routing table which allows
having multiple gateways for every interface, and isn't used by any of
the userspace programs now.
This commit is contained in:
Maciej 2022-04-30 23:25:51 +02:00 committed by Andreas Kling
parent 06c90b35ec
commit 66ab4d61a4
Notes: sideshowbarker 2024-07-17 11:25:07 +09:00
4 changed files with 0 additions and 13 deletions

View file

@ -55,10 +55,6 @@ private:
auto ipv4_netmask = TRY(adapter.ipv4_netmask().to_string());
TRY(obj.add("ipv4_netmask", ipv4_netmask->view()));
}
if (!adapter.ipv4_gateway().is_zero()) {
auto ipv4_gateway = TRY(adapter.ipv4_gateway().to_string());
TRY(obj.add("ipv4_gateway", ipv4_gateway->view()));
}
TRY(obj.add("packets_in", adapter.packets_in()));
TRY(obj.add("bytes_in", adapter.bytes_in()));
TRY(obj.add("packets_out", adapter.packets_out()));

View file

@ -159,9 +159,4 @@ void NetworkAdapter::set_ipv4_netmask(IPv4Address const& netmask)
m_ipv4_netmask = netmask;
}
void NetworkAdapter::set_ipv4_gateway(IPv4Address const& gateway)
{
m_ipv4_gateway = gateway;
}
}

View file

@ -55,7 +55,6 @@ public:
IPv4Address ipv4_address() const { return m_ipv4_address; }
IPv4Address ipv4_netmask() const { return m_ipv4_netmask; }
IPv4Address ipv4_broadcast() const { return IPv4Address { (m_ipv4_address.to_u32() & m_ipv4_netmask.to_u32()) | ~m_ipv4_netmask.to_u32() }; }
IPv4Address ipv4_gateway() const { return m_ipv4_gateway; }
virtual bool link_up() { return false; }
virtual i32 link_speed()
{
@ -66,7 +65,6 @@ public:
void set_ipv4_address(IPv4Address const&);
void set_ipv4_netmask(IPv4Address const&);
void set_ipv4_gateway(IPv4Address const&);
void send(MACAddress const&, ARPPacket const&);
void fill_in_ipv4_header(PacketWithTimestamp&, IPv4Address const&, MACAddress const&, IPv4Address const&, IPv4Protocol, size_t, u8 type_of_service, u8 ttl);
@ -103,7 +101,6 @@ private:
MACAddress m_mac_address;
IPv4Address m_ipv4_address;
IPv4Address m_ipv4_netmask;
IPv4Address m_ipv4_gateway;
// FIXME: Make this configurable
static constexpr size_t max_packet_buffers = 1024;

View file

@ -67,7 +67,6 @@ void NetworkTask_main(void*)
if (adapter.class_name() == "LoopbackAdapter"sv) {
adapter.set_ipv4_address({ 127, 0, 0, 1 });
adapter.set_ipv4_netmask({ 255, 0, 0, 0 });
adapter.set_ipv4_gateway({ 0, 0, 0, 0 });
}
adapter.on_receive = [&]() {