#endif
#endif
+
+/* Apparently the IPPROTO_ are not always defined either... */
+/* TODO: find out what OS require these and define specifically for them. */
+#ifndef IPPROTO_UDP
+#define IPPROTO_UDP 0
+#endif
+#ifndef IPPROTO_TCP
+#define IPPROTO_TCP 0
+#endif
+
+
#endif /* _SQUID_COMPAT_SHARED_H */
/**
* prototypes for system function missing from system includes
+ * NP: sys/resource.h and sys/time.h are apparently order-dependant.
*/
+#include <sys/time.h>
#include <sys/resource.h>
SQUIDCEXTERN int getrusage(int, struct rusage *);
AC_DEFINE(NEED_SYS_ERRLIST,1,[If we need to declare sys_errlist[] as external])
fi
+dnl Hurd does not supply MAXPATHLEN. we may need to define it outselves.
+dnl Other system define it in system headers
+AC_CHECK_HEADERS([sys/param.h])
+AC_MSG_CHECKING(for MAXPATHLEN)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/param.h>]],[[int i = MAXPATHLEN;]])],[AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
+ AC_DEFINE(MAXPATHLEN,256,[If MAXPATHLEN has not been defined])])
+
+
dnl Not cached since people are likely to change this
AC_MSG_CHECKING(for libresolv _dns_ttl_ hack)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int _dns_ttl_;]], [[return _dns_ttl_;]])],[AC_MSG_RESULT(yes)
#include "radius.h"
#include "radius-util.h"
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_PWD_H
#include <pwd.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_TIME_H
#include <time.h>
#endif
#include "config.h"
-#if HAVE_SYS_TYES_H
-#include <sys/types.h>
-#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#if HAVE_STDIO_H
#include <stdio.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#if HAVE_STDOI_H
#include <stdio.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#include "util.h"
#include "base64.h"
#if HAVE_STDIO_H
#include <stdio.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#if HAVE_ERRNO_H
#include <errno.h>
#endif
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
/************* CONFIGURATION ***************/
/*
#if !_SQUID_SOLARIS_
typedef int64_t hrtime_t;
-#else
-#include <sys/time.h>
#endif
#if defined(__GNUC__) && ( defined(__i386) || defined(__i386__) )
-/*
- * $Id$
- */
-
#ifndef SQUID_SNMP_API_H
#define SQUID_SNMP_API_H
#include "config.h"
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
/***********************************************************
Copyright 1989 by Carnegie Mellon University
-/*
- * Squid VCS $Id$
- */
#include "config.h"
#if HAVE_STRNSTR
-/* Is strnstr exists and is usablewe do so. */
+/* Is strnstr exists and is usable we do so. */
#define squid_strnstr(a,b,c) strnstr(a,b,c)
#else /* not HAVE_STRNSTR */
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
-#if defined(_SQUID_FREEBSD_)
-#define _etext etext
-#endif
-
SQUIDCEXTERN const char *mkhttpdlogtime(const time_t *);
SQUIDCEXTERN const char *mkrfc1123(time_t);
SQUIDCEXTERN char *uudecode(const char *);
-/*
- * $Id$
- */
-
#include "config.h"
#include "util.h"
#if HAVE_CTYPE_H
#include <ctype.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#define ASCII_DIGIT(c) ((c)-48)
-
/*
* $Id$
*
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_MEMORY_H
#include <memory.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#if HAVE_ASSERT_H
#include <assert.h>
#endif
#if DRIVER
#include <sys/socket.h>
-#include <sys/time.h>
int
main(int argc, char *argv[])
{
-
/*
* $Id$
*
#if HAVE_STDIO_H
#include <stdio.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#if HAVE_CTYPE_H
#include <ctype.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
#include "util.h"
#define RFC850_STRFTIME "%A, %d-%b-%y %H:%M:%S GMT"
-
/*
* $Id$
*
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#if HAVE_MEMORY_H
#include <memory.h>
#endif
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#if HAVE_ASSERT_H
#include <assert.h>
#endif
# undef main(a,b)
#include <sys/socket.h>
-#include <sys/time.h>
int
main(int argc, char *argv[])
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
/**
* xusleep, as usleep but accepts longer pauses
#include "config.h"
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
class ping_data
{
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
+/* NP: sys/time.h is provided by libcompat */
/* globals for accessing time */
extern struct timeval current_time;
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#if HAVE_SYS_RESOURCE_H
-#include <sys/resource.h> /* needs sys/time.h above it */
-#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
SQUIDCEXTERN int fdNFree(void);
+#define FD_READ_METHOD(fd, buf, len) (*fd_table[fd].read_method)(fd, buf, len)
+#define FD_WRITE_METHOD(fd, buf, len) (*fd_table[fd].write_method)(fd, buf, len)
+
#endif /* SQUID_FDE_H */
static char *
storeCossDirSwapLogFile(SwapDir * sd, const char *ext)
{
- LOCAL_ARRAY(char, path, SQUID_MAXPATHLEN);
- LOCAL_ARRAY(char, pathtmp, SQUID_MAXPATHLEN);
+ LOCAL_ARRAY(char, path, MAXPATHLEN);
+ LOCAL_ARRAY(char, pathtmp, MAXPATHLEN);
LOCAL_ARRAY(char, digit, 32);
char *pathtmp2;
if (Config.Log.swap) {
- xstrncpy(pathtmp, sd->path, SQUID_MAXPATHLEN - 64);
+ xstrncpy(pathtmp, sd->path, MAXPATHLEN - 64);
pathtmp2 = pathtmp;
while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL)
pathtmp[strlen(pathtmp) - 1] = '\0';
for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++);
- snprintf(path, SQUID_MAXPATHLEN - 64, Config.Log.swap, pathtmp2);
+ snprintf(path, MAXPATHLEN - 64, Config.Log.swap, pathtmp2);
- if (strncmp(path, Config.Log.swap, SQUID_MAXPATHLEN - 64) == 0) {
+ if (strncmp(path, Config.Log.swap, MAXPATHLEN - 64) == 0) {
strcat(path, ".");
snprintf(digit, 32, "%02d", sd->index);
strncat(path, digit, 3);
}
} else {
- xstrncpy(path, sd->path, SQUID_MAXPATHLEN - 64);
+ xstrncpy(path, sd->path, MAXPATHLEN - 64);
strcat(path, "/swap.state");
}
char *
UFSSwapDir::swapSubDir(int subdirn)const
{
- LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN);
+ LOCAL_ARRAY(char, fullfilename, MAXPATHLEN);
assert(0 <= subdirn && subdirn < l1);
- snprintf(fullfilename, SQUID_MAXPATHLEN, "%s/%02X", path, subdirn);
+ snprintf(fullfilename, MAXPATHLEN, "%s/%02X", path, subdirn);
return fullfilename;
}
char *
UFSSwapDir::logFile(char const *ext) const
{
- LOCAL_ARRAY(char, lpath, SQUID_MAXPATHLEN);
- LOCAL_ARRAY(char, pathtmp, SQUID_MAXPATHLEN);
+ LOCAL_ARRAY(char, lpath, MAXPATHLEN);
+ LOCAL_ARRAY(char, pathtmp, MAXPATHLEN);
LOCAL_ARRAY(char, digit, 32);
char *pathtmp2;
if (Config.Log.swap) {
- xstrncpy(pathtmp, path, SQUID_MAXPATHLEN - 64);
+ xstrncpy(pathtmp, path, MAXPATHLEN - 64);
pathtmp2 = pathtmp;
while ((pathtmp2 = strchr(pathtmp2, '/')) != NULL)
pathtmp[strlen(pathtmp) - 1] = '\0';
for (pathtmp2 = pathtmp; *pathtmp2 == '.'; pathtmp2++);
- snprintf(lpath, SQUID_MAXPATHLEN - 64, Config.Log.swap, pathtmp2);
+ snprintf(lpath, MAXPATHLEN - 64, Config.Log.swap, pathtmp2);
- if (strncmp(lpath, Config.Log.swap, SQUID_MAXPATHLEN - 64) == 0) {
+ if (strncmp(lpath, Config.Log.swap, MAXPATHLEN - 64) == 0) {
strcat(lpath, ".");
snprintf(digit, 32, "%02d", index);
strncat(lpath, digit, 3);
}
} else {
- xstrncpy(lpath, path, SQUID_MAXPATHLEN - 64);
+ xstrncpy(lpath, path, MAXPATHLEN - 64);
strcat(lpath, "/swap.state");
}
D1 = (swap_index / N0) % N1;
N2 = SD->l2;
D2 = ((swap_index / N0) / N1) % N2;
- snprintf(p1, SQUID_MAXPATHLEN, "%s/%02X/%02X",
+ snprintf(p1, MAXPATHLEN, "%s/%02X/%02X",
SD->path, D1, D2);
debugs(36, 3, "storeDirClean: Cleaning directory " << p1);
dir_pointer = opendir(p1);
char *
UFSSwapDir::fullPath(sfileno filn, char *fullpath) const
{
- LOCAL_ARRAY(char, fullfilename, SQUID_MAXPATHLEN);
+ LOCAL_ARRAY(char, fullfilename, MAXPATHLEN);
int L1 = l1;
int L2 = l2;
fullpath[0] = '\0';
- snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X/%08X",
+ snprintf(fullpath, MAXPATHLEN, "%s/%02X/%02X/%08X",
path,
((filn / L2) / L2) % L1,
(filn / L2) % L2,
}
if (0 == in_dir) { /* we need to read in a new directory */
- snprintf(fullpath, SQUID_MAXPATHLEN, "%s/%02X/%02X",
+ snprintf(fullpath, MAXPATHLEN, "%s/%02X/%02X",
sd->path,
curlvl1, curlvl2);
continue;
}
- snprintf(fullfilename, SQUID_MAXPATHLEN, "%s/%s",
+ snprintf(fullfilename, MAXPATHLEN, "%s/%s",
fullpath, entry->d_name);
debugs(47, 3, "commonUfsDirGetNextFile: Opening " << fullfilename);
fd = file_open(fullfilename, O_RDONLY | O_BINARY);
struct dirent *entry;
DIR *td;
- char fullpath[SQUID_MAXPATHLEN];
- char fullfilename[SQUID_MAXPATHLEN];
+ char fullpath[MAXPATHLEN];
+ char fullfilename[MAXPATHLEN];
struct _store_rebuild_data counts;
#include "config.h"
#include "dlink.h"
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
class logfile_buffer_t
{
public:
{
public:
- char path[SQUID_MAXPATHLEN];
+ char path[MAXPATHLEN];
struct {
unsigned int fatal;
static void
mainStartScript(const char *prog)
{
- char script[SQUID_MAXPATHLEN];
+ char script[MAXPATHLEN];
char *t;
size_t sl = 0;
pid_t cpid;
int n_allocated;
int n_configured;
} cacheSwap;
+/*
+ * I'm sick of having to keep doing this ..
+ */
+#define INDEXSD(i) (Config.cacheSwap.swapDirs[(i)].getRaw())
struct {
char *directory;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
*/
+#include "config.h"
+#if HAVE_UNISTD_H
#include <unistd.h>
-#include <stdlib.h>
+#endif
+#if HAVE_STDIO_H
#include <stdio.h>
-#include <sys/types.h>
+#endif
+#if HAVE_CTYPE_H
#include <ctype.h>
-#include <sys/time.h>
+#endif
+#if HAVE_STRINGS_H
#include <strings.h>
+#endif
+#if HAVE_ASSERT_H
#include <assert.h>
+#endif
+
#include "hash.h"
+
#undef free
extern void my_free(char *, int, void *);
+#include "config.h"
+#include "hash.h"
+
+#if HAVE_UNISTD_H
#include <unistd.h>
-#include <stdlib.h>
+#endif
+#if HAVE_STDIO_H
#include <stdio.h>
-#include <sys/types.h>
+#endif
+#if HAVE_CTYPE_H
#include <ctype.h>
-#include <sys/time.h>
+#endif
+#if HAVE_STRINGS_H
#include <strings.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-
-#include "hash.h"
+#endif
static hash_table *mem_table = NULL;
static hash_link *mem_entry;
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if HAVE_TIME_H
#include <time.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if HAVE_ASSERT_H
#include <assert.h>
#endif
+#if HAVE_NETDB_H
#include <netdb.h>
+#endif
+#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
+#endif
#define READ_BUF_SZ 4096
#define URL_BUF_SZ 4096
-#include <sys/time.h>
+#include "config.h"
+
+#if HAVE_ASSERT_H
#include <assert.h>
+#endif
int
main(int argc, char *argv[])
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#if HAVE_SYS_RESOURCE_H
-#include <sys/resource.h> /* needs sys/time.h above it */
-#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif