ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: RE: [Ethereal-dev] Updates to COPS & SNMP dissectors

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date: Tue, 26 Aug 2003 09:55:14 +0300
Hi Guy!

KTi> -----Original Message-----
KTi> From: ext Guy Harris [mailto:guy@xxxxxxxxxxxx]
KTi> Sent: 26 August, 2003 02:52
KTi> To: Tiirikainen Kari (NET-OSS/Espoo)
KTi> Cc: ethereal-dev@xxxxxxxxxxxx
KTi> Subject: Re: [Ethereal-dev] Updates to COPS & SNMP dissectors
KTi> 
KTi> On Sunday, August 24, 2003, at 11:59 PM, 
KTi> kari.tiirikainen@xxxxxxxxx 
KTi> wrote:
KTi> 
KTi> > Hmm, the diffs I posted haven't been checked in yet.
KTi> > Any reason for that ?
KTi> 
KTi> I was waiting for some resolution on the "same object, two 
KTi> definitions" 
KTi> issue.

OK, thought so, just checking...

KTi> Does NET-SNMP fix that issue, so that you never have the 
KTi> same object defined twice in two MIBs?

I think it's not possible to assume that same object is not defined
by more than one MIB, that wouldn't be realistic. Even MIBs need
updates sometimes and it's not always possible to change the original
module.

What we need to do is to make Ethereal cope with such a case,
preferably in some predictable (and documented) way.

NET-SNMP FAQ gives pretty good hints related to this problem.
http://net-snmp.sourceforge.net/FAQ.html#How_do_I_replace_MIB_values_with_new_ones_

One solution would be instructing NET/UCD-SNMP to use the most recently
loaded MIB module to replace the previously loaded ones.

Within a program, the call:
	 /*  4.2.x  */
	 ds_set_boolean(DS_LIBRARY_ID, DS_LIB_MIB_REPLACE, 1 | 0);

  or, if using the 5.0.x series code:
	/*  5.0.x  */
	netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
			       NETSNMP_DS_LIB_MIB_REPLACE, 1 | 0);

will achieve this.

However, this doesn't guarantee that the that the resulting
MIB tree will be correct, it's up to the user to arrange the
MIBs so that the needed ones are the most recently loaded ones.

That can be done by exporting either MIBDIRS or MIBS.
My enhancements to packet-snmp.c code already check that if
MIBS is already set, it will not be reset to ALL.

It might be easier (for the Ethereal users) if we added
a preference to ethereal where the user lists the MIB
modules he wants to load and then we use that preference
to set value of MIBS. The list could default to the same as NET-SNMP 
(IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB:UCD-SNMP-MIB).

Since NET-SNMP parses this list in LIFO way, the most recent MIBS,
than will replace the older ones are defined first.

BR,
Kari