2022-07-28 16:07:38 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-10-24 13:18:03 +00:00
|
|
|
#include "ip_range.hpp"
|
|
|
|
|
2023-10-19 21:59:57 +00:00
|
|
|
#include <llarp/util/formattable.hpp>
|
2023-10-24 13:18:03 +00:00
|
|
|
|
2022-10-06 17:50:05 +00:00
|
|
|
#include <optional>
|
2022-07-28 16:07:38 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2023-10-19 21:59:57 +00:00
|
|
|
|
2022-07-28 16:07:38 +00:00
|
|
|
namespace llarp::net
|
|
|
|
{
|
|
|
|
/// info about a network interface lokinet does not own
|
|
|
|
struct InterfaceInfo
|
|
|
|
{
|
|
|
|
/// human readable name of interface
|
|
|
|
std::string name;
|
|
|
|
/// interface's index
|
|
|
|
int index;
|
|
|
|
/// the addresses owned by this interface
|
|
|
|
std::vector<IPRange> addrs;
|
|
|
|
/// a gateway we can use if it exists
|
|
|
|
std::optional<ipaddr_t> gateway;
|
2022-10-06 17:50:05 +00:00
|
|
|
|
|
|
|
std::string
|
|
|
|
ToString() const;
|
2022-07-28 16:07:38 +00:00
|
|
|
};
|
|
|
|
} // namespace llarp::net
|
2022-10-06 17:50:05 +00:00
|
|
|
|
|
|
|
template <>
|
|
|
|
inline constexpr bool llarp::IsToStringFormattable<llarp::net::InterfaceInfo> = true;
|