--------------------- PatchSet 8478 Date: 2006/08/12 19:24:36 Author: serassio Branch: nt Tag: (none) Log: Added own inet_aton() Members: include/util.h:1.13.6.1->1.13.6.2 lib/win32lib.c:1.1.64.4->1.1.64.5 Index: squid/include/util.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/util.h,v retrieving revision 1.13.6.1 retrieving revision 1.13.6.2 diff -u -r1.13.6.1 -r1.13.6.2 --- squid/include/util.h 16 May 2006 21:05:58 -0000 1.13.6.1 +++ squid/include/util.h 12 Aug 2006 19:24:36 -0000 1.13.6.2 @@ -1,5 +1,5 @@ /* - * $Id: util.h,v 1.13.6.1 2006/05/16 21:05:58 serassio Exp $ + * $Id: util.h,v 1.13.6.2 2006/08/12 19:24:36 serassio Exp $ * * AUTHOR: Harvest Derived * @@ -130,7 +130,8 @@ #endif extern int chroot (const char *); extern int ftruncate(int, off_t); -extern int gettimeofday(struct timeval * ,struct timezone *); +extern int gettimeofday(struct timeval *, struct timezone *); +extern int inet_aton(const char *, struct in_addr *); extern int kill(pid_t, int); extern int statfs(const char *, struct statfs *); extern int truncate(const char *, off_t); Index: squid/lib/win32lib.c =================================================================== RCS file: /cvsroot/squid-sf//squid/lib/win32lib.c,v retrieving revision 1.1.64.4 retrieving revision 1.1.64.5 diff -u -r1.1.64.4 -r1.1.64.5 --- squid/lib/win32lib.c 24 May 2006 20:28:56 -0000 1.1.64.4 +++ squid/lib/win32lib.c 12 Aug 2006 19:24:36 -0000 1.1.64.5 @@ -1,5 +1,5 @@ /* - * $Id: win32lib.c,v 1.1.64.4 2006/05/24 20:28:56 serassio Exp $ + * $Id: win32lib.c,v 1.1.64.5 2006/08/12 19:24:36 serassio Exp $ * * * * * * * * * Legal stuff * * * * * * * * @@ -243,6 +243,21 @@ return GetLastError(); } +/* Convert from "a.b.c.d" IP address string into + * an in_addr structure. Returns 0 on failure, + * and 1 on success. + */ +int inet_aton(const char *cp, struct in_addr *addr) +{ + if( cp==NULL || addr==NULL ) + { + return(0); + } + + addr->s_addr = inet_addr(cp); + return (addr->s_addr == INADDR_NONE) ? 0 : 1; +} + void GetProcessName(pid_t pid, char *ProcessName) {