From: wessels <> Date: Tue, 17 Sep 1996 03:50:23 +0000 (+0000) Subject: make ICMP optional X-Git-Tag: SQUID_3_0_PRE1~5778 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fab463b4dc2fbba8c84c43a16d46432ba3812359;p=thirdparty%2Fsquid.git make ICMP optional --- diff --git a/src/Makefile.in b/src/Makefile.in index 821d5570c9..b4d217b79b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.39 1996/09/16 21:11:02 wessels Exp $ +# $Id: Makefile.in,v 1.40 1996/09/16 21:50:23 wessels Exp $ # # Uncomment and customize the following to suit your needs: # @@ -10,7 +10,8 @@ AIO_OPT = # -DUSE_ASYNC_IO=1 AIO_LIBS = # @AIO_LIBS@ AUTH_OPT = # -DUSE_PROXY_AUTH=1 LOG_HDRS_OPT = # -DLOG_FULL_HEADERS=1 -DEFINES = $(HOST_OPT) $(AIO_OPT) $(AUTH_OPT) $(LOG_HDRS_OPT) +ICMP_OPT = # -DUSE_ICMP=1 +DEFINES = $(HOST_OPT) $(AIO_OPT) $(AUTH_OPT) $(LOG_HDRS_OPT) $(ICMP_OPT) prefix = @prefix@ exec_prefix = @exec_prefix@ diff --git a/src/icmp.cc b/src/icmp.cc index 6ffdbb6151..331e321f25 100644 --- a/src/icmp.cc +++ b/src/icmp.cc @@ -1,4 +1,36 @@ +/* + * $Id: icmp.cc,v 1.4 1996/09/16 21:50:24 wessels Exp $ + * + * DEBUG: section 37 ICMP Routines + * AUTHOR: Duane Wessels + * + * SQUID Internet Object Cache http://www.nlanr.net/Squid/ + * -------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from the + * Internet community. Development is led by Duane Wessels of the + * National Laboratory for Applied Network Research and funded by + * the National Science Foundation. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#if USE_ICMP + #include "squid.h" #include @@ -395,3 +427,5 @@ icmpHandleSourcePing(struct sockaddr_in *from, char *buf) NULL, 0); } + +#endif /* USE_ICMP */ diff --git a/src/main.cc b/src/main.cc index 3d07349891..ef81e9d4d5 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* - * $Id: main.cc,v 1.77 1996/09/16 21:20:48 wessels Exp $ + * $Id: main.cc,v 1.78 1996/09/16 21:50:25 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -379,7 +379,9 @@ serverConnectionsOpen() } } } +#if USE_ICMP icmpOpen(); +#endif } void @@ -415,7 +417,9 @@ serverConnectionsClose() 0); theInIcpConnection = -1; } +#if USE_ICMP icmpClose(); +#endif } static void diff --git a/src/neighbors.cc b/src/neighbors.cc index b874763169..71b108a67c 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,5 +1,5 @@ /* - * $Id: neighbors.cc,v 1.53 1996/09/16 21:11:12 wessels Exp $ + * $Id: neighbors.cc,v 1.54 1996/09/16 21:50:26 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -507,9 +507,11 @@ neighborsUdpPing(protodispatch_data * proto) debug(15, 6, "neighborsUdpPing: Source Ping: to %s for '%s'\n", host, url); echo_hdr.reqnum = reqnum; +#if USE_ICMP if (icmp_sock != -1) { icmpSourcePing(inaddrFromHostent(hep), &echo_hdr, url); } else { +#endif to_addr.sin_family = AF_INET; to_addr.sin_addr = inaddrFromHostent(hep); to_addr.sin_port = htons(echo_port); @@ -521,7 +523,9 @@ neighborsUdpPing(protodispatch_data * proto) ICP_OP_SECHO, LOG_TAG_NONE, PROTO_NONE); +#if USE_ICMP } +#endif } else { debug(15, 6, "neighborsUdpPing: Source Ping: unknown host: %s\n", host);