This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Bug in snmp2c in current build tree
- To: "eCos Mailing List (E-mail)" <ecos-discuss at sources dot redhat dot com>
- Subject: [ECOS] Bug in snmp2c in current build tree
- From: Ron Kundla <rkundla at nband dot com>
- Date: Mon, 30 Jul 2001 17:21:44 -0700
I am not sure how many people have been messing with the MIB compiler
included in the latest build tree but I have been having some problems using
mib2c to compile the RFC-3083 (DOCSIS Baseline Privacy MIB).
My system setup is the same as described in the eCos SNMP documentation,
using Perl 5.005_03 and the SNMP-3.1.0 Perl package. I am running on a
Windows 2000 box using Cygwin 1.3.2.
The compiler would run on the MIB and generate output. What I noticed was
that the header file only contained one definition of for a table when there
are seven of them defined in the MIB.
Now, if you haven't looked at mib2c, it is pretty darn confusing! After some
tinkering, I found a line of code that didn't quite jive with my test debug
print statements. So I made the following change:
Old Code:
#============================================
#
# Table-handling routines.
#
#============================================
foreach $vtable (@table_list) {
foreach $ptable (@processtable) {
$variables{$ptable}{'processed'} =
(eval "\"$variables{$ptable}{'code'}\"") . "\n\n";
}
$var_routines .=
(eval "\"$variables{'code-var_table'}{'code'}\"") . "\n\n";
}
New Code:
#============================================
#
# Table-handling routines.
#
#============================================
foreach $vtable (@table_list) {
foreach $ptable (@processtable) {
$variables{$ptable}{'processed'} .= <--- *** NEW CHANGE ***
(eval "\"$variables{$ptable}{'code'}\"") . "\n"; <--- here too,
cosmetic
}
$var_routines .=
(eval "\"$variables{'code-var_table'}{'code'}\"") . "\n\n";
}
and voila! My header file had the proper tables entries and the
corresponding c file also had the proper functions to access the tables.
Has anyone else reported this as a problem? In discussing this with a
co-worker, we made the observation that the DOCSIS MIBs could be compliant,
but the fact that in mib2c they concatenate the one variable but not the
other proved the reason why I was only seeing the *last* table in the header
file.
Ron
==============================================
Ron Kundla nBand Communications, Inc.
Systems Engineer Mountain View, CA 94041
rkundla@nband.com Main: 650.716.0700