]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Continuing SNMP debugging.
authorwessels <>
Fri, 21 Nov 1997 12:55:51 +0000 (12:55 +0000)
committerwessels <>
Fri, 21 Nov 1997 12:55:51 +0000 (12:55 +0000)
    - snmpHandleUdp needed to set 'outlen' before calling
      snmp_agent_parse()!

include/snmp_impl.h
snmplib/Makefile.in
snmplib/asn1.c
src/main.cc
src/protos.h

index 22205dbc0a0bdd4a99a3a2650937d47d10ac66ad..abab343e7598bcecbcaa738b7068c888a07ba615 100644 (file)
@@ -98,7 +98,7 @@ SOFTWARE.
 #define UINTEGER    (ASN_APPLICATION | 7)
 #define DEBUG
 #ifdef DEBUG
-#define ERROR(string)  fprintf(stderr,"%s(%d): %s\n",__FILE__, __LINE__, string);
+#define ERROR(string)  fprintf(stderr,"%s(%d): ERROR %s\n",__FILE__, __LINE__, string);
 #else
 #define ERROR(string)
 #endif
index 4c51492548eb9fa8c215202467eee0f8d2fb38a1..3cabbd8cc7c7227e80ce845aa09e86f19a68df0c 100644 (file)
@@ -20,7 +20,7 @@ OBJS= snmp_client.o snmp.o snmp_auth.o asn1.o mib.o parse.o snmp_api.o \
        md5.o usec.o snmpdump.o
 
 CC= @CC@
-FLAGS= 
+FLAGS=  -g
 DEFS= -DBSD4_3 -DSQUID_SNMP=1
 INCLUDE= -I../include -I./../include -I../src -I./../src
 MIBDEFS= -DMIBFILEPATH=\"$(prefix)/lib\"
index cb520f104f0bb57f70f948e33f66c7441cd1d9ac..7e370227005fdff9f6834b6fb6e1a0cdeabfaa8a 100644 (file)
@@ -48,6 +48,8 @@ SOFTWARE.
 
 #include "asn1.h"
 
+#include <assert.h>
+
 #ifndef NULL
 #define NULL   0
 #endif
@@ -464,6 +466,7 @@ asn_build_sequence(data, datalength, type, length)
      u_char type;              /* IN - ASN type of object */
      int length;               /* IN - length of object */
 {
+       assert (*datalength >= 0);
     *datalength -= 4;
     if (*datalength < 0) {
        *datalength += 4;       /* fix up before punting */
index d7ffd815a29e7b295366b7b4eb44fd54c04f6942..40456711696ec991d1f7323a7745215f268c081e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.194 1997/11/21 01:59:16 wessels Exp $
+ * $Id: main.cc,v 1.195 1997/11/21 05:55:53 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -130,10 +130,6 @@ static void mainParseOptions(int, char **);
 static void sendSignal(void);
 static void serverConnectionsOpen(void);
 static void watch_child(char **);
-#ifdef SQUID_SNMP
-extern void init_snmp();
-extern void initSquidSnmp();
-#endif
 static void
 usage(void)
 {
@@ -404,7 +400,7 @@ serverConnectionsOpen(void)
        }
     }
 #ifdef SQUID_SNMP
-    initSquidSnmp();
+    snmpConnectionOpen();
 #endif
 
     clientdbInit();
@@ -570,9 +566,8 @@ mainInitialize(void)
        statAvgInit();
     }
     configured_once = 1;
-
 #ifdef SQUID_SNMP
-    init_snmp();
+    snmpInit();
 #endif
 }
 
index 3ee2d679c7595f56175bd00de2585ce4ee4fb0ba..60188cf5e3d422f4a42f5c6036f994f1bb9ee0f3 100644 (file)
@@ -239,8 +239,9 @@ extern PF icpHandleUdp;
 extern PF httpAccept;
 extern DEFER httpAcceptDefer;
 #ifdef SQUID_SNMP
-/*extern PF snmpHandleUdp; */
-/*extern void initSquidSnmp(); */
+extern PF snmpHandleUdp;
+extern void snmpInit(void);
+extern void snmpConnectionOpen(void);
 #endif /* SQUID_SNMP */
 
 extern void icpSendERROR(int fd,