diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-03-29 10:47:53 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-07-16 11:35:53 +0000 |
commit | 65c40049633f0c5db3c24af8716bb683520f368c (patch) | |
tree | 9531d5d4c2cfa4e5a5b1ac35cea13af1b173ccbe /src/net/parse.h | |
parent | p2p: store network address directly in blocked host list (diff) | |
download | monero-65c40049633f0c5db3c24af8716bb683520f368c.tar.xz |
allow blocking whole subnets
Diffstat (limited to 'src/net/parse.h')
-rw-r--r-- | src/net/parse.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/net/parse.h b/src/net/parse.h index 5804c4128..9f0d66ea6 100644 --- a/src/net/parse.h +++ b/src/net/parse.h @@ -50,5 +50,18 @@ namespace net */ expect<epee::net_utils::network_address> get_network_address(boost::string_ref address, std::uint16_t default_port); + + /*! + Identifies an IPv4 subnet in CIDR notatioa and returns it as a generic + `network_address`. If the type is unsupported, it might be a hostname, + and `error() == net::error::kUnsupportedAddress` is returned. + + \param address An ipv4 address. + \param allow_implicit_32 whether to accept "raw" IPv4 addresses, with CIDR notation + + \return A tor or IPv4 address, else error. + */ + expect<epee::net_utils::ipv4_network_subnet> + get_ipv4_subnet_address(boost::string_ref address, bool allow_implicit_32 = false); } |