#include "squid.h"
#include "AccessLogEntry.h"
#include "acl/Acl.h"
#include "acl/FilledChecklist.h"
#include "base/AsyncCallbacks.h"
#include "client_db.h"
#include "comm.h"
#include "comm/Connection.h"
#include "comm/Loops.h"
#include "fd.h"
#include "HttpRequest.h"
#include "icmp/net_db.h"
#include "ICP.h"
#include "ip/Address.h"
#include "ip/tools.h"
#include "ipc/StartListening.h"
#include "ipcache.h"
#include "md5.h"
#include "multicast.h"
#include "neighbors.h"
#include "refresh.h"
#include "rfc1738.h"
#include "SquidConfig.h"
#include "StatCounters.h"
#include "Store.h"
#include "store_key_md5.h"
#include "tools.h"
#include "wordlist.h"
#include <cerrno>
Go to the source code of this file.
Classes | |
class | DelayedUdpSend |
a delayed icpUdpSend() call More... | |
class | ICP2State |
Macros | |
#define | N_QUERIED_KEYS 8192 |
#define | N_QUERIED_KEYS_MASK 8191 |
Functions | |
static void | icpIncomingConnectionOpened (Ipc::StartListeningAnswer &) |
static void | icpLogIcp (const Ip::Address &caddr, const LogTags_ot logcode, const int len, const char *url, int delay, AccessLogEntry::Pointer &al) |
updates ALE (if any) and logs the transaction (if needed) More... | |
static void | icpHandleIcpV2 (int, Ip::Address &, char *, int) |
static void | icpCount (void *, int, size_t, int) |
static LogTags_ot | icpLogFromICPCode (icp_opcode) |
static int | icpUdpSend (int fd, const Ip::Address &to, icp_common_t *msg, int delay, AccessLogEntryPointer al) |
static void | icpSyncAle (AccessLogEntryPointer &al, const Ip::Address &caddr, const char *url, int len, int delay) |
static void | icpUdpSendQueue (int fd, void *) |
icp_opcode | icpGetCommonOpcode () |
void | icpCreateAndSend (icp_opcode opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from, AccessLogEntry::Pointer al) |
void | icpDenyAccess (Ip::Address &from, char *url, int reqnum, int fd) |
bool | icpAccessAllowed (Ip::Address &from, HttpRequest *icp_request) |
HttpRequest * | icpGetRequest (char *url, int reqnum, int fd, Ip::Address &from) |
static void | doV2Query (int fd, Ip::Address &from, char *buf, icp_common_t header) |
void | icpHandleUdp (int sock, void *) |
void | icpOpenPorts (void) |
void | icpConnectionShutdown (void) |
void | icpClosePorts (void) |
int | icpSetCacheKey (const cache_key *key) |
const cache_key * | icpGetCacheKey (const char *url, int reqnum) |
Variables | |
static DelayedUdpSend * | IcpQueueHead = nullptr |
static DelayedUdpSend * | IcpQueueTail = nullptr |
Comm::ConnectionPointer | icpIncomingConn = nullptr |
Comm::ConnectionPointer | icpOutgoingConn = nullptr |
static cache_key | queried_keys [N_QUERIED_KEYS][SQUID_MD5_DIGEST_LENGTH] |
Macro Definition Documentation
◆ N_QUERIED_KEYS
◆ N_QUERIED_KEYS_MASK
Function Documentation
◆ doV2Query()
|
static |
Definition at line 475 of file icp_v2.cc.
References ICPState::al, Config, ICPState::fd, icp_common_t::flags, ICP2State::flags, ICPState::from, AnyP::Uri::host(), HTTPMSGLOCK(), HTTPMSGUNLOCK(), ICP_ERR, ICP_FLAG_SRC_RTT, ICP_HIT, ICP_MISS, ICP_MISS_NOFETCH, icpAccessAllowed(), icpCreateAndSend(), icpDenyAccess(), icpGetCommonOpcode(), icpGetRequest(), ICPState::isHit(), netdbHostHops(), netdbHostRtt(), netdbPingSite(), SquidConfig::onoff, icp_common_t::reqnum, ICPState::request, ICP2State::rtt, ICP2State::src_rtt, SquidConfig::test_reachability, HttpRequest::url, ICPState::url, and xstrdup.
Referenced by icpHandleIcpV2().
◆ icpHandleUdp()
void icpHandleUdp | ( | int | sock, |
void * | |||
) |
Definition at line 626 of file icp_v2.cc.
References COMM_SELECT_READ, comm_udp_recvfrom(), DBG_IMPORTANT, debugs, ICP_VERSION_2, ICP_VERSION_3, icpCount(), icpHandleIcpV2(), icpHandleIcpV3(), icpHandleUdp(), icpOutgoingConn, ignoreErrno(), incoming_sockets_accepted, INCOMING_UDP_MAX, int, Comm::Connection::local, LOCAL_ARRAY, max(), RECV, Comm::SetSelect(), SQUID_UDP_SO_RCVBUF, and xstrerr().
Referenced by icpHandleUdp(), icpIncomingConnectionOpened(), and icpOpenPorts().
◆ icpIncomingConnectionOpened()
|
static |
Definition at line 752 of file icp_v2.cc.
References SquidConfig::Addrs, COMM_SELECT_READ, Config, Ipc::StartListeningAnswer::conn, conn, DBG_IMPORTANT, debugs, fatal(), fd_note(), icpHandleUdp(), icpOutgoingConn, ipcache_nbgethostbyname(), Comm::IsConnOpen(), Ip::Address::isNoAddr(), Comm::Connection::local, SquidConfig::mcast_group_list, mcastJoinGroups, wordlist::next, Comm::SetSelect(), and SquidConfig::udp_outgoing.
Referenced by icpOpenPorts().
◆ icpLogFromICPCode()
|
static |
Definition at line 389 of file icp_v2.cc.
References fatal(), ICP_DECHO, ICP_DENIED, ICP_ERR, ICP_HIT, ICP_MISS, ICP_MISS_NOFETCH, ICP_QUERY, LOG_ICP_QUERY, LOG_UDP_DENIED, LOG_UDP_HIT, LOG_UDP_INVALID, LOG_UDP_MISS, and LOG_UDP_MISS_NOFETCH.
Referenced by icpCreateAndSend(), and icpUdpSend().
◆ icpSyncAle()
|
static |
Definition at line 73 of file icp_v2.cc.
References AccessLogEntry::cache, AccessLogEntry::CacheDetails::caddr, AccessLogEntry::HttpDetails::clientReplySz, current_time, AccessLogEntry::http, AccessLogEntry::icp, ICP_QUERY, AccessLogEntry::IcpDetails::opcode, MessageSizes::payloadData, AccessLogEntry::setVirginUrlForMissingRequest(), AccessLogEntry::CacheDetails::start_time, AccessLogEntry::CacheDetails::trTime, and AccessLogEntry::url.
Referenced by ICPState::fillChecklist(), and icpLogIcp().
◆ icpUdpSend()
|
static |
writes the given UDP msg to the socket; queues a retry on the first failure
- Returns
- a negative number on failures
Definition at line 319 of file icp_v2.cc.
References COMM_SELECT_WRITE, comm_udp_sendto(), current_time, debugs, StatCounters::icp, icp_opcode_str, icpCount(), icpLogFromICPCode(), icpLogIcp(), IcpQueueHead, IcpQueueTail, icpUdpSendQueue(), int, icp_common_t::length, DelayedUdpSend::next, icp_common_t::opcode, StatCounters::replies_dropped, StatCounters::replies_queued, safe_free, SENT, Comm::SetSelect(), and statCounter.
Referenced by icpCreateAndSend(), and icpUdpSendQueue().
Variable Documentation
◆ queried_keys
|
static |
Definition at line 858 of file icp_v2.cc.
Referenced by icpGetCacheKey(), and icpSetCacheKey().