Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
util
asmap.h
Go to the documentation of this file.
1
// Copyright (c) 2019-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_UTIL_ASMAP_H
6
#define BITCOIN_UTIL_ASMAP_H
7
8
#include <
uint256.h
>
9
#include <
util/fs.h
>
10
11
#include <cstddef>
12
#include <cstdint>
13
#include <span>
14
#include <vector>
15
16
uint32_t
Interpret
(std::span<const std::byte> asmap, std::span<const std::byte>
ip
);
17
18
bool
SanityCheckAsmap
(std::span<const std::byte> asmap,
int
bits);
20
bool
CheckStandardAsmap
(std::span<const std::byte> data);
21
23
std::vector<std::byte>
DecodeAsmap
(fs::path path);
25
uint256
AsmapVersion
(std::span<const std::byte> data);
26
27
#endif
// BITCOIN_UTIL_ASMAP_H
DecodeAsmap
std::vector< std::byte > DecodeAsmap(fs::path path)
Read and check asmap from provided binary file.
Definition
asmap.cpp:322
Interpret
uint32_t Interpret(std::span< const std::byte > asmap, std::span< const std::byte > ip)
Execute the ASMap bytecode to find the ASN for an IP.
Definition
asmap.cpp:182
CheckStandardAsmap
bool CheckStandardAsmap(std::span< const std::byte > data)
Check standard asmap data (128 bits for IPv6).
Definition
asmap.cpp:310
AsmapVersion
uint256 AsmapVersion(std::span< const std::byte > data)
Calculate the asmap version, a checksum identifying the asmap being used.
Definition
asmap.cpp:348
SanityCheckAsmap
bool SanityCheckAsmap(std::span< const std::byte > asmap, int bits)
Validates ASMap structure by simulating all possible execution paths.
Definition
asmap.cpp:239
uint256
256-bit opaque blob.
Definition
uint256.h:195
ip
static CService ip(uint32_t i)
Definition
denialofservice_tests.cpp:28
fs.h
uint256.h
Generated on
for Bitcoin Core by
1.17.0