]> git.ipfire.org Git - thirdparty/squid.git/blob - src/protos.h
Moved some prototypes to StoreClient.h
[thirdparty/squid.git] / src / protos.h
1 /*
2 * SQUID Web Proxy Cache http://www.squid-cache.org/
3 * ----------------------------------------------------------
4 *
5 * Squid is the result of efforts by numerous individuals from
6 * the Internet community; see the CONTRIBUTORS file for full
7 * details. Many organizations have provided support for Squid's
8 * development; see the SPONSORS file for full details. Squid is
9 * Copyrighted (C) 2001 by the Regents of the University of
10 * California; see the COPYRIGHT file for full details. Squid
11 * incorporates software developed and/or copyrighted by other
12 * sources; see the CREDITS file for full details.
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
27 *
28 */
29 #ifndef SQUID_PROTOS_H
30 #define SQUID_PROTOS_H
31
32 /* included for routines that have not moved out to their proper homes
33 * yet.
34 */
35 #include "Packer.h"
36 /* for routines still in this file that take CacheManager parameters */
37 #include "ip/Address.h"
38 /* for parameters that still need these */
39 #include "enums.h"
40 /* some parameters stil need this */
41 #include "wordlist.h"
42 #include "anyp/ProtocolType.h"
43 #include "Debug.h"
44 #include "HttpHeader.h"
45 #include "HttpStatusCode.h"
46 #include "lookup_t.h"
47
48 class HttpRequestMethod;
49 #if USE_DELAY_POOLS
50 class ClientInfo;
51 #endif
52
53 class FwdState;
54
55 class HttpRequest;
56 class HttpReply;
57
58
59 #if SQUID_SNMP
60 SQUIDCEXTERN PF snmpHandleUdp;
61 SQUIDCEXTERN void snmpInit(void);
62 SQUIDCEXTERN void snmpOpenPorts(void);
63 SQUIDCEXTERN void snmpClosePorts(void);
64 SQUIDCEXTERN const char * snmpDebugOid(oid * Name, snint Len, MemBuf &outbuf);
65
66 SQUIDCEXTERN void addr2oid(Ip::Address &addr, oid *Dest);
67 SQUIDCEXTERN void oid2addr(oid *Dest, Ip::Address &addr, u_int code);
68
69 SQUIDCEXTERN Ip::Address *client_entry(Ip::Address *current);
70 extern variable_list *snmp_basicFn(variable_list *, snint *);
71 extern variable_list *snmp_confFn(variable_list *, snint *);
72 extern variable_list *snmp_sysFn(variable_list *, snint *);
73 extern variable_list *snmp_prfSysFn(variable_list *, snint *);
74 extern variable_list *snmp_prfProtoFn(variable_list *, snint *);
75 extern variable_list *snmp_prfPeerFn(variable_list *, snint *);
76 extern variable_list *snmp_netIpFn(variable_list *, snint *);
77 extern variable_list *snmp_netFqdnFn(variable_list *, snint *);
78 extern variable_list *snmp_netDnsFn(variable_list *, snint *);
79 extern variable_list *snmp_meshPtblFn(variable_list *, snint *);
80 extern variable_list *snmp_meshCtblFn(variable_list *, snint *);
81 #endif /* SQUID_SNMP */
82
83 #include "comm/forward.h"
84
85 extern void shut_down(int);
86 extern void rotate_logs(int);
87 extern void reconfigure(int);
88
89 class store_client;
90
91 SQUIDCEXTERN const char *getMyHostname(void);
92 SQUIDCEXTERN const char *uniqueHostname(void);
93 SQUIDCEXTERN void safeunlink(const char *path, int quiet);
94
95 #include "fatal.h"
96 extern void death(int sig);
97 extern void sigusr2_handle(int sig);
98 extern void sig_child(int sig);
99 extern void sig_shutdown(int sig); ///< handles shutdown notifications from kids
100 SQUIDCEXTERN void leave_suid(void);
101 SQUIDCEXTERN void enter_suid(void);
102 SQUIDCEXTERN void no_suid(void);
103 SQUIDCEXTERN void writePidFile(void);
104 SQUIDCEXTERN void setSocketShutdownLifetimes(int);
105 SQUIDCEXTERN void setMaxFD(void);
106 SQUIDCEXTERN void setSystemLimits(void);
107 extern void squid_signal(int sig, SIGHDLR *, int flags);
108 SQUIDCEXTERN pid_t readPidFile(void);
109 SQUIDCEXTERN void keepCapabilities(void);
110 SQUIDCEXTERN void BroadcastSignalIfAny(int& sig);
111 /// whether the current process is the parent of all other Squid processes
112 SQUIDCEXTERN bool IamMasterProcess();
113 /**
114 whether the current process is dedicated to doing things that only
115 a single process should do, such as PID file maintenance and WCCP
116 */
117 SQUIDCEXTERN bool IamPrimaryProcess();
118 /// whether the current process coordinates worker processes
119 SQUIDCEXTERN bool IamCoordinatorProcess();
120 /// whether the current process handles HTTP transactions and such
121 SQUIDCEXTERN bool IamWorkerProcess();
122 /// whether the current process is dedicated to managing a cache_dir
123 extern bool IamDiskProcess();
124 /// Whether we are running in daemon mode
125 SQUIDCEXTERN bool InDaemonMode(); // try using specific Iam*() checks above first
126 /// Whether there should be more than one worker process running
127 SQUIDCEXTERN bool UsingSmp(); // try using specific Iam*() checks above first
128 /// number of Kid processes as defined in src/ipc/Kid.h
129 SQUIDCEXTERN int NumberOfKids();
130 /// a string describing this process roles such as worker or coordinator
131 extern String ProcessRoles();
132 SQUIDCEXTERN int DebugSignal;
133
134 /* AYJ debugs function to show locations being reset with memset() */
135 SQUIDCEXTERN void *xmemset(void *dst, int, size_t);
136
137 SQUIDCEXTERN void debug_trap(const char *);
138 SQUIDCEXTERN void logsFlush(void);
139 SQUIDCEXTERN const char *checkNullString(const char *p);
140
141 SQUIDCEXTERN void squid_getrusage(struct rusage *r);
142
143 SQUIDCEXTERN double rusage_cputime(struct rusage *r);
144
145 SQUIDCEXTERN int rusage_maxrss(struct rusage *r);
146
147 SQUIDCEXTERN int rusage_pagefaults(struct rusage *r);
148 SQUIDCEXTERN void releaseServerSockets(void);
149 SQUIDCEXTERN void PrintRusage(void);
150 SQUIDCEXTERN void dumpMallocStats(void);
151
152 #if USE_UNLINKD
153 SQUIDCEXTERN bool unlinkdNeeded(void);
154 SQUIDCEXTERN void unlinkdInit(void);
155 SQUIDCEXTERN void unlinkdClose(void);
156 SQUIDCEXTERN void unlinkdUnlink(const char *);
157 #endif
158
159 SQUIDCEXTERN peer_t parseNeighborType(const char *s);
160
161 SQUIDCEXTERN int stringHasWhitespace(const char *); //String.cc
162 SQUIDCEXTERN int stringHasCntl(const char *); //String.cc
163 SQUIDCEXTERN void linklistPush(link_list **, void *); //list.cc
164 SQUIDCEXTERN void *linklistShift(link_list **); //list.cc
165 SQUIDCEXTERN int xrename(const char *from, const char *to); //disk.cc
166 extern int isPowTen(int); //int.cc
167
168 SQUIDCEXTERN char *strwordtok(char *buf, char **t); //String.cc
169
170 /*
171 * ipc.c
172 */
173 SQUIDCEXTERN pid_t ipcCreate(int type,
174 const char *prog,
175 const char *const args[],
176 const char *name,
177 Ip::Address &local_addr,
178 int *rfd,
179 int *wfd,
180 void **hIpc);
181
182 /*
183 * prototypes for system functions missing from system includes
184 */
185
186 #if _SQUID_SOLARIS_
187
188 SQUIDCEXTERN int getrusage(int, struct rusage *);
189 SQUIDCEXTERN int getpagesize(void);
190 #if !defined(_XPG4_2) && !(defined(__EXTENSIONS__) || \
191 (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)))
192 SQUIDCEXTERN int gethostname(char *, int);
193 #endif
194 #endif
195
196 /*
197 * hack to allow snmp access to the statistics counters
198 */
199 class StatCounters;
200 SQUIDCEXTERN StatCounters *snmpStatGet(int);
201
202 /* CygWin & Windows NT Port */
203 /* win32.c */
204 #if _SQUID_WINDOWS_
205 SQUIDCEXTERN int WIN32_Subsystem_Init(int *, char ***);
206 SQUIDCEXTERN void WIN32_sendSignal(int);
207 SQUIDCEXTERN void WIN32_Abort(int);
208 SQUIDCEXTERN void WIN32_Exit(void);
209 SQUIDCEXTERN void WIN32_SetServiceCommandLine(void);
210 SQUIDCEXTERN void WIN32_InstallService(void);
211 SQUIDCEXTERN void WIN32_RemoveService(void);
212 SQUIDCEXTERN int SquidMain(int, char **);
213 #endif /* _SQUID_WINDOWS_ */
214 #if _SQUID_MSWIN_
215
216 SQUIDCEXTERN int WIN32_pipe(int[2]);
217
218 SQUIDCEXTERN int WIN32_getrusage(int, struct rusage *);
219 SQUIDCEXTERN void WIN32_ExceptionHandlerInit(void);
220
221 SQUIDCEXTERN int Win32__WSAFDIsSet(int fd, fd_set* set);
222 SQUIDCEXTERN DWORD WIN32_IpAddrChangeMonitorInit();
223
224 #endif
225
226 extern char *strtokFile(void);
227
228 #if USE_AUTH
229
230 #if HAVE_AUTH_MODULE_NEGOTIATE && HAVE_KRB5 && HAVE_GSSAPI
231 /* upstream proxy authentication */
232 SQUIDCEXTERN char *peer_proxy_negotiate_auth(char *principal_name, char *proxy);
233 #endif
234
235 namespace Auth {
236 /* call to ensure the auth component schemes exist. */
237 extern void Init(void);
238 } // namespace Auth
239
240 #endif /* USE_AUTH */
241
242 #endif /* SQUID_PROTOS_H */