|int||main (int argc, char *argv)|
- Although it would be possible for Squid to send and receive ICMP messages directly, we use an external process for two important reasons:
- Because squid handles many filedescriptors simultaneously, we get much more accurate RTT measurements when ICMP is handled by a separate process.
- Superuser privileges are required to send and receive ICMP. Rather than require Squid to be started as root, we prefer to have the smaller and simpler pinger program installed with setuid permissions.
- If you want to use Squid's ICMP features (highly recommended!) When USE_ICMP is defined, Squid will send ICMP pings to origin server sites. This information is used in numerous ways:
- - Sent in ICP replies so neighbor caches know how close you are to the source.
- - For finding the closest instance of a URN.
- - With the 'test_reachability' option. Squid will return ICP_OP_MISS_NOFETCH for sites which it cannot ping.
- This is the pinger external process.
argc Ignored. argv Ignored.
start by initializing the pinger debug cache.log-pinger.
abort if neither worker could open a socket.
References _db_init(), IcmpPinger::Close(), Icmp::Close(), control, DBG_CRITICAL, debugs, getCurrentTime(), HERE(), icmp4, icmp6, LINK_TO_SQUID, max(), NULL, IcmpPinger::Open(), Icmp6::Open(), Icmp4::Open(), PINGER_TIMEOUT, Ip::ProbeTransport(), IcmpPinger::Recv(), Icmp6::Recv(), Icmp4::Recv(), squid_curtime, xstrdup, and xstrerr().