--------------------- PatchSet 3744 Date: 2002/03/17 18:16:05 Author: serassio Branch: nt-2_5 Tag: (none) Log: Added WIN32 specific stuff - more work Members: include/squid-mswin.h:1.1.22.1->1.1.22.2(DEAD) port/win32/include/autoconf.h:1.1->1.1.2.1 port/win32/include/squid-mswin.h:1.1->1.1.2.1 port/win32/squid/squid.dsp:1.1.2.1->1.1.2.2 src/access_log.c:1.15.6.1->1.15.6.1.2.1 src/cachemgr.c:1.6.14.1->1.6.14.2 src/client_side.c:1.47.2.1->1.47.2.1.4.1 src/comm.c:1.18.6.1.2.2->1.18.6.1.2.3 src/defines.h:1.15->1.15.10.1 src/dns_internal.c:1.15->1.15.14.1 src/forward.c:1.13->1.13.12.1 src/ftp.c:1.18.6.1->1.18.6.1.4.1 src/htcp.c:1.9->1.9.10.1 src/icp_v2.c:1.5->1.5.34.1 src/ident.c:1.8->1.8.46.1 src/ipc.c:1.7.10.1->1.7.10.2 src/neighbors.c:1.14->1.14.14.1 src/protos.h:1.41.6.3.4.1->1.41.6.3.4.2 src/snmp_core.c:1.8.12.2->1.8.12.2.4.1 src/ssl.c:1.13->1.13.14.1 src/wccp.c:1.5->1.5.64.1 --- squid/include/squid-mswin.h Wed Feb 14 00:57:29 2007 +++ /dev/null Wed Feb 14 00:55:47 2007 @@ -1,336 +0,0 @@ -/* - * $Id: squid-mswin.h,v 1.1.22.1 2002/03/16 09:27:35 serassio Exp $ - * - * AUTHOR: Guido Serassio & Andrey Shorin - * - * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from the - * Internet community. Development is led by Duane Wessels of the - * National Laboratory for Applied Network Research and funded by the - * National Science Foundation. Squid is Copyrighted (C) 1998 by - * the Regents of the University of California. Please see the - * COPYRIGHT file for full details. Squid incorporates software - * developed and/or copyrighted by other sources. Please 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. - * - */ - -/* Some tricks for MS Compilers */ - -#define __STDC__ 1 - -#include "win32-autoconf.h" - -#pragma include_alias(, ) - -#define alloca _alloca -#define chdir _chdir -#define close _close -#define dup _dup -#define dup2 _dup2 -#define fdopen _fdopen -#define fileno _fileno -#define fstat _fstati64 -#define ftruncate WIN32_ftruncate -#define getcwd _getcwd -#define getpid _getpid -#define geteuid() 100 -#define getegid() 100 -#define getrusage WIN32_getrusage -#define ioctl ioctlsocket -#define is_interface_down WIN32_is_interface_down -#define lseek _lseeki64 -#define memccpy _memccpy -#define mkdir(p,m) _mkdir(p) -#define open _open -#define putenv _putenv -#define setgid(g) 100 -#define setmode _setmode -#define setuid(l) 100 -#define sleep(t) Sleep((t)*1000) -#define snprintf _snprintf -#define stat _stati64 -#define strcasecmp _stricmp -#define strdup _strdup -#define strncasecmp _strnicmp -#define tempnam _tempnam -#define truncate WIN32_truncate -#define umask _umask -#define unlink _unlink -#define vsnprintf _vsnprintf - -#define O_RDONLY _O_RDONLY -#define O_BINARY _O_BINARY -#define O_WRONLY _O_WRONLY -#define O_APPEND _O_APPEND -#define O_TRUNC _O_TRUNC -#define O_CREAT _O_CREAT -#define O_TEXT _O_TEXT -#define O_RDWR _O_RDWR - -#define S_IRWXO 007 -#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR) - -#define SIGHUP 1 /* hangup */ -#define SIGKILL 9 /* kill (cannot be caught or ignored) */ -#define SIGBUS 10 /* bus error */ -#define SIGPIPE 13 /* write on a pipe with no one to read it */ -#define SIGCHLD 20 /* to parent on child stop or exit */ -#define SIGUSR1 30 /* user defined signal 1 */ -#define SIGUSR2 31 /* user defined signal 2 */ - -#define ushort unsigned short int -#define uid_t int -#define gid_t int -#define mode_t int - -struct passwd { - uid_t pw_uid; - gid_t pw_gid; -}; - -struct group { - gid_t gr_gid; -}; - -struct statfs { - long f_type; /* type of filesystem (see below) */ - long f_bsize; /* optimal transfer block size */ - long f_blocks; /* total data blocks in file system */ - long f_bfree; /* free blocks in fs */ - long f_bavail; /* free blocks avail to non-superuser */ - long f_files; /* total file nodes in file system */ - long f_ffree; /* free file nodes in fs */ - long f_fsid; /* file system id */ - long f_namelen; /* maximum length of filenames */ - long f_spare[6]; /* spare for later */ -}; - -#define CHANGE_FD_SETSIZE 1 -#if CHANGE_FD_SETSIZE && SQUID_MAXFD > DEFAULT_FD_SETSIZE -#define FD_SETSIZE SQUID_MAXFD -#endif - -#include -#include -/* Hack to suppress compiler warnings on FD_SET() & FD_CLR() */ -#pragma warning (push) -#pragma warning (disable:4142) -typedef int SOCKET; -/* prevent inclusion of wingdi.h */ -#define NOGDI -#include -#pragma warning (pop) -#include "readdir.h" - -typedef char *caddr_t; - -#undef FD_CLOSE -#undef FD_OPEN -#undef FD_READ -#undef FD_WRITE -#define EISCONN WSAEISCONN -#define EINPROGRESS WSAEINPROGRESS -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EALREADY WSAEALREADY -#define ETIMEDOUT WSAETIMEDOUT -#define ECONNREFUSED WSAECONNREFUSED -#define ECONNRESET WSAECONNRESET -#define ERESTART WSATRY_AGAIN - -/* internal to CTRLIB */ -#define FPIPE 0x08 /* file handle refers to a pipe */ -typedef struct { - long osfhnd; /* underlying OS file HANDLE */ - char osfile; /* attributes of file (e.g., open in text mode?) */ - char pipech; /* one char buffer for handles opened on pipes */ -#ifdef _MT - int lockinitflag; - CRITICAL_SECTION lock; -#endif /* _MT */ - } ioinfo; -extern _CRTIMP ioinfo * __pioinfo[]; -#define IOINFO_L2E 5 -#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) -#define _pioinfo(i) ( __pioinfo[(i) >> IOINFO_L2E] + ((i) & (IOINFO_ARRAY_ELTS - 1)) ) -#define _osfile(i) ( _pioinfo(i)->osfile ) - -#undef h_errno -#define h_errno errno /* we'll set it ourselves */ - -#undef FD_CLR -#define FD_CLR(fd, set) do { \ - u_int __i; \ - SOCKET _sock = _get_osfhandle(fd); \ - for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \ - if (((fd_set FAR *)(set))->fd_array[__i] == _sock) { \ - while (__i < ((fd_set FAR *)(set))->fd_count-1) { \ - ((fd_set FAR *)(set))->fd_array[__i] = \ - ((fd_set FAR *)(set))->fd_array[__i+1]; \ - __i++; \ - } \ - ((fd_set FAR *)(set))->fd_count--; \ - break; \ - } \ - } \ -} while(0) - -#undef FD_SET -#define FD_SET(fd, set) do { \ - u_int __i; \ - SOCKET _sock = _get_osfhandle(fd); \ - for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \ - if (((fd_set FAR *)(set))->fd_array[__i] == (_sock)) { \ - break; \ - } \ - } \ - if (__i == ((fd_set FAR *)(set))->fd_count) { \ - if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) { \ - ((fd_set FAR *)(set))->fd_array[__i] = (_sock); \ - ((fd_set FAR *)(set))->fd_count++; \ - } \ - } \ -} while(0) - -#undef FD_ISSET -#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)_get_osfhandle(fd), (fd_set FAR *)(set)) - -extern __declspec(thread) int ws32_result; - -#if !defined(_etext) /* util.c actually */ -#define strerror(e) xbstrerror(e) -#else -#define NOT_NEEDED 1 -#endif - -/* internal to CRTLIB */ -/* used also in win32lib.c */ -extern void __cdecl _dosmaperr(unsigned long oserrno); - -#define socket(f,t,p) \ - (INVALID_SOCKET == ((SOCKET)ws32_result = socket(f,t,p)) ? \ - ((WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1), -1) : \ - (SOCKET)_open_osfhandle(ws32_result,0)) -#define accept(s,a,l) \ - (INVALID_SOCKET == ((SOCKET)ws32_result = accept(_get_osfhandle(s),a,l)) ? \ - ((WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1), -1) : \ - (SOCKET)_open_osfhandle(ws32_result,0)) -#define bind(s,n,l) \ - (SOCKET_ERROR == bind(_get_osfhandle(s),n,l) ? \ - (errno = WSAGetLastError()), -1 : 0) -#define connect(s,n,l) \ - (SOCKET_ERROR == connect(_get_osfhandle(s),n,l) ? \ - (WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1, -1) : 0) -#define listen(s,b) \ - (SOCKET_ERROR == listen(_get_osfhandle(s),b) ? \ - (WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1, -1) : 0) -#define shutdown(s,h) \ - (SOCKET_ERROR == shutdown(_get_osfhandle(s),h) ? \ - (errno = WSAGetLastError()), -1 : 0) -/* don't want to use it - cause an error */ -#define closesocket(s) \ - use_close_instead -#if defined(COMM_SELECT_C) -#define select(n,r,w,e,t) \ - (SOCKET_ERROR == (ws32_result = select(n,r,w,&errfds,t)) ? \ - ((errno = WSAGetLastError()), -1) : ws32_result) -#else -#define select(n,r,w,e,t) \ - (SOCKET_ERROR == (ws32_result = select(n,r,w,e,t)) ? \ - ((errno = WSAGetLastError()), -1) : ws32_result) -#endif -#define recv(s,b,l,f) \ - (SOCKET_ERROR == (ws32_result = recv(_get_osfhandle(s),b,l,f)) ? \ - ((errno = WSAGetLastError()), -1) : ws32_result) -#define recvfrom(s,b,l,f,fr,frl) \ - (SOCKET_ERROR == (ws32_result = recvfrom(_get_osfhandle(s),b,l,f,fr,frl)) ? \ - ((errno = WSAGetLastError()), -1) : ws32_result) -#define send(s,b,l,f) \ - (SOCKET_ERROR == (ws32_result = send(_get_osfhandle(s),b,l,f)) ? \ - ((errno = WSAGetLastError()), -1) : ws32_result) -#define sendto(s,b,l,f,t,tl) \ - (SOCKET_ERROR == (ws32_result = sendto(_get_osfhandle(s),b,l,f,t,tl)) ? \ - ((errno = WSAGetLastError()), -1) : ws32_result) -#define getsockname(s,n,l) \ - (SOCKET_ERROR == getsockname(_get_osfhandle(s),n,l) ? \ - (errno = WSAGetLastError()), -1 : 0) -#define getsockopt(s,l,o,v,n) \ - (Sleep(1), SOCKET_ERROR == getsockopt(_get_osfhandle(s),l,o,v,n) ? \ - (errno = WSAGetLastError()), -1 : 0) -#define setsockopt(s,l,o,v,n) \ - (SOCKET_ERROR == setsockopt(_get_osfhandle(s),l,o,v,n) ? \ - (errno = WSAGetLastError()), -1 : 0) -#define ioctlsocket(s,c,a) \ - (SOCKET_ERROR == ioctlsocket(_get_osfhandle(s),c,a) ? \ - (errno = WSAGetLastError()), -1 : 0) -#define gethostname(n,l) \ - (SOCKET_ERROR == gethostname(n,l) ? \ - (errno = WSAGetLastError()), -1 : 0) -#define gethostbyname(n) \ - (NULL == ((HOSTENT FAR*)ws32_result = gethostbyname(n)) ? \ - (errno = WSAGetLastError()), NULL : (HOSTENT FAR*)ws32_result) -#define getservbyname(n,p) \ - (NULL == ((SERVENT FAR*)ws32_result = getservbyname(n,p)) ? \ - (errno = WSAGetLastError()), NULL : (SERVENT FAR*)ws32_result) -#define gethostbyaddr(a,l,t) \ - (NULL == ((HOSTENT FAR*)ws32_result = gethostbyaddr(a,l,t)) ? \ - (errno = WSAGetLastError()), NULL : (HOSTENT FAR*)ws32_result) - -#if defined(STORE_IO_C) || defined(STORE_DIR_C) || defined(TOOLS_C) || defined(UTIL_C) -#define read _read -#define write _write -#else -extern __declspec(thread) int _so_err; -extern __declspec(thread) int _so_err_siz; -#define read(fd,buf,siz) \ - (_so_err_siz = sizeof(_so_err), \ - getsockopt((fd),SOL_SOCKET,SO_ERROR,(char*)&_so_err,&_so_err_siz) \ - == 0 ? recv((fd),(buf),(siz),0) : _read((fd),(buf),(siz))) -#define write(fd,buf,siz) \ - (_so_err_siz = sizeof(_so_err), \ - getsockopt((fd),SOL_SOCKET,SO_ERROR,(char*)&_so_err,&_so_err_siz) \ - == 0 ? send((fd),(buf),(siz),0) : _write((fd),(buf),(siz))) -#endif - -#if defined(COMM_C) || defined(TOOLS_C) -#undef close -#define close(s) closesocket(_get_osfhandle(s)) -#endif - -#define RUSAGE_SELF 0 /* calling process */ -#define RUSAGE_CHILDREN -1 /* terminated child processes */ - -struct rusage { - struct timeval ru_utime; /* user time used */ - struct timeval ru_stime; /* system time used */ - long ru_maxrss; /* integral max resident set size */ - long ru_ixrss; /* integral shared text memory size */ - long ru_idrss; /* integral unshared data size */ - long ru_isrss; /* integral unshared stack size */ - long ru_minflt; /* page reclaims */ - long ru_majflt; /* page faults */ - long ru_nswap; /* swaps */ - long ru_inblock; /* block input operations */ - long ru_oublock; /* block output operations */ - long ru_msgsnd; /* messages sent */ - long ru_msgrcv; /* messages received */ - long ru_nsignals; /* signals received */ - long ru_nvcsw; /* voluntary context switches */ - long ru_nivcsw; /* involuntary context switches */ -}; --- /dev/null Wed Feb 14 00:55:47 2007 +++ squid/port/win32/include/autoconf.h Wed Feb 14 00:57:29 2007 @@ -0,0 +1,950 @@ +/* include/autoconf.h. Generated automatically by configure. */ +/* include/autoconf.h.in. Generated automatically from configure.in by autoheader. */ +/* + * All configurable options are enabled by using --enable-.... + * when running configure. See configure --help for a list + * of all available options. + * + * You are free to edit this file, but it will be overwritten + * each time you run configure. You may need to edit this file + * if configure falsely picks up a library function or structure + * that doesn't really work on your system. + * + * Another way to block a function that should not be detected + * is to + * setenv ac_cv_func_ no + * before running configure, as in + * setenv ac_cv_func_setresuid no + * + * It is possible to enable some of the configurable options + * by editing this file alone, but some of them requires changes + * in the Makefiles, wich is done automatically by configure. + * + */ + +/* $Id: autoconf.h,v 1.1.2.1 2002/03/17 18:18:04 serassio Exp $ */ + +/* + * configure command line used to configure Squid + */ + +#undef SQUID_CONFIGURE_OPTIONS +#define SQUID_CONFIGURE_OPTIONS "--disable-wccp --enable-underscores --enable-snmp --enable-win32-service --enable-useragent-log '--enable-auth=basic ntlm' --enable-basic-auth-helpers=win32_locallogon --enable-ntlm-auth-helpers=NTLMSSP --prefix=c:/squid --enable-delay-pools" + +/********************************* + * START OF CONFIGURABLE OPTIONS * + *********************************/ +/* + * If you are upset that the cachemgr.cgi form comes up with the hostname + * field blank, then define this to getfullhostname() + */ +#undef CACHEMGR_HOSTNAME + +/* + * What default TCP port to use for HTTP listening? + */ +#ifndef CACHE_HTTP_PORT +#define CACHE_HTTP_PORT 3128 +#endif + +/* + * What default UDP port to use for ICP listening? + */ +#ifndef CACHE_ICP_PORT +#define CACHE_ICP_PORT 3130 +#endif + +/* Define to do simple malloc debugging */ +#undef XMALLOC_DEBUG + +/* Define for log file trace of mem alloc/free */ +#undef MEM_GEN_TRACE + +/* Define to have malloc statistics */ +#undef XMALLOC_STATISTICS + +/* Define to have a detailed trace of memory allocations */ +#undef XMALLOC_TRACE + +#undef FORW_VIA_DB + +/* Defines how many threads aufs uses for I/O */ +#undef AUFS_IO_THREADS +#define AUFS_IO_THREADS 16 + +/* + * If you want to use Squid's ICMP features (highly recommended!) then + * define this. When USE_ICMP is defined, Squid will send ICMP pings + * to origin server sites. This information is used in numerous ways: + * - Sent in ICP replies so neighbor caches know how close + * you are to the source. + * - For finding the closest instance of a URN. + * - With the 'test_reachability' option. Squid will return + * ICP_OP_MISS_NOFETCH for sites which it cannot ping. + */ +#undef USE_ICMP + +/* + * Traffic management via "delay pools". + */ +#undef DELAY_POOLS + +/* + * If you want to log User-Agent request header values, define this. + * By default, they are written to useragent.log in the Squid log + * directory. + */ +#undef USE_USERAGENT_LOG +#define USE_USERAGENT_LOG 1 + +/* + * If you want to log Referer request header values, define this. + * By default, they are written to referer.log in the Squid log + * directory. + */ +#undef USE_REFERER_LOG + +/* + * A dangerous feature which causes Squid to kill its parent process + * (presumably the RunCache script) upon receipt of SIGTERM or SIGINT. + * Use with caution. + */ +#undef KILL_PARENT_OPT + +/* Define to enable SNMP monitoring of Squid */ +#undef SQUID_SNMP +#define SQUID_SNMP 1 + +/* + * Define to enable WCCP + */ +#undef USE_WCCP +#define USE_WCCP 0 + +/* + * Squid frequently calls gettimeofday() for accurate timestamping. + * If you are concerned that gettimeofday() is called too often, and + * could be causing performance degradation, then you can define + * ALARM_UPDATES_TIME and cause Squid's clock to be updated at regular + * intervals (one second) with ALARM signals. + */ +#undef ALARM_UPDATES_TIME + +/* + * Define this to include code which lets you specify access control + * elements based on ethernet hardware addresses. This code uses + * functions found in 4.4 BSD derviations (e.g. FreeBSD, ?). + */ +#undef USE_ARP_ACL + +/* + * Define this to include code for the Hypertext Cache Protocol (HTCP) + */ +#undef USE_HTCP + +/* + * Use Cache Digests for locating objects in neighbor caches. This + * code is still semi-experimental. + */ +#undef USE_CACHE_DIGESTS + +/* + * Cache Array Routing Protocol + */ +#undef USE_CARP + +/* Define if NTLM is allowed to fail gracefully when a helper has problems */ +#undef NTLM_FAIL_OPEN + +/* + * Define Windows NT & Windows 2000 run service mode + */ +#define USE_WIN32_SERVICE 1 + +/******************************** + * END OF CONFIGURABLE OPTIONS * + ********************************/ + +/* Define if struct tm has tm_gmtoff member */ +#undef HAVE_TM_GMTOFF + +/* Define if struct mallinfo has mxfast member */ +#undef HAVE_EXT_MALLINFO + +/* Default FD_SETSIZE value */ +#undef DEFAULT_FD_SETSIZE +#define DEFAULT_FD_SETSIZE 64 + +/* Maximum number of open filedescriptors */ +#undef SQUID_MAXFD +#define SQUID_MAXFD 8192 + +/* UDP send buffer size */ +#undef SQUID_UDP_SO_SNDBUF +#define SQUID_UDP_SO_SNDBUF 8192 + +/* UDP receive buffer size */ +#undef SQUID_UDP_SO_RCVBUF +#define SQUID_UDP_SO_RCVBUF 8192 + +/* TCP send buffer size */ +#undef SQUID_TCP_SO_SNDBUF +#define SQUID_TCP_SO_SNDBUF 8192 + +/* TCP receive buffer size */ +#undef SQUID_TCP_SO_RCVBUF +#define SQUID_TCP_SO_RCVBUF 8192 + +/* Host type from configure */ +#undef CONFIG_HOST_TYPE +#define CONFIG_HOST_TYPE "i686-pc-winnt" + +/* If we need to declare sys_errlist[] as external */ +#undef NEED_SYS_ERRLIST + +/* If gettimeofday is known to take only one argument */ +#undef GETTIMEOFDAY_NO_TZP + +/* If libresolv.a has been hacked to export _dns_ttl_ */ +#undef LIBRESOLV_DNS_TTL_HACK + +/* Define if struct ip has ip_hl member */ +#undef HAVE_IP_HL + +/* Define if your compiler supports prototyping */ +#undef HAVE_ANSI_PROTOTYPES + +/* Define if we should use GNU regex */ +#undef USE_GNUREGEX +#define USE_GNUREGEX 1 + +/* signed size_t, grr */ +#undef ssize_t +#define ssize_t int + +/* + * Yay! Another Linux brokenness. Its not good enough to know that + * setresuid() exists, because RedHat 5.0 declare setresuid() but + * doesn't implement it. + */ +#undef HAVE_SETRESUID + +/* Define if you have struct rusage */ +#undef HAVE_STRUCT_RUSAGE +#define HAVE_STRUCT_RUSAGE 1 + +/* Define if you have PSAPI.DLL on Windows systems */ +#undef HAVE_WIN32_PSAPI +#define HAVE_WIN32_PSAPI 1 + +/* + * This makes warnings go away. If you have socklen_t defined in your + * /usr/include files, then this should remain undef'd. Otherwise it + * should be defined to int. + */ +#undef socklen_t +#define socklen_t int + +/* + * By default (for now anyway) Squid includes options which allows + * the cache administrator to violate the HTTP protocol specification + * in terms of cache behaviour. Setting this to '0' will disable + * such code. + */ +#define HTTP_VIOLATIONS 1 + +/* + * Enable support for Transparent Proxy on systems using IP-Filter + * address redirection. This provides "masquerading" support for non + * Linux system. + */ +#undef IPF_TRANSPARENT + +/* + * Enable code for assiting in finding memory leaks. Hacker stuff only. + */ +#undef USE_LEAKFINDER + +/* + * type of fd_set array + */ +#undef fd_mask +#define fd_mask int + +/* + * If _res structure has nsaddr_list member + */ +#undef HAVE_RES_NSADDR_LIST + +/* + * If _res structure has ns_list member + */ +#undef HAVE_RES_NS_LIST + +/* + * Compile in support for Ident (RFC 931) lookups? Enabled by default. + */ +#undef USE_IDENT +#define USE_IDENT 1 + +/* + * If your system has statvfs(), and if it actually works! + */ +#undef HAVE_STATVFS + +/* + * If --disable-internal-dns was given to configure, then we'll use + * the dnsserver processes instead. + */ +#undef USE_DNSSERVERS + +/* + * we check for the existance of struct mallinfo + */ +#undef HAVE_STRUCT_MALLINFO + +/* + * Do we want to use truncate(2) or unlink(2)? + */ +#undef USE_TRUNCATE + +/* + * Allow underscores in host names + */ +#undef ALLOW_HOSTNAME_UNDERSCORES +#define ALLOW_HOSTNAME_UNDERSCORES 1 + +/* + * Use the heap-based replacement techniques + */ +#undef HEAP_REPLACEMENT + +/* + * message type for message queues + */ +#define mtyp_t long + +/* + * Define this to include code for SSL encryption. + */ +#undef USE_SSL + +/* + * Define this to make use of the OpenSSL libraries for + * MD5 calculation rather than Squid's own MD5 implementation + * or if building with SSL encryption (USE_SSL) + */ +#undef USE_OPENSSL + +/* Define if you want to set the COSS membuf size */ +#undef COSS_MEMBUF_SZ + +/* Print stacktraces on fatal errors */ +#undef PRINT_STACK_TRACE + +/* + * Define this if unlinkd is required + * (strongly recommended for ufs storage type) + */ +#undef USE_UNLINKD + +/* + * Enable support for Transparent Proxy on Linux 2.4 systems + */ +#undef LINUX_NETFILTER + +/* + * Do we have unix sockets? (required for the winbind ntlm helper + */ +#undef HAVE_UNIXSOCKET + +/* + * Known-size intgers + */ + +#undef int16_t +typedef short int16_t; + +#undef u_int16_t +typedef unsigned short u_int16_t; + +#undef int32_t +typedef int int32_t; + +#undef u_int32_t +typedef unsigned int u_int32_t; + +#undef int64_t +typedef __int64 int64_t; + +#undef u_int64_t +typedef unsigned __int64 u_int64_t; +/* + * Enable support for the X-Accelerator-Vary HTTP header + */ +#undef X_ACCELERATOR_VARY + + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA +#define HAVE_ALLOCA 1 + +/* Define if you have and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define if you have the header file. */ +#undef HAVE_ARPA_NAMESER_H + +/* Define if you have the header file. */ +#undef HAVE_ASSERT_H +#define HAVE_ASSERT_H 1 + +/* Define if you have the `backtrace_symbols_fd' function. */ +#undef HAVE_BACKTRACE_SYMBOLS_FD + +/* Define if you have the `bcopy' function. */ +#undef HAVE_BCOPY + +/* Define if you have the header file. */ +#undef HAVE_BSTRING_H + +/* Define if you have the `bswap_16' function. */ +#undef HAVE_BSWAP_16 + +/* Define if you have the `bswap_32' function. */ +#undef HAVE_BSWAP_32 + +/* Define if you have the header file. */ +#undef HAVE_BYTESWAP_H + +/* Define if you have the `crypt' function. */ +#undef HAVE_CRYPT +#define HAVE_CRYPT 1 + +/* Define if you have the header file. */ +#undef HAVE_CRYPT_H +#define HAVE_CRYPT_H 1 + +/* Define if you have the header file. */ +#undef HAVE_CTYPE_H +#define HAVE_CTYPE_H 1 + +/* Define if you have the header file, and it defines `DIR'. */ +#undef HAVE_DIRENT_H +#define HAVE_DIRENT_H 1 + +/* Define if you have the `drand48' function. */ +#undef HAVE_DRAND48 + +/* Define if you have the header file. */ +#undef HAVE_ERRNO_H +#define HAVE_ERRNO_H 1 + +/* Define if you have the header file. */ +#undef HAVE_EXECINFO_H + +/* Define if you have the `fchmod' function. */ +#undef HAVE_FCHMOD + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H +#define HAVE_FCNTL_H 1 + +/* Define if you have the `getdtablesize' function. */ +#undef HAVE_GETDTABLESIZE + +/* Define if you have the header file. */ +#undef HAVE_GETOPT_H +#define HAVE_GETOPT_H 1 + +/* Define if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the `getrlimit' function. */ +#undef HAVE_GETRLIMIT + +/* Define if you have the `getrusage' function. */ +#undef HAVE_GETRUSAGE +#define HAVE_GETRUSAGE 1 + +/* Define if you have the `getspnam' function. */ +#undef HAVE_GETSPNAM + +/* Define if you have the header file. */ +#undef HAVE_GLIB_H + +/* Define if you have the header file. */ +#undef HAVE_GNUMALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_GRP_H + +/* Define if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have the header file. */ +#undef HAVE_IP_COMPAT_H + +/* Define if you have the header file. */ +#undef HAVE_IP_FIL_COMPAT_H + +/* Define if you have the header file. */ +#undef HAVE_IP_FIL_H + +/* Define if you have the header file. */ +#undef HAVE_IP_NAT_H + +/* Define if you have the `44bsd' library (-l44bsd). */ +#undef HAVE_LIB44BSD + +/* Define if you have the `bind' library (-lbind). */ +#undef HAVE_LIBBIND + +/* Define if you have the `bsd' library (-lbsd). */ +#undef HAVE_LIBBSD + +/* Define if you have the header file. */ +#undef HAVE_LIBC_H + +/* Define if you have the `gnumalloc' library (-lgnumalloc). */ +#undef HAVE_LIBGNUMALLOC + +/* Define if you have the `intl' library (-lintl). */ +#undef HAVE_LIBINTL + +/* Define if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define if you have the `malloc' library (-lmalloc). */ +#undef HAVE_LIBMALLOC + +/* Define if you have the `nsl' library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define if you have the `resolv' library (-lresolv). */ +#undef HAVE_LIBRESOLV + +/* Define if you have the `socket' library (-lsocket). */ +#undef HAVE_LIBSOCKET + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H +#define HAVE_LIMITS_H 1 + +/* Define if you have the header file. */ +#undef HAVE_LINUX_NETFILTER_IPV4_H + +/* Define if you have the `lrand48' function. */ +#undef HAVE_LRAND48 + +/* Define if you have the `mallinfo' function. */ +#undef HAVE_MALLINFO + +/* Define if you have the `mallocblksize' function. */ +#undef HAVE_MALLOCBLKSIZE + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H +#define HAVE_MALLOC_H 1 + +/* Define if you have the `mallopt' function. */ +#undef HAVE_MALLOPT + +/* Define if you have the header file. */ +#undef HAVE_MATH_H +#define HAVE_MATH_H 1 + +/* Define if you have the `memcpy' function. */ +#undef HAVE_MEMCPY +#define HAVE_MEMCPY 1 + +/* Define if you have the `memmove' function. */ +#undef HAVE_MEMMOVE +#define HAVE_MEMMOVE 1 + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H +#define HAVE_MEMORY_H 1 + +/* Define if you have the `memset' function. */ +#undef HAVE_MEMSET +#define HAVE_MEMSET 1 + +/* Define if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define if you have the `mktime' function. */ +#undef HAVE_MKTIME +#define HAVE_MKTIME 1 + +/* Define if you have the header file. */ +#undef HAVE_MOUNT_H + +/* Define if you have the `mstats' function. */ +#undef HAVE_MSTATS + +/* Define if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_IF_ETHER_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_IP_COMPAT_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_IP_FIL_COMPAT_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_IP_FIL_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_IP_NAT_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_TCP_H + +/* Define if you have the header file. */ +#undef HAVE_NET_IF_H + +/* Define if you have the header file. */ +#undef HAVE_NSS_COMMON_H + +/* Define if you have the header file. */ +#undef HAVE_NSS_H + +/* Define if you have the header file. */ +#undef HAVE_OPENSSL_ERR_H + +/* Define if you have the header file. */ +#undef HAVE_OPENSSL_MD5_H + +/* Define if you have the header file. */ +#undef HAVE_OPENSSL_SSL_H + +/* Define if you have the `poll' function. */ +#undef HAVE_POLL + +/* Define if you have the header file. */ +#undef HAVE_POLL_H + +/* Define if you have the `pthread_attr_setschedparam' function. */ +#undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM + +/* Define if you have the `pthread_attr_setscope' function. */ +#undef HAVE_PTHREAD_ATTR_SETSCOPE + +/* Define if you have the `pthread_setschedparam' function. */ +#undef HAVE_PTHREAD_SETSCHEDPARAM + +/* Define if you have the `pthread_sigmask' function. */ +#undef HAVE_PTHREAD_SIGMASK + +/* Define if you have the `putenv' function. */ +#undef HAVE_PUTENV +#define HAVE_PUTENV 1 + +/* Define if you have the header file. */ +#undef HAVE_PWD_H + +/* Define if you have the `random' function. */ +#undef HAVE_RANDOM + +/* Define if you have the `regcomp' function. */ +#undef HAVE_REGCOMP +#define HAVE_REGCOMP 1 + +/* Define if you have the `regexec' function. */ +#undef HAVE_REGEXEC +#define HAVE_REGEXEC 1 + +/* Define if you have the header file. */ +#undef HAVE_REGEX_H + +/* Define if you have the `regfree' function. */ +#define HAVE_REGFREE 1 + +/* Define if you have the header file. */ +#undef HAVE_RESOLV_H + +/* Define if you have the `res_init' function. */ +#undef HAVE_RES_INIT + +/* Define if you have the `rint' function. */ +#undef HAVE_RINT + +/* Define if you have the header file. */ +#undef HAVE_SCHED_H + +/* Define if you have the `seteuid' function. */ +#undef HAVE_SETEUID + +/* Define if you have the `setgroups' function. */ +#undef HAVE_SETGROUPS + +/* Define if you have the `setpgrp' function. */ +#undef HAVE_SETPGRP + +/* Define if you have the `setrlimit' function. */ +#undef HAVE_SETRLIMIT + +/* Define if you have the `setsid' function. */ +#undef HAVE_SETSID + +/* Define if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define if you have the header file. */ +#undef HAVE_SIGNAL_H +#define HAVE_SIGNAL_H 1 + +/* Define if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF +#define HAVE_SNPRINTF 1 + +/* Define if you have the `srand48' function. */ +#undef HAVE_SRAND48 + +/* Define if you have the `srandom' function. */ +#undef HAVE_SRANDOM + +/* Define if you have the `statfs' function. */ +#define HAVE_STATFS 1 + +/* Define if you have the header file. */ +#define HAVE_STDARG_H 1 + +/* Define if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the header file. */ +#undef HAVE_SYSCALL_H + +/* Define if you have the `sysconf' function. */ +#undef HAVE_SYSCONF + +/* Define if you have the `syslog' function. */ +#undef HAVE_SYSLOG + +/* Define if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define if you have the header file, and it defines `DIR'. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_MOUNT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_MSG_H + +/* Define if you have the header file, and it defines `DIR'. */ +#undef HAVE_SYS_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STATVFS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STAT_H +#define HAVE_SYS_STAT_H 1 + +/* Define if you have the header file. */ +#undef HAVE_SYS_SYSCALL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the header file. */ +#undef HAVE_SYS_UN_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_VFS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the `tempnam' function. */ +#define HAVE_TEMPNAM 1 + +/* Define if you have the `timegm' function. */ +#undef HAVE_TIMEGM + +/* Define if you have the header file. */ +#undef HAVE_TIME_H +#define HAVE_TIME_H 1 + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the header file. */ +#undef HAVE_UTIME_H + +/* Define if you have the header file. */ +#undef HAVE_VARARGS_H +#define HAVE_VARARGS_H 1 + +/* Define if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "squid" + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `int16_t', as computed by sizeof. */ +#define SIZEOF_INT16_T 2 + +/* The size of a `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of a `int64_t', as computed by sizeof. */ +#define SIZEOF_INT64_T 8 + +/* The size of a `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of a `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of a `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of a `uint16_t', as computed by sizeof. */ +#define SIZEOF_UINT16_T 0 + +/* The size of a `uint32_t', as computed by sizeof. */ +#define SIZEOF_UINT32_T 0 + +/* The size of a `uint64_t', as computed by sizeof. */ +#define SIZEOF_UINT64_T 0 + +/* The size of a `u_int16_t', as computed by sizeof. */ +#define SIZEOF_U_INT16_T 2 + +/* The size of a `u_int32_t', as computed by sizeof. */ +#define SIZEOF_U_INT32_T 4 + +/* The size of a `u_int64_t', as computed by sizeof. */ +#define SIZEOF_U_INT64_T 8 + +/* The size of a `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 4 + +/* The size of a `__int64', as computed by sizeof. */ +#define SIZEOF___INT64 0 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.5.PRE4-CVS" + +/* Define if your processor stores words with the most significant byte first + (like Motorola and SPARC, unlike Intel and VAX). */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `int' if does not define. */ +/* #undef fd_mask */ + +/* Define to `int' if does not define. */ +/* #undef int16_t */ + +/* Define to `long' if does not define. */ +/* #undef int32_t */ + +/* Define to `unsigned __int64' if does not define. */ +/* #undef int64_t */ + +/* Define to `int' if does not define. */ +/* #undef off_t */ + +/* Define to `int' if does not define. */ +#undef pid_t +#define pid_t long + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef u_int16_t */ + +/* Define to `unsigned long' if does not define. */ +/* #undef u_int32_t */ + +/* Define to `unsigned long long' if does not define. */ +/* #undef u_int64_t */ + --- /dev/null Wed Feb 14 00:55:47 2007 +++ squid/port/win32/include/squid-mswin.h Wed Feb 14 00:57:29 2007 @@ -0,0 +1,335 @@ +/* + * $Id: squid-mswin.h,v 1.1.2.1 2002/03/17 18:18:04 serassio Exp $ + * + * AUTHOR: Guido Serassio & Andrey Shorin + * + * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from the + * Internet community. Development is led by Duane Wessels of the + * National Laboratory for Applied Network Research and funded by the + * National Science Foundation. Squid is Copyrighted (C) 1998 by + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please 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. + * + */ + +/* Some tricks for MS Compilers */ + +#define __STDC__ 1 + +#pragma include_alias(, ) + +#define alloca _alloca +#define chdir _chdir +#define dup _dup +#define dup2 _dup2 +#define fdopen _fdopen +#define fileno _fileno +#define fstat _fstati64 +#define ftruncate WIN32_ftruncate +#define getcwd _getcwd +#define getpid _getpid +#define geteuid() 100 +#define getegid() 100 +#define getrusage WIN32_getrusage +#define ioctl ioctlsocket +#define is_interface_down WIN32_is_interface_down +#define lseek _lseeki64 +#define memccpy _memccpy +#define mkdir(p,m) _mkdir(p) +#define mktemp _mktemp +#define open _open +#define putenv _putenv +#define setgid(g) 100 +#define setmode _setmode +#define setuid(l) 100 +#define sleep(t) Sleep((t)*1000) +#define snprintf _snprintf +#define stat _stati64 +#define strcasecmp _stricmp +#define strdup _strdup +#define strncasecmp _strnicmp +#define tempnam _tempnam +#define truncate WIN32_truncate +#define umask _umask +#define unlink _unlink +#define vsnprintf _vsnprintf + +#define O_RDONLY _O_RDONLY +#define O_BINARY _O_BINARY +#define O_WRONLY _O_WRONLY +#define O_APPEND _O_APPEND +#define O_TRUNC _O_TRUNC +#define O_CREAT _O_CREAT +#define O_TEXT _O_TEXT +#define O_RDWR _O_RDWR + +#define S_IRWXO 007 +#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR) + +#define SIGHUP 1 /* hangup */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#define SIGPIPE 13 /* write on a pipe with no one to read it */ +#define SIGCHLD 20 /* to parent on child stop or exit */ +#define SIGUSR1 30 /* user defined signal 1 */ +#define SIGUSR2 31 /* user defined signal 2 */ + +#define ushort unsigned short int +#define uid_t int +#define gid_t int +#define mode_t int + +struct passwd { + uid_t pw_uid; + gid_t pw_gid; +}; + +struct group { + gid_t gr_gid; +}; + +struct statfs { + long f_type; /* type of filesystem (see below) */ + long f_bsize; /* optimal transfer block size */ + long f_blocks; /* total data blocks in file system */ + long f_bfree; /* free blocks in fs */ + long f_bavail; /* free blocks avail to non-superuser */ + long f_files; /* total file nodes in file system */ + long f_ffree; /* free file nodes in fs */ + long f_fsid; /* file system id */ + long f_namelen; /* maximum length of filenames */ + long f_spare[6]; /* spare for later */ +}; + +#define CHANGE_FD_SETSIZE 1 +#if CHANGE_FD_SETSIZE && SQUID_MAXFD > DEFAULT_FD_SETSIZE +#define FD_SETSIZE SQUID_MAXFD +#endif + +#include +#include +/* Hack to suppress compiler warnings on FD_SET() & FD_CLR() */ +#pragma warning (push) +#pragma warning (disable:4142) +typedef int SOCKET; +/* prevent inclusion of wingdi.h */ +#define NOGDI +#include +#pragma warning (pop) +#include "readdir.h" + +typedef char *caddr_t; + +#undef FD_CLOSE +#undef FD_OPEN +#undef FD_READ +#undef FD_WRITE +#define EISCONN WSAEISCONN +#define EINPROGRESS WSAEINPROGRESS +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EALREADY WSAEALREADY +#define ETIMEDOUT WSAETIMEDOUT +#define ECONNREFUSED WSAECONNREFUSED +#define ECONNRESET WSAECONNRESET +#define ERESTART WSATRY_AGAIN + +/* internal to CTRLIB */ +#define FPIPE 0x08 /* file handle refers to a pipe */ +typedef struct { + long osfhnd; /* underlying OS file HANDLE */ + char osfile; /* attributes of file (e.g., open in text mode?) */ + char pipech; /* one char buffer for handles opened on pipes */ +#ifdef _MT + int lockinitflag; + CRITICAL_SECTION lock; +#endif /* _MT */ + } ioinfo; +extern _CRTIMP ioinfo * __pioinfo[]; +#define IOINFO_L2E 5 +#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) +#define _pioinfo(i) ( __pioinfo[(i) >> IOINFO_L2E] + ((i) & (IOINFO_ARRAY_ELTS - 1)) ) +#define _osfile(i) ( _pioinfo(i)->osfile ) + +#undef h_errno +#define h_errno errno /* we'll set it ourselves */ + +#undef FD_CLR +#define FD_CLR(fd, set) do { \ + u_int __i; \ + SOCKET _sock = _get_osfhandle(fd); \ + for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \ + if (((fd_set FAR *)(set))->fd_array[__i] == _sock) { \ + while (__i < ((fd_set FAR *)(set))->fd_count-1) { \ + ((fd_set FAR *)(set))->fd_array[__i] = \ + ((fd_set FAR *)(set))->fd_array[__i+1]; \ + __i++; \ + } \ + ((fd_set FAR *)(set))->fd_count--; \ + break; \ + } \ + } \ +} while(0) + +#undef FD_SET +#define FD_SET(fd, set) do { \ + u_int __i; \ + SOCKET _sock = _get_osfhandle(fd); \ + for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \ + if (((fd_set FAR *)(set))->fd_array[__i] == (_sock)) { \ + break; \ + } \ + } \ + if (__i == ((fd_set FAR *)(set))->fd_count) { \ + if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) { \ + ((fd_set FAR *)(set))->fd_array[__i] = (_sock); \ + ((fd_set FAR *)(set))->fd_count++; \ + } \ + } \ +} while(0) + +#undef FD_ISSET +#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)_get_osfhandle(fd), (fd_set FAR *)(set)) + +extern __declspec(thread) int ws32_result; + +#if !defined(_etext) /* util.c actually */ +#define strerror(e) xbstrerror(e) +#else +#define NOT_NEEDED 1 +#endif + +/* internal to CRTLIB */ +/* used also in win32lib.c */ +extern void __cdecl _dosmaperr(unsigned long oserrno); + +#define socket(f,t,p) \ + (INVALID_SOCKET == ((SOCKET)ws32_result = socket(f,t,p)) ? \ + ((WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1), -1) : \ + (SOCKET)_open_osfhandle(ws32_result,0)) +#define accept(s,a,l) \ + (INVALID_SOCKET == ((SOCKET)ws32_result = accept(_get_osfhandle(s),a,l)) ? \ + ((WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1), -1) : \ + (SOCKET)_open_osfhandle(ws32_result,0)) +#define bind(s,n,l) \ + (SOCKET_ERROR == bind(_get_osfhandle(s),n,l) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define connect(s,n,l) \ + (SOCKET_ERROR == connect(_get_osfhandle(s),n,l) ? \ + (WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1, -1) : 0) +#define listen(s,b) \ + (SOCKET_ERROR == listen(_get_osfhandle(s),b) ? \ + (WSAEMFILE == (errno = WSAGetLastError()) ? errno = EMFILE : -1, -1) : 0) +#define shutdown(s,h) \ + (SOCKET_ERROR == shutdown(_get_osfhandle(s),h) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define closesocket(s) \ + (SOCKET_ERROR == closesocket(_get_osfhandle(s)) ? \ + (errno = WSAGetLastError()), -1 : 0) +#if defined(COMM_SELECT_C) +#define select(n,r,w,e,t) \ + (SOCKET_ERROR == (ws32_result = select(n,r,w,&errfds,t)) ? \ + ((errno = WSAGetLastError()), -1) : ws32_result) +#else +#define select(n,r,w,e,t) \ + (SOCKET_ERROR == (ws32_result = select(n,r,w,e,t)) ? \ + ((errno = WSAGetLastError()), -1) : ws32_result) +#endif +#define recv(s,b,l,f) \ + (SOCKET_ERROR == (ws32_result = recv(_get_osfhandle(s),b,l,f)) ? \ + ((errno = WSAGetLastError()), -1) : ws32_result) +#define recvfrom(s,b,l,f,fr,frl) \ + (SOCKET_ERROR == (ws32_result = recvfrom(_get_osfhandle(s),b,l,f,fr,frl)) ? \ + ((errno = WSAGetLastError()), -1) : ws32_result) +#define send(s,b,l,f) \ + (SOCKET_ERROR == (ws32_result = send(_get_osfhandle(s),b,l,f)) ? \ + ((errno = WSAGetLastError()), -1) : ws32_result) +#define sendto(s,b,l,f,t,tl) \ + (SOCKET_ERROR == (ws32_result = sendto(_get_osfhandle(s),b,l,f,t,tl)) ? \ + ((errno = WSAGetLastError()), -1) : ws32_result) +#define getsockname(s,n,l) \ + (SOCKET_ERROR == getsockname(_get_osfhandle(s),n,l) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define getsockopt(s,l,o,v,n) \ + (Sleep(1), SOCKET_ERROR == getsockopt(_get_osfhandle(s),l,o,v,n) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define setsockopt(s,l,o,v,n) \ + (SOCKET_ERROR == setsockopt(_get_osfhandle(s),l,o,v,n) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define ioctlsocket(s,c,a) \ + (SOCKET_ERROR == ioctlsocket(_get_osfhandle(s),c,a) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define gethostname(n,l) \ + (SOCKET_ERROR == gethostname(n,l) ? \ + (errno = WSAGetLastError()), -1 : 0) +#define gethostbyname(n) \ + (NULL == ((HOSTENT FAR*)ws32_result = gethostbyname(n)) ? \ + (errno = WSAGetLastError()), NULL : (HOSTENT FAR*)ws32_result) +#define getservbyname(n,p) \ + (NULL == ((SERVENT FAR*)ws32_result = getservbyname(n,p)) ? \ + (errno = WSAGetLastError()), NULL : (SERVENT FAR*)ws32_result) +#define gethostbyaddr(a,l,t) \ + (NULL == ((HOSTENT FAR*)ws32_result = gethostbyaddr(a,l,t)) ? \ + (errno = WSAGetLastError()), NULL : (HOSTENT FAR*)ws32_result) + +#if defined(STORE_IO_C) || defined(STORE_DIR_C) || defined(TOOLS_C) || defined(UTIL_C) +#define read _read +#define write _write +#else +extern __declspec(thread) int _so_err; +extern __declspec(thread) int _so_err_siz; +#define read(fd,buf,siz) \ + (_so_err_siz = sizeof(_so_err), \ + getsockopt((fd),SOL_SOCKET,SO_ERROR,(char*)&_so_err,&_so_err_siz) \ + == 0 ? recv((fd),(buf),(siz),0) : _read((fd),(buf),(siz))) +#define write(fd,buf,siz) \ + (_so_err_siz = sizeof(_so_err), \ + getsockopt((fd),SOL_SOCKET,SO_ERROR,(char*)&_so_err,&_so_err_siz) \ + == 0 ? send((fd),(buf),(siz),0) : _write((fd),(buf),(siz))) +#endif + +#if defined(COMM_C) || defined(TOOLS_C) +#define close closesocket +#else +#define close _close +#endif + +#define RUSAGE_SELF 0 /* calling process */ +#define RUSAGE_CHILDREN -1 /* terminated child processes */ + +struct rusage { + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ + long ru_maxrss; /* integral max resident set size */ + long ru_ixrss; /* integral shared text memory size */ + long ru_idrss; /* integral unshared data size */ + long ru_isrss; /* integral unshared stack size */ + long ru_minflt; /* page reclaims */ + long ru_majflt; /* page faults */ + long ru_nswap; /* swaps */ + long ru_inblock; /* block input operations */ + long ru_oublock; /* block output operations */ + long ru_msgsnd; /* messages sent */ + long ru_msgrcv; /* messages received */ + long ru_nsignals; /* signals received */ + long ru_nvcsw; /* voluntary context switches */ + long ru_nivcsw; /* involuntary context switches */ +}; Index: squid/port/win32/squid/squid.dsp =================================================================== RCS file: /cvsroot/squid-sf//squid/port/win32/squid/Attic/squid.dsp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid/port/win32/squid/squid.dsp 16 Mar 2002 17:46:08 -0000 1.1.2.1 +++ squid/port/win32/squid/squid.dsp 17 Mar 2002 18:16:05 -0000 1.1.2.2 @@ -42,7 +42,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../" /I "../include" /I "../../../include" /I "../../../src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /D DEFAULT_CONFIG_FILE=\"c:/squid/etc/squid.conf\" /c +# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../../" /I "../include" /I "../../../include" /I "../../../src" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D DEFAULT_CONFIG_FILE=\"squid.conf\" /YX /FD /c # ADD BASE RSC /l 0x410 /d "NDEBUG" # ADD RSC /l 0x410 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../include" /I "../../../include" /I "../../../src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /D DEFAULT_CONFIG_FILE=\"c:/squid/etc/squid.conf\" /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../include" /I "../../../include" /I "../../../src" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D DEFAULT_CONFIG_FILE=\"squid.conf\" /YX /FD /GZ /c # ADD BASE RSC /l 0x410 /d "_DEBUG" # ADD RSC /l 0x410 /d "_DEBUG" BSC32=bscmake.exe @@ -203,10 +203,6 @@ # End Source File # Begin Source File -SOURCE=..\..\..\src\htcp.c -# End Source File -# Begin Source File - SOURCE=..\..\..\src\http.c # End Source File # Begin Source File Index: squid/src/access_log.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/access_log.c,v retrieving revision 1.15.6.1 retrieving revision 1.15.6.1.2.1 diff -u -r1.15.6.1 -r1.15.6.1.2.1 --- squid/src/access_log.c 27 Feb 2002 09:18:08 -0000 1.15.6.1 +++ squid/src/access_log.c 17 Mar 2002 18:16:05 -0000 1.15.6.1.2.1 @@ -1,6 +1,6 @@ /* - * $Id: access_log.c,v 1.15.6.1 2002/02/27 09:18:08 squidadm Exp $ + * $Id: access_log.c,v 1.15.6.1.2.1 2002/03/17 18:16:05 serassio Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -399,7 +399,7 @@ mcast_miss_to.sin_port = htons(Config.mcast_miss.port); mcast_miss_to.sin_addr.s_addr = Config.mcast_miss.addr.s_addr; mcast_miss_fd = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.udp_incoming, Config.mcast_miss.port, COMM_NONBLOCKING, Index: squid/src/cachemgr.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/cachemgr.c,v retrieving revision 1.6.14.1 retrieving revision 1.6.14.2 diff -u -r1.6.14.1 -r1.6.14.2 --- squid/src/cachemgr.c 14 Mar 2002 20:23:43 -0000 1.6.14.1 +++ squid/src/cachemgr.c 17 Mar 2002 18:16:05 -0000 1.6.14.2 @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.c,v 1.6.14.1 2002/03/14 20:23:43 serassio Exp $ + * $Id: cachemgr.c,v 1.6.14.2 2002/03/17 18:16:05 serassio Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Duane Wessels @@ -619,7 +619,7 @@ debug(1) fprintf(stderr, "wrote request: '%s'\n", buf); #ifdef _SQUID_MSWIN_ answer=read_reply(s, req); - close(s); + closesocket(s); return answer; #else return read_reply(s, req); Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.47.2.1 retrieving revision 1.47.2.1.4.1 diff -u -r1.47.2.1 -r1.47.2.1.4.1 --- squid/src/client_side.c 14 Feb 2002 01:16:45 -0000 1.47.2.1 +++ squid/src/client_side.c 17 Mar 2002 18:16:06 -0000 1.47.2.1.4.1 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.47.2.1 2002/02/14 01:16:45 squidadm Exp $ + * $Id: client_side.c,v 1.47.2.1.4.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -3474,7 +3474,7 @@ } enter_suid(); fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, s->s.sin_addr, ntohs(s->s.sin_port), COMM_NONBLOCKING, @@ -3507,7 +3507,7 @@ for (s = Config.Sockaddr.https; s; s = s->next) { enter_suid(); fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, s->s.sin_addr, ntohs(s->s.sin_port), COMM_NONBLOCKING, Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.18.6.1.2.2 retrieving revision 1.18.6.1.2.3 diff -u -r1.18.6.1.2.2 -r1.18.6.1.2.3 --- squid/src/comm.c 16 Mar 2002 09:39:02 -0000 1.18.6.1.2.2 +++ squid/src/comm.c 17 Mar 2002 18:16:06 -0000 1.18.6.1.2.3 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.18.6.1.2.2 2002/03/16 09:39:02 serassio Exp $ + * $Id: comm.c,v 1.18.6.1.2.3 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -216,6 +216,9 @@ if ((flags & COMM_REUSEADDR)) commSetReuseAddr(new_socket); if (port > (u_short) 0) { +#ifdef _SQUID_MSWIN_ + if (sock_type != SOCK_DGRAM) +#endif commSetNoLinger(new_socket); if (opt_reuseaddr) commSetReuseAddr(new_socket); Index: squid/src/defines.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/defines.h,v retrieving revision 1.15 retrieving revision 1.15.10.1 diff -u -r1.15 -r1.15.10.1 --- squid/src/defines.h 18 Nov 2001 01:15:42 -0000 1.15 +++ squid/src/defines.h 17 Mar 2002 18:16:06 -0000 1.15.10.1 @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.15 2001/11/18 01:15:42 squidadm Exp $ + * $Id: defines.h,v 1.15.10.1 2002/03/17 18:16:06 serassio Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -296,4 +296,21 @@ #define O_BINARY 0 #endif +/* CygWin & Windows NT Port */ +#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#define _WIN_HOSTS_FILENAME "\\hosts" +#define _WIN95_NETWORK_DB_HOSTS "%WINDIR%" +#define _WIN_SQUID_SERVICE_CONTROL_STOP SERVICE_CONTROL_STOP +#define _WIN_SQUID_SERVICE_CONTROL_SHUTDOWN SERVICE_CONTROL_SHUTDOWN +#define _WIN_SQUID_SERVICE_CONTROL_INTERROGATE SERVICE_CONTROL_INTERROGATE +#define _WIN_SQUID_SERVICE_CONTROL_ROTATE 128 +#define _WIN_SQUID_SERVICE_CONTROL_RECONFIGURE 129 +#define _WIN_SQUID_SERVICE_CONTROL_DEBUG 130 +#define _WIN_SQUID_SERVICE_CONTROL_INTERRUPT 131 +#define _WIN_SQUID_DEFAULT_SERVICE_NAME "SquidNT" +#define _WIN_SQUID_SERVICE_OPTION "--ntservice" +#define _WIN_SQUID_RUN_MODE_INTERACTIVE 0 +#define _WIN_SQUID_RUN_MODE_SERVICE 1 +#endif + #endif /* SQUID_DEFINES_H */ Index: squid/src/dns_internal.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/dns_internal.c,v retrieving revision 1.15 retrieving revision 1.15.14.1 diff -u -r1.15 -r1.15.14.1 --- squid/src/dns_internal.c 18 Nov 2001 01:15:42 -0000 1.15 +++ squid/src/dns_internal.c 17 Mar 2002 18:16:06 -0000 1.15.14.1 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.c,v 1.15 2001/11/18 01:15:42 squidadm Exp $ + * $Id: dns_internal.c,v 1.15.14.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -621,7 +621,7 @@ else addr = Config.Addrs.udp_incoming; DnsSocket = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, addr, 0, COMM_NONBLOCKING, Index: squid/src/forward.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/forward.c,v retrieving revision 1.13 retrieving revision 1.13.12.1 diff -u -r1.13 -r1.13.12.1 --- squid/src/forward.c 10 Oct 2001 18:07:43 -0000 1.13 +++ squid/src/forward.c 17 Mar 2002 18:16:06 -0000 1.13.12.1 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.13 2001/10/10 18:07:43 squidadm Exp $ + * $Id: forward.c,v 1.13.12.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -366,7 +366,7 @@ debug(17, 3) ("fwdConnectStart: got addr %s, tos %d\n", inet_ntoa(outgoing), tos); fd = comm_openex(SOCK_STREAM, - 0, + IPPROTO_TCP, outgoing, 0, COMM_NONBLOCKING, Index: squid/src/ftp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ftp.c,v retrieving revision 1.18.6.1 retrieving revision 1.18.6.1.4.1 diff -u -r1.18.6.1 -r1.18.6.1.4.1 --- squid/src/ftp.c 18 Feb 2002 15:01:19 -0000 1.18.6.1 +++ squid/src/ftp.c 17 Mar 2002 18:16:06 -0000 1.18.6.1.4.1 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.18.6.1 2002/02/18 15:01:19 squidadm Exp $ + * $Id: ftp.c,v 1.18.6.1.4.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1682,7 +1682,7 @@ } /* Open data channel with the same local address as control channel */ fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, addr.sin_addr, 0, COMM_NONBLOCKING, @@ -1815,7 +1815,7 @@ port = ntohs(addr.sin_port); } fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, addr.sin_addr, port, COMM_NONBLOCKING | (fallback ? COMM_REUSEADDR : 0), Index: squid/src/htcp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/htcp.c,v retrieving revision 1.9 retrieving revision 1.9.10.1 diff -u -r1.9 -r1.9.10.1 --- squid/src/htcp.c 15 Dec 2001 04:40:27 -0000 1.9 +++ squid/src/htcp.c 17 Mar 2002 18:16:06 -0000 1.9.10.1 @@ -1,6 +1,6 @@ /* - * $Id: htcp.c,v 1.9 2001/12/15 04:40:27 squidadm Exp $ + * $Id: htcp.c,v 1.9.10.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -860,7 +860,7 @@ } enter_suid(); htcpInSocket = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.udp_incoming, Config.Port.htcp, COMM_NONBLOCKING, @@ -874,7 +874,7 @@ if (Config.Addrs.udp_outgoing.s_addr != no_addr.s_addr) { enter_suid(); htcpOutSocket = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.udp_outgoing, Config.Port.htcp, COMM_NONBLOCKING, Index: squid/src/icp_v2.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/icp_v2.c,v retrieving revision 1.5 retrieving revision 1.5.34.1 diff -u -r1.5 -r1.5.34.1 --- squid/src/icp_v2.c 4 May 2001 13:39:12 -0000 1.5 +++ squid/src/icp_v2.c 17 Mar 2002 18:16:06 -0000 1.5.34.1 @@ -1,6 +1,6 @@ /* - * $Id: icp_v2.c,v 1.5 2001/05/04 13:39:12 squidadm Exp $ + * $Id: icp_v2.c,v 1.5.34.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -413,7 +413,7 @@ return; enter_suid(); theInIcpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.udp_incoming, port, COMM_NONBLOCKING, @@ -434,7 +434,7 @@ if ((addr = Config.Addrs.udp_outgoing).s_addr != no_addr.s_addr) { enter_suid(); theOutIcpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, addr, port, COMM_NONBLOCKING, Index: squid/src/ident.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ident.c,v retrieving revision 1.8 retrieving revision 1.8.46.1 diff -u -r1.8 -r1.8.46.1 --- squid/src/ident.c 14 Apr 2001 00:31:02 -0000 1.8 +++ squid/src/ident.c 17 Mar 2002 18:16:06 -0000 1.8.46.1 @@ -1,6 +1,6 @@ /* - * $Id: ident.c,v 1.8 2001/04/14 00:31:02 squidadm Exp $ + * $Id: ident.c,v 1.8.46.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 30 Ident (RFC 931) * AUTHOR: Duane Wessels @@ -205,7 +205,7 @@ return; } fd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, me->sin_addr, 0, COMM_NONBLOCKING, Index: squid/src/ipc.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ipc.c,v retrieving revision 1.7.10.1 retrieving revision 1.7.10.2 diff -u -r1.7.10.1 -r1.7.10.2 --- squid/src/ipc.c 14 Mar 2002 20:23:44 -0000 1.7.10.1 +++ squid/src/ipc.c 17 Mar 2002 18:16:06 -0000 1.7.10.2 @@ -1,6 +1,6 @@ /* - * $Id: ipc.c,v 1.7.10.1 2002/03/14 20:23:44 serassio Exp $ + * $Id: ipc.c,v 1.7.10.2 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -129,26 +129,26 @@ #endif if (type == IPC_TCP_SOCKET) { crfd = cwfd = comm_open(SOCK_STREAM, - 0, + IPPROTO_TCP, local_addr, 0, COMM_NOCLOEXEC, name); prfd = pwfd = comm_open(SOCK_STREAM, - 0, /* protocol */ + IPPROTO_TCP, /* protocol */ local_addr, 0, /* port */ 0, /* blocking */ name); } else if (type == IPC_UDP_SOCKET) { crfd = cwfd = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, local_addr, 0, COMM_NOCLOEXEC, name); prfd = pwfd = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, local_addr, 0, 0, @@ -512,7 +512,7 @@ if (type == IPC_UDP_SOCKET) { snprintf(buf1, 8192, "%s(%ld) <-> ipc CHILD socket", prog, -1); - crfd_ipc = cwfd_ipc = comm_open(SOCK_DGRAM, 0, local_addr, 0, 0, buf1); + crfd_ipc = cwfd_ipc = comm_open(SOCK_DGRAM, IPPROTO_UDP, local_addr, 0, 0, buf1); if (crfd_ipc < 0) { debug(54, @@ -523,7 +523,7 @@ } snprintf(buf1, 8192, "%s(%ld) <-> ipc PARENT socket", prog, -1); - prfd_ipc = pwfd_ipc = comm_open(SOCK_DGRAM, 0, local_addr, 0, 0, buf1); + prfd_ipc = pwfd_ipc = comm_open(SOCK_DGRAM, IPPROTO_UDP, local_addr, 0, 0, buf1); if (pwfd_ipc < 0) { debug(54, 0) ("ipcCreate: CHILD: Failed to create server FD for %s.\n", Index: squid/src/neighbors.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/neighbors.c,v retrieving revision 1.14 retrieving revision 1.14.14.1 diff -u -r1.14 -r1.14.14.1 --- squid/src/neighbors.c 18 Oct 2001 20:52:11 -0000 1.14 +++ squid/src/neighbors.c 17 Mar 2002 18:16:06 -0000 1.14.14.1 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.14 2001/10/18 20:52:11 squidadm Exp $ + * $Id: neighbors.c,v 1.14.14.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -1072,7 +1072,7 @@ return; /* probe already running */ if (squid_curtime - p->stats.last_connect_probe < Config.Timeout.connect) return; /* don't probe to often */ - fd = comm_open(SOCK_STREAM, 0, getOutgoingAddr(NULL), + fd = comm_open(SOCK_STREAM, IPPROTO_TCP, getOutgoingAddr(NULL), 0, COMM_NONBLOCKING, p->host); if (fd < 0) return; Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.41.6.3.4.1 retrieving revision 1.41.6.3.4.2 diff -u -r1.41.6.3.4.1 -r1.41.6.3.4.2 --- squid/src/protos.h 14 Mar 2002 20:23:44 -0000 1.41.6.3.4.1 +++ squid/src/protos.h 17 Mar 2002 18:16:06 -0000 1.41.6.3.4.2 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.41.6.3.4.1 2002/03/14 20:23:44 serassio Exp $ + * $Id: protos.h,v 1.41.6.3.4.2 2002/03/17 18:16:06 serassio Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1341,12 +1341,6 @@ extern void WIN32_SetServiceCommandLine(void); extern void WIN32_InstallService(void); extern void WIN32_RemoveService(void); -#if defined(_SQUID_MSWIN_) && !defined(COMM_C) -#define comm_open(sock_type,proto,addr,port,flags,note) \ - comm_open((sock_type), \ - (sock_type) == SOCK_DGRAM ? IPPROTO_UDP : IPPROTO_TCP, \ - (addr),(port),(flags),(note)) -#endif extern int WIN32_getrusage(int, struct rusage *); extern int WIN32_is_interface_down(const char *); #endif Index: squid/src/snmp_core.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/snmp_core.c,v retrieving revision 1.8.12.2 retrieving revision 1.8.12.2.4.1 diff -u -r1.8.12.2 -r1.8.12.2.4.1 --- squid/src/snmp_core.c 16 Feb 2002 13:25:56 -0000 1.8.12.2 +++ squid/src/snmp_core.c 17 Mar 2002 18:16:06 -0000 1.8.12.2.4.1 @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.c,v 1.8.12.2 2002/02/16 13:25:56 squidadm Exp $ + * $Id: snmp_core.c,v 1.8.12.2.4.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -355,7 +355,7 @@ if ((port = Config.Port.snmp) > (u_short) 0) { enter_suid(); theInSnmpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.snmp_incoming, port, COMM_NONBLOCKING, @@ -369,7 +369,7 @@ if (Config.Addrs.snmp_outgoing.s_addr != no_addr.s_addr) { enter_suid(); theOutSnmpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Addrs.snmp_outgoing, port, COMM_NONBLOCKING, Index: squid/src/ssl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ssl.c,v retrieving revision 1.13 retrieving revision 1.13.14.1 diff -u -r1.13 -r1.13.14.1 --- squid/src/ssl.c 30 Oct 2001 13:32:08 -0000 1.13 +++ squid/src/ssl.c 17 Mar 2002 18:16:06 -0000 1.13.14.1 @@ -1,6 +1,6 @@ /* - * $Id: ssl.c,v 1.13 2001/10/30 13:32:08 squidadm Exp $ + * $Id: ssl.c,v 1.13.14.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -469,7 +469,7 @@ statCounter.server.other.requests++; /* Create socket. */ sock = comm_openex(SOCK_STREAM, - 0, + IPPROTO_TCP, getOutgoingAddr(request), 0, COMM_NONBLOCKING, Index: squid/src/wccp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/wccp.c,v retrieving revision 1.5 retrieving revision 1.5.64.1 diff -u -r1.5 -r1.5.64.1 --- squid/src/wccp.c 17 Feb 2001 20:56:23 -0000 1.5 +++ squid/src/wccp.c 17 Mar 2002 18:16:06 -0000 1.5.64.1 @@ -1,6 +1,6 @@ /* - * $Id: wccp.c,v 1.5 2001/02/17 20:56:23 hno Exp $ + * $Id: wccp.c,v 1.5.64.1 2002/03/17 18:16:06 serassio Exp $ * * DEBUG: section 80 WCCP Support * AUTHOR: Glenn Chisholm @@ -125,7 +125,7 @@ return; } theInWccpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Wccp.incoming, port, COMM_NONBLOCKING, @@ -141,7 +141,7 @@ (int) port, theInWccpConnection); if (Config.Wccp.outgoing.s_addr != no_addr.s_addr) { theOutWccpConnection = comm_open(SOCK_DGRAM, - 0, + IPPROTO_UDP, Config.Wccp.outgoing, port, COMM_NONBLOCKING,