aboutsummaryrefslogtreecommitdiffstats
path: root/gtk2
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-10-23 18:24:09 +0000
committerGuy Harris <guy@alum.mit.edu>2002-10-23 18:24:09 +0000
commitcc8a765d8e36370a0ea48c683dcdbf3f862d513e (patch)
treeaa6a14e465bfd44622f7a332997d0dcb77cdc093 /gtk2
parent3369c4f7c7f73d9e7bf4fe352fc35b4c661fa5e1 (diff)
downloadwireshark-cc8a765d8e36370a0ea48c683dcdbf3f862d513e.tar.gz
wireshark-cc8a765d8e36370a0ea48c683dcdbf3f862d513e.tar.bz2
wireshark-cc8a765d8e36370a0ea48c683dcdbf3f862d513e.zip
From Wes Hardaker:
Define HAVE_SOME_SNMP if either HAVE_UCD_SNMP or HAVE_NET_SNMP is defined, and use HAVE_SOME_SNMP, rather than HAVE_UCD_SNMP, in most places when testing whether we have an SNMP library or not. Be more selective when including Net-SNMP header files. Fix up {gtk,gtk2}/main.c to do the same SNMP stuff that tethereal.c does - including the MIB stuff that gtk/main.c was doing but gtk2/main.c wasn't doing. Fix the copyright date in gtk/main.c. svn path=/trunk/; revision=6483
Diffstat (limited to 'gtk2')
-rw-r--r--gtk2/main.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/gtk2/main.c b/gtk2/main.c
index e085efecdb..6c9a2095ac 100644
--- a/gtk2/main.c
+++ b/gtk2/main.c
@@ -1,6 +1,6 @@
/* main.c
*
- * $Id: main.c,v 1.14 2002/09/28 09:29:49 oabad Exp $
+ * $Id: main.c,v 1.15 2002/10/23 18:24:09 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1274,7 +1274,12 @@ main(int argc, char *argv[])
#ifdef WIN32
WSADATA wsaData;
-#endif
+
+# ifdef HAVE_SOME_SNMP
+ char *mib_path;
+# define MIB_PATH_APPEND "\\snmp\\mibs"
+# endif /* HAVE_SOME_SNMP */
+#endif /* WIN32 */
char *gpf_path, *cf_path, *df_path;
char *pf_path;
@@ -1513,17 +1518,27 @@ main(int argc, char *argv[])
g_string_append(comp_info_str, ", without libz");
#endif /* HAVE_LIBZ */
- /* Oh, this is pretty */
+/* Oh, this is pretty. */
+/* Oh, ha. you think that was pretty. Try this:! --Wes */
+#ifdef HAVE_SOME_SNMP
+
#ifdef HAVE_UCD_SNMP
- g_string_append(comp_info_str, ", with UCD SNMP ");
+ g_string_append(comp_info_str, ", with UCD-SNMP ");
#ifdef HAVE_UCD_SNMP_VERSION_H
g_string_append(comp_info_str, VersionInfo);
#else /* HAVE_UCD_SNMP_VERSION_H */
g_string_append(comp_info_str, "(version unknown)");
#endif /* HAVE_UCD_SNMP_VERSION_H */
+#endif /* HAVE_UCD_SNMP */
+
+#ifdef HAVE_NET_SNMP
+ g_string_append(comp_info_str, ", with Net-SNMP ");
+ g_string_append(comp_info_str, netsnmp_get_version());
+#endif /* HAVE_NET_SNMP */
+
#else /* no SNMP library */
- g_string_append(comp_info_str, ", without UCD SNMP");
-#endif
+ g_string_append(comp_info_str, ", without UCD-SNMP or Net-SNMP");
+#endif /* HAVE_SOME_SNMP */
/* Now get our args */
while ((opt = getopt(argc, argv, optstring)) != -1) {
@@ -1840,7 +1855,20 @@ main(int argc, char *argv[])
/* Start windows sockets */
WSAStartup( MAKEWORD( 1, 1 ), &wsaData );
-#endif
+
+# ifdef HAVE_SOME_SNMP
+ /* Set MIBDIRS so that the SNMP library can find its mibs. */
+ /* XXX - Should we set MIBS or MIBFILES as well? */
+
+ mib_path = g_malloc (strlen(get_datafile_dir()) + strlen(MIB_PATH_APPEND) + 20);
+ sprintf (mib_path, "MIBDIRS=%s\\%s", get_datafile_dir(), MIB_PATH_APPEND);
+ /* Amazingly enough, Windows does not provide setenv(). */
+ if (getenv("MIBDIRS") == NULL)
+ _putenv(mib_path);
+ g_free(mib_path);
+
+# endif /* HAVE_UCD_SNMP */
+#endif /* WIN32 */
/* Notify all registered modules that have had any of their preferences
changed either from one of the preferences file or from the command