25 if (buffer.size() < 1 + 3 + 4)
return;
27 bool ipv6 = buffer[0] & 128;
31 std::ranges::copy(std::as_bytes(buffer.subspan(1,
asmap_size)), std::back_inserter(
asmap));
static NetGroupManager WithEmbeddedAsmap(std::span< const std::byte > asmap)
uint32_t GetMappedAS(const CNetAddr &address) const
Get the autonomous system on the BGP path to address.
""_hex is a compile-time user-defined literal returning a std::array<std::byte>, equivalent to ParseH...
static constexpr size_t ADDR_IPV4_SIZE
Size of IPv4 address (in bytes).
static constexpr size_t ADDR_IPV6_SIZE
Size of IPv6 address (in bytes).
static const std::vector< std::byte > IPV6_PREFIX_ASMAP
asmap code that consumes nothing
static const auto IPV4_PREFIX_ASMAP
asmap code that consumes the 96 prefix bits of ::ffff:0/96 (IPv4-in-IPv6 map)
bool CheckStandardAsmap(const std::span< const std::byte > data)
Provides a safe interface for validating ASMap data before use.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.