|int||main (int, char **)|
- 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.
abort if neither worker could open a socket.
References Icmp::Close(), IcmpPinger::Close(), control, DBG_CRITICAL, debugs, getCurrentTime(), icmp4, icmp6, LINK_TO_SQUID, max(), Debug::NameThisHelper(), Icmp4::Open(), Icmp6::Open(), IcmpPinger::Open(), PINGER_TIMEOUT, Ip::ProbeTransport(), Icmp4::Recv(), Icmp6::Recv(), IcmpPinger::Recv(), squid_curtime, and xstrerr().