--------------------- PatchSet 3672 Date: 2002/02/16 18:20:30 Author: serassio Branch: nt-2_3 Tag: (none) Log: Backported SNMP patches from HEAD Members: auth_modules/LDAP/LDAP_auth.dsp:1.1.2.2->1.1.2.3 auth_modules/NCSA/NCSA_auth.dsp:1.1.2.2->1.1.2.3 auth_modules/NT/NT_auth.c:1.1.2.4->1.1.2.5 auth_modules/NT/NT_auth.dsp:1.1.2.2->1.1.2.3 contrib/chpasswd/chpasswd.dsp:1.1.2.4->1.1.2.5 contrib/htpasswd/htpasswd.dsp:1.1.2.4->1.1.2.5 doc/WIN32-ChangeLog.txt:1.1.2.7->1.1.2.8 include/snmp.h:1.1.1.1.44.1->1.1.1.1.44.2 include/snmp_compat.h:1.1.1.1.44.1->1.1.1.1.44.2(DEAD) include/snmp_impl.h:1.1.1.1.44.1->1.1.1.1.44.2 include/snmp_pdu.h:1.1.1.1.44.1->1.1.1.1.44.2 snmplib/coexistance.c:1.1.1.1->1.1.1.1.70.1 snmplib/snmp_api.c:1.1.1.1.70.1->1.1.1.1.70.2 snmplib/snmp_pdu.c:1.1.1.1->1.1.1.1.70.1 snmplib/snmp_vars.c:1.1.1.2->1.1.1.2.56.1 src/snmp_core.c:1.1.1.3.4.1.2.8->1.1.1.3.4.1.2.9 win/libsnmp/libsnmp.dsp:1.1.2.1->1.1.2.2 win/squidnt/squidnt.dsp:1.1.2.8->1.1.2.9 Index: squid/auth_modules/LDAP/LDAP_auth.dsp =================================================================== RCS file: /cvsroot/squid-sf//squid/auth_modules/LDAP/Attic/LDAP_auth.dsp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/auth_modules/LDAP/LDAP_auth.dsp 30 Jun 2001 18:49:42 -0000 1.1.2.2 +++ squid/auth_modules/LDAP/LDAP_auth.dsp 16 Feb 2002 18:20:30 -0000 1.1.2.3 @@ -53,7 +53,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib wldap32.lib /nologo /dll /machine:I386 +# ADD LINK32 wldap32.lib /nologo /dll /machine:I386 !ELSEIF "$(CFG)" == "LDAP_auth - Win32 Debug" @@ -79,7 +79,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib wldap32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 wldap32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept !ENDIF Index: squid/auth_modules/NCSA/NCSA_auth.dsp =================================================================== RCS file: /cvsroot/squid-sf//squid/auth_modules/NCSA/Attic/NCSA_auth.dsp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/auth_modules/NCSA/NCSA_auth.dsp 30 Jun 2001 18:49:42 -0000 1.1.2.2 +++ squid/auth_modules/NCSA/NCSA_auth.dsp 16 Feb 2002 18:20:31 -0000 1.1.2.3 @@ -53,7 +53,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib advapi32.lib /nologo /dll /machine:I386 +# ADD LINK32 /nologo /dll /machine:I386 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "NCSA_auth - Win32 Debug" @@ -80,7 +80,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib advapi32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Index: squid/auth_modules/NT/NT_auth.c =================================================================== RCS file: /cvsroot/squid-sf//squid/auth_modules/NT/Attic/NT_auth.c,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/auth_modules/NT/NT_auth.c 27 Jan 2002 19:44:54 -0000 1.1.2.4 +++ squid/auth_modules/NT/NT_auth.c 16 Feb 2002 18:20:31 -0000 1.1.2.5 @@ -149,7 +149,7 @@ GetModuleFileName(NULL, path, FILENAME_MAX); _splitpath(path,drive,dir,fname,ext); _makepath(target_file, drive, dir, "nt_auth","ini"); - if (GetPrivateProfileString("NT_auth", "SearchString", NTV_DEFAULT_DOMAIN, Default_NTDomain, sizeof(Default_NTDomain), target_file) == 0) + if (GetPrivateProfileString("NT_auth", "DefaultDomain", NTV_DEFAULT_DOMAIN, Default_NTDomain, sizeof(Default_NTDomain), target_file) == 0) return 1; return 0; Index: squid/auth_modules/NT/NT_auth.dsp =================================================================== RCS file: /cvsroot/squid-sf//squid/auth_modules/NT/Attic/NT_auth.dsp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/auth_modules/NT/NT_auth.dsp 30 Jun 2001 18:42:07 -0000 1.1.2.2 +++ squid/auth_modules/NT/NT_auth.dsp 16 Feb 2002 18:20:31 -0000 1.1.2.3 @@ -54,7 +54,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib advapi32.lib netapi32.lib /nologo /dll /machine:I386 +# ADD LINK32 netapi32.lib advapi32.lib /nologo /dll /machine:I386 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "NT_auth - Win32 Debug" @@ -82,7 +82,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib advapi32.lib netapi32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 netapi32.lib advapi32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # SUBTRACT LINK32 /profile /pdb:none !ENDIF Index: squid/contrib/chpasswd/chpasswd.dsp =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/chpasswd/Attic/chpasswd.dsp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/contrib/chpasswd/chpasswd.dsp 10 Sep 2001 20:25:55 -0000 1.1.2.4 +++ squid/contrib/chpasswd/chpasswd.dsp 16 Feb 2002 18:20:31 -0000 1.1.2.5 @@ -53,7 +53,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 /nologo /subsystem:console /machine:I386 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "chpasswd - Win32 Debug" @@ -80,7 +80,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF Index: squid/contrib/htpasswd/htpasswd.dsp =================================================================== RCS file: /cvsroot/squid-sf//squid/contrib/htpasswd/Attic/htpasswd.dsp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/contrib/htpasswd/htpasswd.dsp 10 Sep 2001 20:25:56 -0000 1.1.2.4 +++ squid/contrib/htpasswd/htpasswd.dsp 16 Feb 2002 18:20:31 -0000 1.1.2.5 @@ -50,7 +50,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "htpasswd - Win32 Debug" @@ -74,7 +74,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF Index: squid/doc/WIN32-ChangeLog.txt =================================================================== RCS file: /cvsroot/squid-sf//squid/doc/Attic/WIN32-ChangeLog.txt,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- squid/doc/WIN32-ChangeLog.txt 6 Jan 2002 18:14:22 -0000 1.1.2.7 +++ squid/doc/WIN32-ChangeLog.txt 16 Feb 2002 18:20:31 -0000 1.1.2.8 @@ -54,4 +54,16 @@ - Added print of Service command line on cache.log at startup - (Guido Serassio) - Multiple little bug fixes backported from Squid HEAD - (Guido Serassio) - Added configuration file to LDAP Authenticator - (Guido Serassio) +27 Jan 2002 - Added client.c to SquidNT MS VC++ project - (Guido Serassio) + - Start to use IPPROTO_TCP and IPPROTO_UDP macros - (Guido Serassio) + - Backported some minor bug fixes from HEAD - (Guido Serassio) +03 Feb 2002 - Moved back WIN32_getrusage to win32.c - (Guido Serassio) + - Backported SNMP patches from HEAD - (Guido Serassio) + - Added intermittent connections patch from O'Reilly Linux DevCenter at + http://linux.oreillynet.com/pub/a/linux/2001/08/02/offline_squid.html - (Guido Serassio) +16 Feb 2002 - Backported SNMP patches from HEAD - (Guido Serassio) + + + + Index: squid/include/snmp.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/snmp.h,v retrieving revision 1.1.1.1.44.1 retrieving revision 1.1.1.1.44.2 diff -u -r1.1.1.1.44.1 -r1.1.1.1.44.2 --- squid/include/snmp.h 6 Jan 2001 12:40:10 -0000 1.1.1.1.44.1 +++ squid/include/snmp.h 16 Feb 2002 18:20:32 -0000 1.1.1.1.44.2 @@ -27,7 +27,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. * - * $Id: snmp.h,v 1.1.1.1.44.1 2001/01/06 12:40:10 hno Exp $ + * $Id: snmp.h,v 1.1.1.1.44.2 2002/02/16 18:20:32 serassio Exp $ * **********************************************************************/ @@ -69,7 +69,6 @@ #endif #include "snmp-internal.h" #include "parse.h" -#include "snmp_compat.h" #include "snmp_debug.h" #endif /* _SNMP_H_ */ --- squid/include/snmp_compat.h Wed Feb 14 00:57:17 2007 +++ /dev/null Wed Feb 14 00:55:47 2007 @@ -1,50 +0,0 @@ -/* -*- c++ -*- */ -#ifndef _SNMP_COMPAT_H_ -#define _SNMP_COMPAT_H_ - -/*************************************************************************** - * - * Copyright 1997 by Carnegie Mellon University - * - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of CMU not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - * Author: Ryan Troll - * - * $Id: snmp_compat.h,v 1.1.1.1.44.1 2001/01/06 12:40:10 hno Exp $ - * - ***************************************************************************/ - -/* SMI Types */ -#ifndef INTEGER -#define INTEGER ASN_INTEGER -#define STRING ASN_OCTET_STR -#define OBJID ASN_OBJECT_ID -#define NULLOBJ ASN_NULL -#endif -/* PDU Types */ - -#define GET_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) -#define GETNEXT_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) -#define GET_RSP_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) -#define SET_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3) -#define TRP_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4) /*Obsolete */ - -#define INFORM_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6) - -#endif /* _SNMP_COMPAT_H_ */ Index: squid/include/snmp_impl.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/snmp_impl.h,v retrieving revision 1.1.1.1.44.1 retrieving revision 1.1.1.1.44.2 diff -u -r1.1.1.1.44.1 -r1.1.1.1.44.2 --- squid/include/snmp_impl.h 6 Jan 2001 12:40:10 -0000 1.1.1.1.44.1 +++ squid/include/snmp_impl.h 16 Feb 2002 18:20:32 -0000 1.1.1.1.44.2 @@ -1,5 +1,5 @@ /* - * $Id: snmp_impl.h,v 1.1.1.1.44.1 2001/01/06 12:40:10 hno Exp $ + * $Id: snmp_impl.h,v 1.1.1.1.44.2 2002/02/16 18:20:32 serassio Exp $ */ #ifndef _SNMP_IMPL_H_ @@ -78,13 +78,6 @@ #define RWRITE 0xAABA /* add write access for community private */ #define NOACCESS 0x0000 /* no access for anybody */ -#ifndef INTEGER -#define INTEGER ASN_INTEGER -#define STRING ASN_OCTET_STR -#define OBJID ASN_OBJECT_ID -#define NULLOBJ ASN_NULL -#endif - struct trapVar { oid *varName; int varNameLen; Index: squid/include/snmp_pdu.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/snmp_pdu.h,v retrieving revision 1.1.1.1.44.1 retrieving revision 1.1.1.1.44.2 diff -u -r1.1.1.1.44.1 -r1.1.1.1.44.2 --- squid/include/snmp_pdu.h 6 Jan 2001 12:40:10 -0000 1.1.1.1.44.1 +++ squid/include/snmp_pdu.h 16 Feb 2002 18:20:32 -0000 1.1.1.1.44.2 @@ -27,7 +27,7 @@ * * Author: Ryan Troll * - * $Id: snmp_pdu.h,v 1.1.1.1.44.1 2001/01/06 12:40:10 hno Exp $ + * $Id: snmp_pdu.h,v 1.1.1.1.44.2 2002/02/16 18:20:32 serassio Exp $ * **********************************************************************/ @@ -70,7 +70,6 @@ u_char *snmp_pdu_encode(u_char *, int *, struct snmp_pdu *); u_char *snmp_pdu_decode(u_char *, int *, struct snmp_pdu *); - char *snmp_pdu_type(struct snmp_pdu *); /* Add a NULL Variable to a PDU */ void snmp_add_null_var(struct snmp_pdu *, oid *, int); @@ -88,12 +87,16 @@ #define SNMP_PDU_GET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) #define SNMP_PDU_GETNEXT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) #define SNMP_PDU_RESPONSE (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) +#ifdef UNUSED_CODE #define SNMP_PDU_SET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3) #define TRP_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4) /*Obsolete */ +#endif #define SNMP_PDU_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5) +#ifdef UNUSED_CODE #define SNMP_PDU_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6) #define SNMP_PDU_V2TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7) #define SNMP_PDU_REPORT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8) +#endif #define MAX_BINDINGS 2147483647 /* PDU Defaults */ #define SNMP_DEFAULT_ERRSTAT -1 #define SNMP_DEFAULT_ERRINDEX -1 @@ -105,6 +108,7 @@ * * * * Trap Types */ +#if UNUSED_CODE #define SNMP_TRAP_COLDSTART (0x0) #define SNMP_TRAP_WARMSTART (0x1) #define SNMP_TRAP_LINKDOWN (0x2) @@ -112,4 +116,5 @@ #define SNMP_TRAP_AUTHENTICATIONFAILURE (0x4) #define SNMP_TRAP_EGPNEIGHBORLOSS (0x5) #define SNMP_TRAP_ENTERPRISESPECIFIC (0x6) +#endif #endif /* _SNMP_PDU_H_ */ Index: squid/snmplib/coexistance.c =================================================================== RCS file: /cvsroot/squid-sf//squid/snmplib/coexistance.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.70.1 diff -u -r1.1.1.1 -r1.1.1.1.70.1 --- squid/snmplib/coexistance.c 26 Jan 2000 03:21:47 -0000 1.1.1.1 +++ squid/snmplib/coexistance.c 16 Feb 2002 18:20:32 -0000 1.1.1.1.70.1 @@ -109,7 +109,9 @@ case SNMP_PDU_GET: case SNMP_PDU_GETNEXT: +#ifdef SNMP_PDU_SET case SNMP_PDU_SET: +#endif return (1); break; Index: squid/snmplib/snmp_api.c =================================================================== RCS file: /cvsroot/squid-sf//squid/snmplib/snmp_api.c,v retrieving revision 1.1.1.1.70.1 retrieving revision 1.1.1.1.70.2 diff -u -r1.1.1.1.70.1 -r1.1.1.1.70.2 --- squid/snmplib/snmp_api.c 3 Feb 2002 15:18:35 -0000 1.1.1.1.70.1 +++ squid/snmplib/snmp_api.c 16 Feb 2002 18:20:32 -0000 1.1.1.1.70.2 @@ -145,6 +145,8 @@ if (bufp == NULL) return (NULL); - strcpy((char *) bufp, (char *) Community); + strncpy((char *) bufp, (char *) Community, CommunityLen); + bufp[CommunityLen] = '\0'; + return (bufp); } Index: squid/snmplib/snmp_pdu.c =================================================================== RCS file: /cvsroot/squid-sf//squid/snmplib/snmp_pdu.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.70.1 diff -u -r1.1.1.1 -r1.1.1.1.70.1 --- squid/snmplib/snmp_pdu.c 26 Jan 2000 03:21:47 -0000 1.1.1.1 +++ squid/snmplib/snmp_pdu.c 16 Feb 2002 18:20:32 -0000 1.1.1.1.70.1 @@ -359,7 +359,7 @@ switch (PDU->command) { /**********************************************************************/ - +#ifdef TRP_REQ_MSG case TRP_REQ_MSG: /* SNMPv1 Trap */ @@ -401,6 +401,7 @@ if (bufp == NULL) return (NULL); break; +#endif /**********************************************************************/ @@ -487,9 +488,11 @@ { /* pdu */ u_char *bufp; u_char PDUType; - int four; u_char ASNType; +#ifdef UNUSED_CODE + int four; oid objid[MAX_NAME_LEN]; +#endif bufp = asn_parse_header(Packet, Length, &PDUType); if (bufp == NULL) @@ -502,6 +505,7 @@ PDU->command = PDUType; switch (PDUType) { +#ifdef TRP_REQ_MSG case TRP_REQ_MSG: /* SNMPv1 Trap Message */ @@ -553,6 +557,7 @@ if (bufp == NULL) ASN_PARSE_ERROR(NULL); break; +#endif /**********************************************************************/ @@ -580,8 +585,8 @@ &PDU->max_repetitions, sizeof(PDU->max_repetitions)); if (bufp == NULL) ASN_PARSE_ERROR(NULL); - break; + /**********************************************************************/ default: @@ -627,45 +632,6 @@ return (bufp); } - -char * -snmp_pdu_type(struct snmp_pdu *PDU) -{ - switch (PDU->command) { - case SNMP_PDU_GET: - return ("GET"); - break; - case SNMP_PDU_GETNEXT: - return ("GETNEXT"); - break; - case SNMP_PDU_RESPONSE: - return ("RESPONSE"); - break; - case SNMP_PDU_SET: - return ("SET"); - break; - case SNMP_PDU_GETBULK: - return ("GETBULK"); - break; - case SNMP_PDU_INFORM: - return ("INFORM"); - break; - case SNMP_PDU_V2TRAP: - return ("V2TRAP"); - break; - case SNMP_PDU_REPORT: - return ("REPORT"); - break; - - case TRP_REQ_MSG: - return ("V1TRAP"); - break; - default: - return ("Unknown"); - break; - } -} - /* * Add a null variable with the requested name to the end of the list of * variables for this pdu. Index: squid/snmplib/snmp_vars.c =================================================================== RCS file: /cvsroot/squid-sf//squid/snmplib/snmp_vars.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.2.56.1 diff -u -r1.1.1.2 -r1.1.1.2.56.1 --- squid/snmplib/snmp_vars.c 26 Jan 2000 03:25:01 -0000 1.1.1.2 +++ squid/snmplib/snmp_vars.c 16 Feb 2002 18:20:32 -0000 1.1.1.2.56.1 @@ -99,8 +99,6 @@ /* #define DEBUG_VARS_DECODE 1 */ /* #define DEBUG_VARS_ENCODE 1 */ -#define ASN_PARSE_ERROR(x) { return(x); } - /* Create a new variable_list structure representing oid Name of length Len. * * Returns NULL upon error. @@ -230,12 +228,12 @@ void snmp_var_free(struct variable_list *Ptr) { - if (Ptr->name && Ptr->name_length > 0) + if (Ptr->name) xfree((char *) Ptr->name); - if (Ptr->val.string && Ptr->val_len > 0) + if (Ptr->val.string) xfree((char *) Ptr->val.string); - else if (Ptr->val.integer && Ptr->val_len > 0) + else if (Ptr->val.integer) xfree((char *) Ptr->val.integer); xfree(Ptr); @@ -376,7 +374,7 @@ struct variable_list ** VarP, int Version) { - struct variable_list *Var, **VarLastP; + struct variable_list *Var=NULL, **VarLastP; u_char *bufp, *tmp; u_char VarBindType; u_char *DataPtr; @@ -394,16 +392,21 @@ /* Now parse the variables */ bufp = asn_parse_header(Buffer, &AllVarLen, &VarBindType); if (bufp == NULL) - ASN_PARSE_ERROR(NULL); + return(NULL); if (VarBindType != (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR)) { snmp_set_api_error(SNMPERR_PDU_PARSE); - ASN_PARSE_ERROR(NULL); + return(NULL); } #ifdef DEBUG_VARS_DECODE printf("VARS: All Variable length %d\n", AllVarLen); #endif +#if defined PARSE_ERROR +#undef PARSE_ERROR +#endif +#define PARSE_ERROR { snmp_var_free(Var); return(NULL); } + /* We know how long the variable list is. Parse it. */ while ((int) AllVarLen > 0) { @@ -416,7 +419,7 @@ ThisVarLen = AllVarLen; tmp = asn_parse_header(bufp, &ThisVarLen, &VarBindType); if (tmp == NULL) - ASN_PARSE_ERROR(NULL); + PARSE_ERROR; /* Now that we know the length , figure out how it relates to * the entire variable list @@ -427,7 +430,7 @@ /* Is it valid? */ if (VarBindType != (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR)) { snmp_set_api_error(SNMPERR_PDU_PARSE); - ASN_PARSE_ERROR(NULL); + PARSE_ERROR; } #ifdef DEBUG_VARS_DECODE printf("VARS: Header type 0x%x (%d bytes left)\n", VarBindType, ThisVarLen); @@ -437,13 +440,13 @@ bufp = asn_parse_objid(bufp, &ThisVarLen, &VarBindType, Var->name, &(Var->name_length)); if (bufp == NULL) - ASN_PARSE_ERROR(NULL); + PARSE_ERROR; if (VarBindType != (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID)) { snmp_set_api_error(SNMPERR_PDU_PARSE); - ASN_PARSE_ERROR(NULL); + PARSE_ERROR; } #ifdef DEBUG_VARS_DECODE printf("VARS: Decoded OBJID (%d bytes). (%d bytes left)\n", @@ -457,7 +460,7 @@ /* find out type of object */ bufp = asn_parse_header(bufp, &ThisVarLen, &(Var->type)); if (bufp == NULL) - ASN_PARSE_ERROR(NULL); + PARSE_ERROR; ThisVarLen = DataLen; #ifdef DEBUG_VARS_DECODE @@ -472,7 +475,7 @@ Var->val.integer = (int *) xmalloc(sizeof(int)); if (Var->val.integer == NULL) { snmp_set_api_error(SNMPERR_OS_ERR); - return (NULL); + PARSE_ERROR; } Var->val_len = sizeof(int); bufp = asn_parse_int(DataPtr, &ThisVarLen, @@ -491,7 +494,7 @@ Var->val.integer = (int *) xmalloc(sizeof(u_int)); if (Var->val.integer == NULL) { snmp_set_api_error(SNMPERR_OS_ERR); - return (NULL); + PARSE_ERROR; } Var->val_len = sizeof(u_int); bufp = asn_parse_unsigned_int(DataPtr, &ThisVarLen, @@ -510,7 +513,7 @@ Var->val.string = (u_char *) xmalloc((unsigned) Var->val_len); if (Var->val.string == NULL) { snmp_set_api_error(SNMPERR_OS_ERR); - return (NULL); + PARSE_ERROR; } bufp = asn_parse_string(DataPtr, &ThisVarLen, &Var->type, Var->val.string, @@ -529,7 +532,7 @@ Var->val.objid = (oid *) xmalloc((unsigned) Var->val_len); if (Var->val.integer == NULL) { snmp_set_api_error(SNMPERR_OS_ERR); - return (NULL); + PARSE_ERROR; } /* Only copy if we successfully decoded something */ if (bufp) { @@ -550,18 +553,16 @@ case SMI_COUNTER64: snmplib_debug(2, "Unable to parse type SMI_COUNTER64!\n"); snmp_set_api_error(SNMPERR_UNSUPPORTED_TYPE); - return (NULL); - break; + PARSE_ERROR; default: snmplib_debug(2, "bad type returned (%x)\n", Var->type); snmp_set_api_error(SNMPERR_PDU_PARSE); - return (NULL); - break; + PARSE_ERROR; } /* End of var type switch */ if (bufp == NULL) - return (NULL); + PARSE_ERROR; #ifdef DEBUG_VARS_DECODE printf("VARS: Adding to list.\n"); @@ -570,6 +571,7 @@ *VarLastP = Var; VarLastP = &(Var->next_variable); } +#undef PARSE_ERROR return (bufp); } Index: squid/src/snmp_core.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/snmp_core.c,v retrieving revision 1.1.1.3.4.1.2.8 retrieving revision 1.1.1.3.4.1.2.9 diff -u -r1.1.1.3.4.1.2.8 -r1.1.1.3.4.1.2.9 --- squid/src/snmp_core.c 3 Feb 2002 15:15:35 -0000 1.1.1.3.4.1.2.8 +++ squid/src/snmp_core.c 16 Feb 2002 18:20:32 -0000 1.1.1.3.4.1.2.9 @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.c,v 1.1.1.3.4.1.2.8 2002/02/03 15:15:35 serassio Exp $ + * $Id: snmp_core.c,v 1.1.1.3.4.1.2.9 2002/02/16 18:20:32 serassio Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -474,6 +474,7 @@ snmp_rq->outbuf = xmalloc(snmp_rq->outlen = SNMP_REQUEST_SIZE); xmemcpy(&snmp_rq->from, &from, sizeof(struct sockaddr_in)); snmpDecodePacket(snmp_rq); + xfree(snmp_rq->outbuf); xfree(snmp_rq); } else { debug(49, 1) ("snmpHandleUdp: FD %d recvfrom: %s\n", sock, xstrerror()); @@ -515,6 +516,8 @@ inet_ntoa(rq->from.sin_addr)); snmp_free_pdu(PDU); } + if (Community) + xfree(Community); } /* @@ -537,15 +540,12 @@ ret = snmp_build(&Session, RespPDU, rq->outbuf, &rq->outlen); sendto(rq->sock, rq->outbuf, rq->outlen, 0, (struct sockaddr *) &rq->from, sizeof(rq->from)); snmp_free_pdu(RespPDU); - xfree(rq->outbuf); } } /* * Decide how to respond to the request, construct a response and * return the response to the requester. - * - * If configured forward any reponses which are not for this agent. */ static struct snmp_pdu * snmpAgentResponse(struct snmp_pdu *PDU) Index: squid/win/libsnmp/libsnmp.dsp =================================================================== RCS file: /cvsroot/squid-sf//squid/win/libsnmp/Attic/libsnmp.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/win/libsnmp/libsnmp.dsp 15 Jul 2001 08:49:38 -0000 1.1.2.1 +++ squid/win/libsnmp/libsnmp.dsp 16 Feb 2002 18:20:32 -0000 1.1.2.2 @@ -131,6 +131,70 @@ # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE="..\..\include\snmp-internal.h" +# End Source File +# Begin Source File + +SOURCE="..\..\include\snmp-mib.h" +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_api.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_api_error.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_api_util.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_client.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_coexist.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_debug.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_error.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_impl.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_msg.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_pdu.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_session.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_util.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\snmp_vars.h +# End Source File # End Group # End Target # End Project Index: squid/win/squidnt/squidnt.dsp =================================================================== RCS file: /cvsroot/squid-sf//squid/win/squidnt/Attic/squidnt.dsp,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -r1.1.2.8 -r1.1.2.9 --- squid/win/squidnt/squidnt.dsp 3 Feb 2002 15:28:51 -0000 1.1.2.8 +++ squid/win/squidnt/squidnt.dsp 16 Feb 2002 18:20:32 -0000 1.1.2.9 @@ -51,7 +51,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib ws2_32.lib advapi32.lib psapi.lib /nologo /subsystem:console /machine:I386 /out:"Release/squid.exe" +# ADD LINK32 ws2_32.lib advapi32.lib psapi.lib Iphlpapi.lib /nologo /subsystem:console /machine:I386 /out:"Release/squid.exe" # SUBTRACT LINK32 /profile # Begin Special Build Tool SOURCE="$(InputPath)" @@ -82,7 +82,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winwrap.lib kernel32.lib ws2_32.lib advapi32.lib psapi.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/squid.exe" /pdbtype:sept +# ADD LINK32 winwrap.lib kernel32.lib ws2_32.lib advapi32.lib psapi.lib Iphlpapi.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/squid.exe" /pdbtype:sept # SUBTRACT LINK32 /profile # Begin Special Build Tool SOURCE="$(InputPath)"