From: Francesco Chemolli Date: Fri, 17 Aug 2012 13:33:09 +0000 (+0200) Subject: Moved neighbors prototypes from protos.h to neighbors.h X-Git-Tag: sourceformat-review-1~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0ba2534c74bd4470a4f43a0692df655d8e25c40;p=thirdparty%2Fsquid.git Moved neighbors prototypes from protos.h to neighbors.h --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 58a693b974..7a78d0fdcb 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -61,6 +61,7 @@ #include "structs.h" #include "SwapDir.h" #include "wordlist.h" +#include "neighbors.h" #if USE_ADAPTATION #include "adaptation/Config.h" #endif diff --git a/src/carp.cc b/src/carp.cc index 982bd5770b..53424235c3 100644 --- a/src/carp.cc +++ b/src/carp.cc @@ -37,6 +37,7 @@ #include "squid.h" #include "HttpRequest.h" #include "mgr/Registration.h" +#include "neighbors.h" #include "protos.h" #include "Store.h" #include "URLScheme.h" diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 64b9cd46d8..3fdedcc45a 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -50,6 +50,7 @@ #include "ip/QosConfig.h" #include "ipcache.h" #include "MemObject.h" +#include "neighbors.h" #include "protos.h" #include "SquidTime.h" #include "Store.h" diff --git a/src/forward.cc b/src/forward.cc index 96b8f5938f..f3abfe250c 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -57,6 +57,7 @@ #include "ip/tools.h" #include "MemObject.h" #include "mgr/Registration.h" +#include "neighbors.h" #include "pconn.h" #include "PeerSelectState.h" #include "protos.h" diff --git a/src/http.cc b/src/http.cc index 412a8a9727..d6046f6357 100644 --- a/src/http.cc +++ b/src/http.cc @@ -59,6 +59,7 @@ #include "HttpRequest.h" #include "MemBuf.h" #include "MemObject.h" +#include "neighbors.h" #include "profiler/Profiler.h" #include "protos.h" #include "rfc1738.h" diff --git a/src/icmp/net_db.cc b/src/icmp/net_db.cc index 80b94799fd..0b633bcb28 100644 --- a/src/icmp/net_db.cc +++ b/src/icmp/net_db.cc @@ -55,6 +55,8 @@ #include "SquidTime.h" #include "wordlist.h" #include "ip/Address.h" +#include "neighbors.h" + #if HAVE_SYS_STAT_H #include diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 6ff79657c2..a4d1df6353 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -51,6 +51,7 @@ #include "ip/tools.h" #include "ipcache.h" #include "md5.h" +#include "neighbors.h" #include "protos.h" #include "rfc1738.h" #include "SquidTime.h" diff --git a/src/main.cc b/src/main.cc index 0854137598..c17fda818d 100644 --- a/src/main.cc +++ b/src/main.cc @@ -65,6 +65,7 @@ #include "ip/tools.h" #include "Mem.h" #include "MemPool.h" +#include "neighbors.h" #include "pconn.h" #include "PeerSelectState.h" #include "profiler/Profiler.h" diff --git a/src/neighbors.cc b/src/neighbors.cc index 10a07e60be..9f64003c7e 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -46,6 +46,7 @@ #include "ipcache.h" #include "MemObject.h" #include "mgr/Registration.h" +#include "neighbors.h" #include "PeerDigest.h" #include "PeerSelectState.h" #include "protos.h" diff --git a/src/neighbors.h b/src/neighbors.h new file mode 100644 index 0000000000..3bfa7c7d75 --- /dev/null +++ b/src/neighbors.h @@ -0,0 +1,88 @@ +/* + * DEBUG: section + * AUTHOR: + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + + +#ifndef SQUID_NEIGHBORS_H_ +#define SQUID_NEIGHBORS_H_ + +#include "enums.h" +#include "HttpRequestMethod.h" +#include "lookup_t.h" +#include "ip/Address.h" +#include "typedefs.h" + +class HttpRequest; +class peer; +class StoreEntry; + +SQUIDCEXTERN peer *getFirstPeer(void); +SQUIDCEXTERN peer *getFirstUpParent(HttpRequest *); +SQUIDCEXTERN peer *getNextPeer(peer *); +SQUIDCEXTERN peer *getSingleParent(HttpRequest *); +SQUIDCEXTERN int neighborsCount(HttpRequest *); +SQUIDCEXTERN int neighborsUdpPing(HttpRequest *, + StoreEntry *, + IRCB * callback, + void *data, + int *exprep, + int *timeout); +SQUIDCEXTERN void neighborAddAcl(const char *, const char *); + +SQUIDCEXTERN void neighborsUdpAck(const cache_key *, icp_common_t *, const Ip::Address &); +SQUIDCEXTERN void neighborAdd(const char *, const char *, int, int, int, int, int); +SQUIDCEXTERN void neighbors_init(void); +#if USE_HTCP +SQUIDCEXTERN void neighborsHtcpClear(StoreEntry *, const char *, HttpRequest *, const HttpRequestMethod &, htcp_clr_reason); +#endif +SQUIDCEXTERN peer *peerFindByName(const char *); +SQUIDCEXTERN peer *peerFindByNameAndPort(const char *, unsigned short); +SQUIDCEXTERN peer *getDefaultParent(HttpRequest * request); +SQUIDCEXTERN peer *getRoundRobinParent(HttpRequest * request); +SQUIDCEXTERN peer *getWeightedRoundRobinParent(HttpRequest * request); +SQUIDCEXTERN void peerClearRRStart(void); +SQUIDCEXTERN void peerClearRR(void); +SQUIDCEXTERN lookup_t peerDigestLookup(peer * p, HttpRequest * request); +SQUIDCEXTERN peer *neighborsDigestSelect(HttpRequest * request); +SQUIDCEXTERN void peerNoteDigestLookup(HttpRequest * request, peer * p, lookup_t lookup); +SQUIDCEXTERN void peerNoteDigestGone(peer * p); +SQUIDCEXTERN int neighborUp(const peer * e); +SQUIDCEXTERN CBDUNL peerDestroy; +SQUIDCEXTERN const char *neighborTypeStr(const peer * e); +SQUIDCEXTERN peer_t neighborType(const peer *, const HttpRequest *); +SQUIDCEXTERN void peerConnectFailed(peer *); +SQUIDCEXTERN void peerConnectSucceded(peer *); +SQUIDCEXTERN void dump_peer_options(StoreEntry *, peer *); +SQUIDCEXTERN int peerHTTPOkay(const peer *, HttpRequest *); + +SQUIDCEXTERN peer *whichPeer(const Ip::Address &from); + +#endif /* SQUID_NEIGHBORS_H_ */ diff --git a/src/peer_digest.cc b/src/peer_digest.cc index 3452281b11..b66000e96d 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -40,6 +40,7 @@ #include "HttpReply.h" #include "HttpRequest.h" #include "MemObject.h" +#include "neighbors.h" #include "PeerDigest.h" #include "protos.h" #include "SquidTime.h" diff --git a/src/peer_select.cc b/src/peer_select.cc index de8e41cc2b..4d8b5b8765 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -45,6 +45,7 @@ #include "icmp/net_db.h" #include "ICP.h" #include "ipcache.h" +#include "neighbors.h" #include "PeerSelectState.h" #include "protos.h" #include "SquidTime.h" diff --git a/src/peer_sourcehash.cc b/src/peer_sourcehash.cc index 57ad36ab07..eac8fd9607 100644 --- a/src/peer_sourcehash.cc +++ b/src/peer_sourcehash.cc @@ -37,6 +37,7 @@ #include "squid.h" #include "HttpRequest.h" #include "mgr/Registration.h" +#include "neighbors.h" #include "protos.h" #include "Store.h" diff --git a/src/peer_userhash.cc b/src/peer_userhash.cc index 342119209c..3f7d28673d 100644 --- a/src/peer_userhash.cc +++ b/src/peer_userhash.cc @@ -42,6 +42,7 @@ #include "globals.h" #include "HttpRequest.h" #include "mgr/Registration.h" +#include "neighbors.h" #include "protos.h" #include "Store.h" diff --git a/src/protos.h b/src/protos.h index c2b63a997d..0ac488f25b 100644 --- a/src/protos.h +++ b/src/protos.h @@ -225,46 +225,6 @@ extern int mimeGetViewOption(const char *fn); extern int mcastSetTtl(int, int); extern IPH mcastJoinGroups; -SQUIDCEXTERN peer *getFirstPeer(void); -SQUIDCEXTERN peer *getFirstUpParent(HttpRequest *); -SQUIDCEXTERN peer *getNextPeer(peer *); -SQUIDCEXTERN peer *getSingleParent(HttpRequest *); -SQUIDCEXTERN int neighborsCount(HttpRequest *); -SQUIDCEXTERN int neighborsUdpPing(HttpRequest *, - StoreEntry *, - IRCB * callback, - void *data, - int *exprep, - int *timeout); -SQUIDCEXTERN void neighborAddAcl(const char *, const char *); - -SQUIDCEXTERN void neighborsUdpAck(const cache_key *, icp_common_t *, const Ip::Address &); -SQUIDCEXTERN void neighborAdd(const char *, const char *, int, int, int, int, int); -SQUIDCEXTERN void neighbors_init(void); -#if USE_HTCP -SQUIDCEXTERN void neighborsHtcpClear(StoreEntry *, const char *, HttpRequest *, const HttpRequestMethod &, htcp_clr_reason); -#endif -SQUIDCEXTERN peer *peerFindByName(const char *); -SQUIDCEXTERN peer *peerFindByNameAndPort(const char *, unsigned short); -SQUIDCEXTERN peer *getDefaultParent(HttpRequest * request); -SQUIDCEXTERN peer *getRoundRobinParent(HttpRequest * request); -SQUIDCEXTERN peer *getWeightedRoundRobinParent(HttpRequest * request); -SQUIDCEXTERN void peerClearRRStart(void); -SQUIDCEXTERN void peerClearRR(void); -SQUIDCEXTERN lookup_t peerDigestLookup(peer * p, HttpRequest * request); -SQUIDCEXTERN peer *neighborsDigestSelect(HttpRequest * request); -SQUIDCEXTERN void peerNoteDigestLookup(HttpRequest * request, peer * p, lookup_t lookup); -SQUIDCEXTERN void peerNoteDigestGone(peer * p); -SQUIDCEXTERN int neighborUp(const peer * e); -SQUIDCEXTERN CBDUNL peerDestroy; -SQUIDCEXTERN const char *neighborTypeStr(const peer * e); -SQUIDCEXTERN peer_t neighborType(const peer *, const HttpRequest *); -SQUIDCEXTERN void peerConnectFailed(peer *); -SQUIDCEXTERN void peerConnectSucceded(peer *); -SQUIDCEXTERN void dump_peer_options(StoreEntry *, peer *); -SQUIDCEXTERN int peerHTTPOkay(const peer *, HttpRequest *); - -SQUIDCEXTERN peer *whichPeer(const Ip::Address &from); /* peer_digest.c */ class PeerDigest; diff --git a/src/snmp_agent.cc b/src/snmp_agent.cc index d0ab68419e..eeff365aff 100644 --- a/src/snmp_agent.cc +++ b/src/snmp_agent.cc @@ -36,6 +36,7 @@ #include "cache_snmp.h" #include "globals.h" #include "mem_node.h" +#include "neighbors.h" #include "protos.h" #include "StatCounters.h" #include "StatHist.h" diff --git a/src/stat.cc b/src/stat.cc index b6f63e3062..70902acfcf 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -52,6 +52,7 @@ #include "mgr/IoAction.h" #include "mgr/Registration.h" #include "mgr/ServiceTimesAction.h" +#include "neighbors.h" #include "protos.h" #include "SquidMath.h" #include "SquidTime.h"