Routing.cpp 380 B

12345678910
  1. #include <Kernel/Net/LoopbackAdapter.h>
  2. #include <Kernel/Net/Routing.h>
  3. WeakPtr<NetworkAdapter> adapter_for_route_to(const IPv4Address& ipv4_address)
  4. {
  5. // FIXME: Have an actual routing table.
  6. if (ipv4_address == IPv4Address(127, 0, 0, 1))
  7. return LoopbackAdapter::the().make_weak_ptr();
  8. return NetworkAdapter::from_ipv4_address(IPv4Address(192, 168, 5, 2));
  9. }