2019-04-02 10:46:44 -03:00
|
|
|
#include <Kernel/Net/LoopbackAdapter.h>
|
2019-06-07 06:43:58 -03:00
|
|
|
#include <Kernel/Net/Routing.h>
|
2019-04-02 10:46:44 -03:00
|
|
|
|
2019-08-08 23:34:32 -03:00
|
|
|
WeakPtr<NetworkAdapter> adapter_for_route_to(const IPv4Address& ipv4_address)
|
2019-04-02 10:46:44 -03:00
|
|
|
{
|
|
|
|
|
// FIXME: Have an actual routing table.
|
|
|
|
|
if (ipv4_address == IPv4Address(127, 0, 0, 1))
|
2019-08-08 23:34:32 -03:00
|
|
|
return LoopbackAdapter::the().make_weak_ptr();
|
2019-04-02 10:46:44 -03:00
|
|
|
return NetworkAdapter::from_ipv4_address(IPv4Address(192, 168, 5, 2));
|
|
|
|
|
}
|