Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::net::dns::Resolver Class Reference

DNS Resolver. More...

#include <Resolver.h>

Public Member Functions

 Resolver ()
 
bool addNameServer (const std::string &ip, uint16_t port=53)
 
void addNameServer (const IPAddress::Ptr &ip_address)
 
std::vector< IPAddress::Ptrresolve (const std::string &hostname, uint16_t type)
 

Private Member Functions

std::vector< IPAddress::Ptrresolve (const IPAddress::Ptr &name_server, const std::string &hostname, uint16_t type)
 

Private Attributes

std::vector< IPAddress::Ptrname_servers
 
std::random_device device
 
std::mt19937 generator
 

Detailed Description

DNS Resolver.

Constructor & Destructor Documentation

◆ Resolver()

Resolver::Resolver ( )

Member Function Documentation

◆ addNameServer() [1/2]

void Resolver::addNameServer ( const IPAddress::Ptr & ip_address)

Add NameServer

Parameters
ip_addressIP

References name_servers.

◆ addNameServer() [2/2]

bool Resolver::addNameServer ( const std::string & ip,
uint16_t port = 53 )

Add NameServer

Parameters
ipIP
portPort
Returns
Whether adding was successful, depending on the format of the provided IP address

References sese::net::IPAddress::create(), and name_servers.

Referenced by sese::internal::net::service::dns::DnsService::addUpstreamNameServer(), and sese::internal::net::service::dns::DnsService::addUpstreamNameServer().

◆ resolve() [1/2]

◆ resolve() [2/2]

std::vector< sese::net::IPAddress::Ptr > Resolver::resolve ( const std::string & hostname,
uint16_t type )

Resolve domain name

Parameters
hostnameDomain name
typeType (sese::net::dns::TYPE_A || sese::net::dns::TYPE_AAAA)
Returns
Resolution results

References name_servers, and resolve().

Member Data Documentation

◆ device

std::random_device sese::net::dns::Resolver::device
private

◆ generator

std::mt19937 sese::net::dns::Resolver::generator
private

Referenced by resolve().

◆ name_servers

std::vector<IPAddress::Ptr> sese::net::dns::Resolver::name_servers
private

The documentation for this class was generated from the following files: