libDwmRDAP-0.1.4
Dwm::RDAP::Fetcher Class Reference

Encapsulates interaction with dwmrdapd for fetching IPv4 prefix and country information for IPv4 host addresses. More...

#include <DwmRDAPFetcher.hh>

Public Member Functions

 Fetcher ()
 Constructor.
 
bool OpenSession (const std::string &server, const std::string &privKeyPath, const std::string &knownServicesPath)
 Opens a session with dwmrdapd on the given server and uses privKeyPath and knownServicesPath for authentication. More...
 
 ~Fetcher ()
 Destructor. This will close the session if it is open.
 
FetchedEntryMap GetEntries (const std::vector< Ipv4Address > &addrs)
 Fetches the entries corresponding to each of the IPv4 addresses in addrs. More...
 
std::pair< bool, FetchedEntryGetEntry (const Ipv4Address &addr)
 Fetches the entry for the given addr. More...
 
void CloseSession ()
 Closes the session with dwmrdapd.
 

Detailed Description

Encapsulates interaction with dwmrdapd for fetching IPv4 prefix and country information for IPv4 host addresses.

Member Function Documentation

◆ GetEntries()

FetchedEntryMap Dwm::RDAP::Fetcher::GetEntries ( const std::vector< Ipv4Address > &  addrs)

Fetches the entries corresponding to each of the IPv4 addresses in addrs.

Note that the returned map is keyed by the addresses in addrs, and that the number of entries in the map may be smaller than the number of entries in addrs since we may fail to find some entries.

◆ GetEntry()

std::pair<bool,FetchedEntry> Dwm::RDAP::Fetcher::GetEntry ( const Ipv4Address &  addr)

Fetches the entry for the given addr.

On success, the first member of the return value will be true and the second member will contain the fetched entry. On failure, the first member of the return value will be false and the second member's contents are undefined.

◆ OpenSession()

bool Dwm::RDAP::Fetcher::OpenSession ( const std::string &  server,
const std::string &  privKeyPath,
const std::string &  knownServicesPath 
)

Opens a session with dwmrdapd on the given server and uses privKeyPath and knownServicesPath for authentication.

Returns true on success, false on failure.

privKeyPath must be the path to a file containing your 2048-bit RSA private key (and there must be a corresponding .pub file containing the public part of the same key). knownServicesPath must be the path to a DwmAuth 'known_services' type of file and must contain the server's public key.


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