1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 04:45:08 +00:00
serenity/Kernel/Net/Routing.h
Andreas Kling c2fc33becd Kernel: Rename ProtectedValue<T> => MutexProtected<T>
Let's make it obvious what we're protecting it with.
2021-08-22 03:34:09 +02:00

32 lines
701 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <Kernel/Locking/MutexProtected.h>
#include <Kernel/Net/NetworkAdapter.h>
#include <Kernel/Thread.h>
namespace Kernel {
struct RoutingDecision {
RefPtr<NetworkAdapter> adapter;
MACAddress next_hop;
bool is_zero() const;
};
enum class UpdateArp {
Set,
Delete,
};
void update_arp_table(const IPv4Address&, const MACAddress&, UpdateArp update);
RoutingDecision route_to(const IPv4Address& target, const IPv4Address& source, const RefPtr<NetworkAdapter> through = nullptr);
MutexProtected<HashMap<IPv4Address, MACAddress>>& arp_table();
}