SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Comm::Resolver Namespace Reference

The SWC-DB Resolver C++ namespace 'SWC::Comm::Resolver'. More...

Functions

bool is_ipv4_address (const std::string &str) noexcept
 
bool is_ipv6_address (const std::string &str) noexcept
 
EndPoints get_endpoints (uint16_t defaul_port, const Config::Strings &addrs, const std::string &host, const Networks &nets, bool srv=false)
 
void sort (const Networks &nets, const EndPoints &endpoints, EndPoints &sorted)
 
void get_networks (const Config::Strings &networks, Networks &nets, asio::error_code &ec)
 
void get_networks (const Config::Strings &networks, Networks_v4 &nets_v4, Networks_v6 &nets_v6, asio::error_code &ec)
 
void get_local_networks (int &err, Networks_v4 &nets_v4, Networks_v6 &nets_v6)
 
bool is_network (const EndPoint &endpoint, const Networks_v4 &nets_v4, const Networks_v6 &nets_v6) noexcept
 
bool is_network (const EndPoint &endpoint, const asio::ip::network_v4 &net) noexcept
 
bool is_network (const EndPoint &endpoint, const asio::ip::network_v6 &net) noexcept
 

Detailed Description

The SWC-DB Resolver C++ namespace 'SWC::Comm::Resolver'.

Function Documentation

◆ get_endpoints()

EndPoints SWC::Comm::Resolver::get_endpoints ( uint16_t  defaul_port,
const Config::Strings addrs,
const std::string &  host,
const Networks nets,
bool  srv = false 
)

Definition at line 152 of file Resolver.cc.

References SWC::Core::Vector< T, SizeT, GROW_SZ >::emplace_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Config::Property::from_string(), sort(), SWC_ERRNO_EAI_BEGIN, and SWC_THROWF.

Referenced by SWC::client::Mngr::Groups::_add_host(), SWC::FS::FileSystemBroker::get_endpoints(), SWC::ThriftBroker::make_service(), SWC::Utils::shell::Mngr::managers_status(), SWC::client::Brokers::on_cfg_update(), SWC::Utils::shell::Rgr::read_endpoint(), and SWC::Comm::server::SerializedServer::SerializedServer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_local_networks()

void SWC::Comm::Resolver::get_local_networks ( int &  err,
Networks_v4 nets_v4,
Networks_v6 nets_v6 
)

Definition at line 287 of file Resolver.cc.

References SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), and SWC_ERRNO_EAI_BEGIN.

Referenced by SWC::Comm::ConfigSSL::set_networks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_networks() [1/2]

void SWC::Comm::Resolver::get_networks ( const Config::Strings networks,
Networks nets,
asio::error_code &  ec 
)

Definition at line 264 of file Resolver.cc.

References SWC::Core::Vector< T, SizeT, GROW_SZ >::emplace_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().

Referenced by SWC::FS::FileSystemBroker::get_endpoints(), SWC::client::Mngr::Groups::Groups(), SWC::Comm::server::SerializedServer::SerializedServer(), and SWC::Comm::ConfigSSL::set_networks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_networks() [2/2]

void SWC::Comm::Resolver::get_networks ( const Config::Strings networks,
Networks_v4 nets_v4,
Networks_v6 nets_v6,
asio::error_code &  ec 
)

Definition at line 275 of file Resolver.cc.

References SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back().

+ Here is the call graph for this function:

◆ is_ipv4_address()

SWC_SHOULD_INLINE bool SWC::Comm::Resolver::is_ipv4_address ( const std::string &  str)
noexcept

Definition at line 141 of file Resolver.cc.

References SWC::Config::str().

Referenced by SWC::client::Mngr::Groups::_add_host(), SWC::Utils::shell::Mngr::managers_status(), SWC::client::Brokers::on_cfg_update(), and SWC::Utils::shell::Rgr::read_endpoint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_ipv6_address()

SWC_SHOULD_INLINE bool SWC::Comm::Resolver::is_ipv6_address ( const std::string &  str)
noexcept

Definition at line 147 of file Resolver.cc.

References SWC::Config::str().

Referenced by SWC::client::Mngr::Groups::_add_host(), SWC::Utils::shell::Mngr::managers_status(), SWC::client::Brokers::on_cfg_update(), and SWC::Utils::shell::Rgr::read_endpoint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_network() [1/3]

bool SWC::Comm::Resolver::is_network ( const EndPoint endpoint,
const asio::ip::network_v4 &  net 
)
noexcept

Definition at line 373 of file Resolver.cc.

◆ is_network() [2/3]

bool SWC::Comm::Resolver::is_network ( const EndPoint endpoint,
const asio::ip::network_v6 &  net 
)
noexcept

Definition at line 380 of file Resolver.cc.

◆ is_network() [3/3]

bool SWC::Comm::Resolver::is_network ( const EndPoint endpoint,
const Networks_v4 nets_v4,
const Networks_v6 nets_v6 
)
noexcept

Definition at line 354 of file Resolver.cc.

Referenced by SWC::Comm::ConfigSSL::need_ssl(), and sort().

+ Here is the caller graph for this function:

◆ sort()