NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::dns Namespace Reference

Classes

struct  AnyAddress
 
struct  Error
 
struct  Ipv4Only
 
struct  Ipv6Only
 
class  Resolver
 

Typedefs

typedef boost::asio::ip::udp::endpoint EndPoint
 
typedef boost::asio::ip::basic_resolver< boost::asio::ip::udp > BoostResolver
 
typedef function< bool(const boost::asio::ip::address &address)> AddressSelector
 
typedef boost::asio::ip::address IpAddress
 
typedef function< void(const IpAddress &address)> SuccessCallback
 
typedef function< void(const std::string &reason)> ErrorCallback
 

Functions

void asyncResolve (const std::string &host, const SuccessCallback &onSuccess, const ErrorCallback &onError, boost::asio::io_service &ioService, const ndn::dns::AddressSelector &addressSelector=ndn::dns::AnyAddress(), const time::nanoseconds &timeout=time::seconds(4))
 Asynchronously resolve host. More...
 
IpAddress syncResolve (const std::string &host, boost::asio::io_service &ioService, const ndn::dns::AddressSelector &addressSelector=ndn::dns::AnyAddress())
 Synchronously resolve host. More...
 

Typedef Documentation

typedef boost::asio::ip::udp::endpoint ndn::dns::EndPoint

Definition at line 29 of file dns.cpp.

typedef boost::asio::ip::basic_resolver<boost::asio::ip::udp> ndn::dns::BoostResolver

Definition at line 30 of file dns.cpp.

typedef function<bool (const boost::asio::ip::address& address)> ndn::dns::AddressSelector

Definition at line 32 of file dns.hpp.

typedef boost::asio::ip::address ndn::dns::IpAddress

Definition at line 69 of file dns.hpp.

typedef function<void (const IpAddress& address)> ndn::dns::SuccessCallback

Definition at line 71 of file dns.hpp.

typedef function<void (const std::string& reason)> ndn::dns::ErrorCallback

Definition at line 72 of file dns.hpp.

Function Documentation

void ndn::dns::asyncResolve ( const std::string &  host,
const SuccessCallback onSuccess,
const ErrorCallback onError,
boost::asio::io_service &  ioService,
const ndn::dns::AddressSelector addressSelector = ndn::dns::AnyAddress(),
const time::nanoseconds &  timeout = time::seconds(4) 
)

Asynchronously resolve host.

If an address selector predicate is specified, then each resolved IP address is checked against the predicate.

Available address selector predicates:

  • resolver::AnyAddress()
  • resolver::Ipv4Address()
  • resolver::Ipv6Address()

Definition at line 123 of file dns.cpp.

Referenced by ndn::util::IpHostCanonizeProvider< boost::asio::ip::udp >::canonize().

IpAddress ndn::dns::syncResolve ( const std::string &  host,
boost::asio::io_service &  ioService,
const ndn::dns::AddressSelector addressSelector = ndn::dns::AnyAddress() 
)

Synchronously resolve host.

If an address selector predicate is specified, then each resolved IP address is checked against the predicate.

Available address selector predicates:

  • resolver::AnyAddress()
  • resolver::Ipv4Address()
  • resolver::Ipv6Address()

Definition at line 137 of file dns.cpp.

References ndn::dns::Resolver::syncResolve().