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
uint256
256-bit opaque blob.
Definition
uint256.h:195
fs.h
uint256.h
SanityCheckAsmap
bool SanityCheckAsmap(const std::span< const std::byte > asmap, int bits)
Validates ASMap structure by simulating all possible execution paths.
Definition
asmap.cpp:239
CheckStandardAsmap
bool CheckStandardAsmap(const std::span< const std::byte > data)
Provides a safe interface for validating ASMap data before use.
Definition
asmap.cpp:310
DecodeAsmap
std::vector< std::byte > DecodeAsmap(fs::path path)
Loads an ASMap file from disk and validates it.
Definition
asmap.cpp:322
Interpret
uint32_t Interpret(const std::span< const std::byte > asmap, const std::span< const std::byte > ip)
Execute the ASMap bytecode to find the ASN for an IP.
Definition
asmap.cpp:182
AsmapVersion
uint256 AsmapVersion(const std::span< const std::byte > data)
Computes SHA256 hash of ASMap data for versioning and consistency checks.
Definition
asmap.cpp:348
Generated on
for Bitcoin Core by
1.18.0