9#ifndef SQUID_SRC_PEERSELECTSTATE_H
10#define SQUID_SRC_PEERSELECTSTATE_H
19#include "mem/forward.h"
void ACLCB(Acl::Answer, void *)
ACL checklist callback.
void peerSelectInit(void)
void error(char *format,...)
an interface for receiving IP::Addresses from nbgethostbyname()
encapsulates DNS lookup results
Interface for those who need a list of peers to forward a request to.
bool subscribed
whether noteDestination() and noteDestinationsEnd() calls are allowed
virtual void noteDestination(Comm::ConnectionPointer path)=0
called when a new unique destination has been found
~PeerSelectionInitiator() override=default
virtual void noteDestinationsEnd(ErrorState *error)=0
void startSelectingDestinations(HttpRequest *request, const AccessLogEntry::Pointer &ale, StoreEntry *entry)
Ip::Address closest_parent_miss
void selectAllParents()
Adds alive parents. Used as a last resort for never_direct.
PeerSelectionInitiator * interestedInitiator()
FwdServer * servers
a linked list of (unresolved) selected peers
Initiator initiator_
recipient of the destinations we select; use interestedInitiator() to access
static void HandlePingTimeout(PeerSelector *)
called when the given selector should stop expecting ICP ping responses
void noteIps(const Dns::CachedIps *ips, const Dns::LookupDetails &details) override
Acl::Answer always_direct
void selectMore()
a single selection loop iteration: attempts to add more destinations
void startPingWaiting()
switches into the PING_WAITING state (and associated timeout monitoring)
void handleIcpParentMiss(CachePeer *, icp_common_t *)
void cancelPingTimeoutMonitoring()
terminates ICP ping timeout monitoring
CbcPointer< PeerSelectionInitiator > Initiator
Ip::Address first_parent_miss
void handlePath(const Comm::ConnectionPointer &path, FwdServer &fs)
processes a newly discovered/finalized path
AccessLogEntry::Pointer al
info for the future access.log entry
bool wantsMoreDestinations() const
void checkNeverDirectDone(const Acl::Answer answer)
void checkAlwaysDirectDone(const Acl::Answer answer)
void handleHtcpReply(CachePeer *, const peer_t, HtcpReplyData *)
void * peerCountMcastPeerXXX
a hack to help peerCountMcastPeersStart()
void handleIcpReply(CachePeer *, const peer_t, icp_common_t *header)
static ACLCB CheckNeverDirectDone
void addSelection(CachePeer *, const hier_code)
static ACLCB CheckAlwaysDirectDone
void noteLookup(const Dns::LookupDetails &details) override
void selectSomeDirect()
Adds a "direct" entry if the request can be forwarded to the origin server.
void noteIp(const Ip::Address &ip) override
Called when/if nbgethostbyname() discovers a new good IP address.
void resolveSelected()
A single DNS resolution loop iteration: Converts selected FwdServer to IPs.
void selectSomeNeighbor()
const InstanceId< PeerSelector > id
unique identification in worker log
void selectPinned()
Selects a pinned connection if it exists, is valid, and is allowed.
void selectSomeNeighborReplies()
Selects a neighbor (parent or sibling) based on ICP/HTCP replies.
size_t foundPaths
number of unique destinations identified so far
void handleHtcpParentMiss(CachePeer *, HtcpReplyData *)
static IRCB HandlePingReply
CBDATA_CHILD(PeerSelector)
ICP probing of cache_peers during peer selection.
void IRCB(CachePeer *, peer_t, AnyP::ProtocolType, void *, void *data)