From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hugo Tyson To: Ron Kundla Cc: "eCos Mailing List (E-mail)" Subject: Re: [ECOS] Bug in snmp2c in current build tree Date: Tue, 31 Jul 2001 08:02:00 -0000 Message-id: References: X-SW-Source: 2001-07/msg00950.html Ron Kundla writes: > 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. I noticed that same issue when initially getting the SNMP package introduced to eCos' network stack, but time pressure and... > Now, if you haven't looked at mib2c, it is pretty darn confusing! ...is why I just lived with it and fixed up the header by hand; IIRC only having to tinker with a couple of files. > 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: > > and voila! My header file had the proper tables entries and the > corresponding c file also had the proper functions to access the tables. That's excellent, so I have committed the change (below) to our source repository - your name in lights! ;-) > 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. Yes, I agree with that analysis. I'll copy the guys at UCD with this to let them adopt the change, if they haven't got it already. Thanks again, - Huge Index: net/snmp/agent/current/ChangeLog =================================================================== RCS file: /home/cvs/ecc/ecc/net/snmp/agent/current/ChangeLog,v retrieving revision 1.30 diff -u -5 -p -r1.30 ChangeLog --- net/snmp/agent/current/ChangeLog 2001/06/07 12:21:28 1.30 +++ net/snmp/agent/current/ChangeLog 2001/07/31 14:54:07 @@ -1,5 +1,13 @@ +2001-07-31 Hugo Tyson +2001-07-31 Ron Kundla + + * utils/mib2c/mib2c (Table-handling): Concatenate rather than + replace subsequent processed variables. The symptom was that in + the generated header file you only get the last table in the MIB. + This fixes it. Thanks Ron! + 2001-06-07 Jesper Skov * src/mibgroup/mibII/ip.c (var_ipNetToMediaTable): Only handle IPNETTOMEDIAPHYSADDRESS for devices with associated hardware. Index: net/snmp/agent/current/utils/mib2c/mib2c =================================================================== RCS file: /home/cvs/ecc/ecc/net/snmp/agent/current/utils/mib2c/mib2c,v retrieving revision 1.1 diff -u -5 -p -r1.1 mib2c --- net/snmp/agent/current/utils/mib2c/mib2c 2000/06/02 13:05:26 1.1 +++ net/snmp/agent/current/utils/mib2c/mib2c 2001/07/31 14:54:07 @@ -130,11 +130,11 @@ $varlen = $varLengths[$varlen]; # Table-handling routines. # #============================================ foreach $vtable (@table_list) { foreach $ptable (@processtable) { - $variables{$ptable}{'processed'} = + $variables{$ptable}{'processed'} .= (eval "\"$variables{$ptable}{'code'}\"") . "\n\n"; } $var_routines .= (eval "\"$variables{'code-var_table'}{'code'}\"") . "\n\n"; }