aboutsummaryrefslogtreecommitdiffstats
path: root/packet-snmp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-03-26 06:35:03 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-03-26 06:35:03 +0000
commita0fe4151fd06a4a15f61413fa6f6ccd779a56e00 (patch)
treedd481cd79b821a79fae0851c0ac0f613990ab9f4 /packet-snmp.c
parentb10fe140403880ddf547d49e0b683723127ad912 (diff)
Make the UCD SNMP library read its configuration files, so that, for
example, you can configure it to read in MIB files other than the default ones. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5022 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-snmp.c')
-rw-r--r--packet-snmp.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/packet-snmp.c b/packet-snmp.c
index da4ed6d600..d4f7e4ba76 100644
--- a/packet-snmp.c
+++ b/packet-snmp.c
@@ -8,7 +8,7 @@
*
* See RFCs 1905, 1906, 1909, and 1910 for SNMPv2u.
*
- * $Id: packet-snmp.c,v 1.88 2002/03/12 10:37:01 guy Exp $
+ * $Id: packet-snmp.c,v 1.89 2002/03/26 06:35:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -65,6 +65,7 @@
# include <ucd-snmp/snmp_impl.h>
# include <ucd-snmp/mib.h>
# include <ucd-snmp/default_store.h>
+# include <ucd-snmp/read_config.h>
# include <ucd-snmp/tools.h>
/*
@@ -2013,8 +2014,20 @@ proto_register_snmp(void)
};
#ifdef HAVE_UCD_SNMP
- init_mib();
+ /*
+ * Suppress warnings about unknown tokens - we aren't initializing
+ * UCD SNMP in its entirety, we're just initializing the
+ * MIB-handling part because that's all we're using, which
+ * means that entries in the configuration file for other
+ * pars of the library will not be handled, and we don't want
+ * the config file reading code to whine about that.
+ */
+ ds_set_boolean(DS_LIBRARY_ID, DS_LIB_NO_TOKEN_WARNINGS, TRUE);
ds_set_int(DS_LIBRARY_ID, DS_LIB_PRINT_SUFFIX_ONLY, 2);
+ register_mib_handlers();
+ read_premib_configs();
+ init_mib();
+ read_configs();
#endif /* HAVE_UCD_SNMP */
proto_snmp = proto_register_protocol("Simple Network Management Protocol",
"SNMP", "snmp");