mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 10:19:03 +03:00
718bea73b3
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/.
11 lines
357 B
C++
11 lines
357 B
C++
#include <Kernel/Net/Routing.h>
|
|
#include <Kernel/Net/LoopbackAdapter.h>
|
|
|
|
NetworkAdapter* adapter_for_route_to(const IPv4Address& ipv4_address)
|
|
{
|
|
// FIXME: Have an actual routing table.
|
|
if (ipv4_address == IPv4Address(127, 0, 0, 1))
|
|
return &LoopbackAdapter::the();
|
|
return NetworkAdapter::from_ipv4_address(IPv4Address(192, 168, 5, 2));
|
|
}
|