]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/neighbors.h
2 * DEBUG: section 15 Neighbor Routines
3 * AUTHOR: Harvest Derived
5 * SQUID Web Proxy Cache http://www.squid-cache.org/
6 * ----------------------------------------------------------
8 * Squid is the result of efforts by numerous individuals from
9 * the Internet community; see the CONTRIBUTORS file for full
10 * details. Many organizations have provided support for Squid's
11 * development; see the SPONSORS file for full details. Squid is
12 * Copyrighted (C) 2001 by the Regents of the University of
13 * California; see the COPYRIGHT file for full details. Squid
14 * incorporates software developed and/or copyrighted by other
15 * sources; see the CREDITS file for full details.
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
33 #ifndef SQUID_NEIGHBORS_H_
34 #define SQUID_NEIGHBORS_H_
41 class HttpRequestMethod
;
45 CachePeer
*getFirstPeer(void);
46 CachePeer
*getFirstUpParent(HttpRequest
*);
47 CachePeer
*getNextPeer(CachePeer
*);
48 CachePeer
*getSingleParent(HttpRequest
*);
49 int neighborsCount(HttpRequest
*);
50 int neighborsUdpPing(HttpRequest
*,
56 void neighborAddAcl(const char *, const char *);
58 void neighborsUdpAck(const cache_key
*, icp_common_t
*, const Ip::Address
&);
59 void neighborAdd(const char *, const char *, int, int, int, int, int);
60 void neighbors_init(void);
62 void neighborsHtcpClear(StoreEntry
*, const char *, HttpRequest
*, const HttpRequestMethod
&, htcp_clr_reason
);
64 CachePeer
*peerFindByName(const char *);
65 CachePeer
*peerFindByNameAndPort(const char *, unsigned short);
66 CachePeer
*getDefaultParent(HttpRequest
* request
);
67 CachePeer
*getRoundRobinParent(HttpRequest
* request
);
68 CachePeer
*getWeightedRoundRobinParent(HttpRequest
* request
);
69 void peerClearRRStart(void);
70 void peerClearRR(void);
71 lookup_t
peerDigestLookup(CachePeer
* p
, HttpRequest
* request
);
72 CachePeer
*neighborsDigestSelect(HttpRequest
* request
);
73 void peerNoteDigestLookup(HttpRequest
* request
, CachePeer
* p
, lookup_t lookup
);
74 void peerNoteDigestGone(CachePeer
* p
);
75 int neighborUp(const CachePeer
* e
);
77 const char *neighborTypeStr(const CachePeer
* e
);
78 peer_t
neighborType(const CachePeer
*, const HttpRequest
*);
79 void peerConnectFailed(CachePeer
*);
80 void peerConnectSucceded(CachePeer
*);
81 void dump_peer_options(StoreEntry
*, CachePeer
*);
82 int peerHTTPOkay(const CachePeer
*, HttpRequest
*);
84 /// Whether we can open new connections to the peer (e.g., despite max-conn)
85 bool peerCanOpenMore(const CachePeer
*p
);
86 /// Whether the peer has idle or standby connections that can be used now
87 bool peerHasConnAvailable(const CachePeer
*p
);
88 /// Notifies peer of an associated connection closure.
89 void peerConnClosed(CachePeer
*p
);
91 CachePeer
*whichPeer(const Ip::Address
&from
);
93 #endif /* SQUID_NEIGHBORS_H_ */