>>>>> On Tue, 22 Oct 2002 17:06:44 -0700, Guy Harris <gharris@xxxxxxxxx> said:
Guy> Is the intent that HAVE_UCD_SNMP *not* be defined if you have Net-SNMP?
Yes.
Guy> If so, there are some pieces of code that currently interpret
Guy> HAVE_UCD_SNMP as meaning "we have an SNMP library", e.g.:
Guy> asn1.h - defines "subid_t" as a "gulong" if HAVE_UCD_SNMP is
Guy> defined and as a "guint" otherwise; does Net-SNMP define an OID
Guy> as a sequence of "unsigned long"s or as a sequence of "unsigned
Guy> int"s?
Guy> tethereal.c, gtk/main.c, gtk2/main.c - uses HAVE_UCD_SNMP to
Guy> determine whether it was linked with UCD SNMP or not.
Ah. I see the problem. I missed those files. I would do something
like the patch below.
Guy> Also, when I tried building on Windows with the Net-SNMP library
Guy> Gilbert made, I got errors compiling "packet-snmp.c" if I didn't
Guy> define HAVE_NET_SNMP in "config.h.win32" (which gets copied to
Guy> "config.h" in Windows Visual C++ builds) due to
Guy> NETSNMP_DS_LIBRARY_ID and the like not being defined.
You would need to define HAVE_NET_SNMP in the config.h for win32 if
you have it. I don't do windows :-/
Guy> If I *did* define HAVE_NET_SNMP (instead of HAVE_UCD_SNMP), I got
Guy> the following errors when compiling "packet-snmp.c":
Guy> C:\Program Files\net-snmp\include\net-snmp/library/system.h(52) : error C2371: 'DIR' : redefinition; different basic types
Guy> C:\Program Files\gtk-win32\src\glib\gwin32.h(89) : see declaration of 'DIR'
Guy> C:\Program Files\net-snmp\include\net-snmp/library/system.h(55) : error C2371: 'g_win32_readdir' : redefinition; different basic types
Guy> C:\Program Files\gtk-win32\src\glib\gwin32.h(95) : see declaration of 'g_win32_readdir'
Guy> How do I get net-snmp *not* to define DIR and g_win32_readdir, or
Guy> to define them in ways that don't collide with GLib?
Well, the only thing is that the net-snmp-includes.h file actually
includes a whole ton of stuff (including some system headers). You
really don't need it all, since you're not using much of the library.
I'll get you a fix tomorrow. Bed time.
--
Wes Hardaker
Network Associates Laboratories
Index: acconfig.h
===================================================================
RCS file: /cvsroot/ethereal/acconfig.h,v
retrieving revision 1.25
diff -u -r1.25 acconfig.h
--- acconfig.h 2002/08/28 21:00:05 1.25
+++ acconfig.h 2002/10/23 03:45:59
@@ -44,6 +44,12 @@
#undef HAVE_LIBZ
+#undef HAVE_NET_SNMP
+
#undef HAVE_UCD_SNMP
+
+#if defined(HAVE_NET_SNMP) || defined(HAVE_UCD_SNMP)
+#define HAVE_SOME_SNMP
+#endif
#undef PLUGIN_DIR