Seastar
High performance C++ framework for concurrent servers
Classes | Public Types | Public Member Functions | List of all members
seastar::net::dns_resolver Class Reference

Detailed Description

A DNS resolver object. Wraps the query logic & networking. Can be instantiated with options and your network stack of choice, though for "normal" non-test querying, you are probably better of with the global calls further down.

#include <seastar/net/dns.hh>

Classes

struct  options
 

Public Types

enum class  srv_proto { tcp , udp }
 
using srv_records = std::vector< srv_record >
 

Public Member Functions

 dns_resolver (dns_resolver &&) noexcept
 
 dns_resolver (const options &)
 
 dns_resolver (network_stack &, const options &={})
 
dns_resolveroperator= (dns_resolver &&) noexcept
 
future< hostentget_host_by_name (const sstring &, opt_family={})
 
future< hostentget_host_by_addr (const inet_address &)
 
future< inet_addressresolve_name (const sstring &, opt_family={})
 
future< sstring > resolve_addr (const inet_address &)
 
future< srv_records > get_srv_records (srv_proto proto, const sstring &service, const sstring &domain)
 
future close ()
 

Class Documentation

◆ seastar::net::dns_resolver::options

struct seastar::net::dns_resolver::options
Class Members
optional< vector< sstring > > domains
optional< vector< inet_address > > servers
optional< uint16_t > tcp_port
optional< milliseconds > timeout
optional< uint16_t > udp_port
optional< bool > use_tcp_query

Member Function Documentation

◆ close()

future seastar::net::dns_resolver::close ( )

Shuts the object down. Great for tests.

◆ get_host_by_addr()

future<hostent> seastar::net::dns_resolver::get_host_by_addr ( const inet_address )

Resolves an address to one or more addresses and aliases

◆ get_host_by_name()

future<hostent> seastar::net::dns_resolver::get_host_by_name ( const sstring &  ,
opt_family  = {} 
)

Resolves a hostname to one or more addresses and aliases

◆ get_srv_records()

future<srv_records> seastar::net::dns_resolver::get_srv_records ( srv_proto  proto,
const sstring &  service,
const sstring &  domain 
)

Resolve a service in given domain to one or more SRV records

◆ resolve_addr()

future<sstring> seastar::net::dns_resolver::resolve_addr ( const inet_address )

Resolves an address to one (primary) name

◆ resolve_name()

future<inet_address> seastar::net::dns_resolver::resolve_name ( const sstring &  ,
opt_family  = {} 
)

Resolves a hostname to one (primary) address


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