ipcache.h
Go to the documentation of this file.
153 GoodIpsIterator(const Raw &raw, const size_t currentPos): raw_(raw), position_(currentPos), processed_(0) { sync(); }
Definition: CbcPointer.h:26
Definition: cbdata.h:276
bool bad() const
whether the address is currently deemed problematic for any reason
Definition: ipcache.h:29
Definition: ipcache.h:51
void markAsBad(const char *name, const Ip::Address &ip)
Definition: ipcache.cc:1019
void reset(const Ip::Address &ip)
replace all info with the given (presumed good) IP address
Definition: ipcache.cc:956
bool have(const Ip::Address &ip, size_t *position=nullptr) const
Definition: ipcache.cc:982
void forgetMarking(const char *name, const Ip::Address &ip)
undo successful markAsBad()
Definition: ipcache.cc:1039
void restoreGoodness(const char *name)
makes current() calls possible after a successful markAsBad()
Definition: ipcache.cc:968
void reportCurrent(std::ostream &os) const
prints current IP and other debugging information
Definition: ipcache.cc:1008
Iterates over good IPs in CachedIps, starting at the so called current one.
Definition: ipcache.h:142
bool operator==(const GoodIpsIterator them) const
Definition: ipcache.h:163
std::forward_iterator_tag iterator_category
Definition: ipcache.h:148
GoodIpsIterator(const Raw &raw, const size_t currentPos)
Definition: ipcache.h:153
bool operator!=(const GoodIpsIterator them) const
Definition: ipcache.h:164
an interface for receiving IP::Addresses from nbgethostbyname()
Definition: ipcache.h:195
virtual void noteIps(const CachedIps *ips, const LookupDetails &details)=0
virtual void noteIp(const Ip::Address &)
Called when/if nbgethostbyname() discovers a new good IP address.
Definition: ipcache.h:206
virtual void noteLookup(const Dns::LookupDetails &)
Definition: ipcache.h:210
Iterates over any (good and/or bad) IPs in CachedIps, in unspecified order.
Definition: ipcache.h:112
std::forward_iterator_tag iterator_category
Definition: ipcache.h:118
Definition: ipcache.h:180
Definition: Address.h:41
const ipcache_addrs * ipcache_gethostbyname(const char *, int flags)
Definition: ipcache.cc:728
void ipcacheMarkGoodAddr(const char *name, const Ip::Address &)
Definition: ipcache.cc:1074
int ipcacheAddEntryFromHosts(const char *name, const char *ipaddr)
Definition: ipcache.cc:1123
void ipcache_nbgethostbyname(const char *name, IPH *handler, void *handlerData)
Definition: ipcache.cc:608
void ipcacheMarkBadAddr(const char *name, const Ip::Address &)
Definition: ipcache.cc:1066
void IPH(const ipcache_addrs *, const Dns::LookupDetails &details, void *)
Definition: ipcache.h:227
void nbgethostbyname(const char *name, const CbcPointer< IpReceiver > &receiver)
initiate an (often) asynchronous DNS lookup; the receiver gets the results
Definition: ipcache.cc:615
std::ostream & operator<<(std::ostream &os, const LookupDetails &dns)
Definition: LookupDetails.h:44