2 * SQUID Web Proxy Cache http://www.squid-cache.org/
3 * ----------------------------------------------------------
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.
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.
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.
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.
29 #ifndef SQUID_PROTOS_H
30 #define SQUID_PROTOS_H
32 /* included for routines that have not moved out to their proper homes
36 /* for routines still in this file that take CacheManager parameters */
37 #include "ip/Address.h"
38 /* for parameters that still need these */
40 /* some parameters stil need this */
42 #include "anyp/ProtocolType.h"
44 #include "HttpHeader.h"
45 #include "HttpStatusCode.h"
48 class HttpRequestMethod
;
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
);
66 SQUIDCEXTERN
void addr2oid(Ip::Address
&addr
, oid
*Dest
);
67 SQUIDCEXTERN
void oid2addr(oid
*Dest
, Ip::Address
&addr
, u_int code
);
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 */
83 #include "comm/forward.h"
85 extern void shut_down(int);
86 extern void rotate_logs(int);
87 extern void reconfigure(int);
91 SQUIDCEXTERN
const char *getMyHostname(void);
92 SQUIDCEXTERN
const char *uniqueHostname(void);
93 SQUIDCEXTERN
void safeunlink(const char *path
, int quiet
);
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();
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
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
;
134 /* AYJ debugs function to show locations being reset with memset() */
135 SQUIDCEXTERN
void *xmemset(void *dst
, int, size_t);
137 SQUIDCEXTERN
void debug_trap(const char *);
138 SQUIDCEXTERN
void logsFlush(void);
139 SQUIDCEXTERN
const char *checkNullString(const char *p
);
141 SQUIDCEXTERN
void squid_getrusage(struct rusage
*r
);
143 SQUIDCEXTERN
double rusage_cputime(struct rusage
*r
);
145 SQUIDCEXTERN
int rusage_maxrss(struct rusage
*r
);
147 SQUIDCEXTERN
int rusage_pagefaults(struct rusage
*r
);
148 SQUIDCEXTERN
void releaseServerSockets(void);
149 SQUIDCEXTERN
void PrintRusage(void);
150 SQUIDCEXTERN
void dumpMallocStats(void);
153 SQUIDCEXTERN
bool unlinkdNeeded(void);
154 SQUIDCEXTERN
void unlinkdInit(void);
155 SQUIDCEXTERN
void unlinkdClose(void);
156 SQUIDCEXTERN
void unlinkdUnlink(const char *);
159 SQUIDCEXTERN peer_t
parseNeighborType(const char *s
);
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
168 SQUIDCEXTERN
char *strwordtok(char *buf
, char **t
); //String.cc
173 SQUIDCEXTERN pid_t
ipcCreate(int type
,
175 const char *const args
[],
177 Ip::Address
&local_addr
,
183 * prototypes for system functions missing from system includes
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);
197 * hack to allow snmp access to the statistics counters
200 SQUIDCEXTERN StatCounters
*snmpStatGet(int);
202 /* CygWin & Windows NT Port */
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_ */
216 SQUIDCEXTERN
int WIN32_pipe(int[2]);
218 SQUIDCEXTERN
int WIN32_getrusage(int, struct rusage
*);
219 SQUIDCEXTERN
void WIN32_ExceptionHandlerInit(void);
221 SQUIDCEXTERN
int Win32__WSAFDIsSet(int fd
, fd_set
* set
);
222 SQUIDCEXTERN DWORD
WIN32_IpAddrChangeMonitorInit();
226 extern char *strtokFile(void);
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
);
236 /* call to ensure the auth component schemes exist. */
237 extern void Init(void);
240 #endif /* USE_AUTH */
242 #endif /* SQUID_PROTOS_H */