Your suggestion fixed the myTable_free errors. But I am unable to see the table
content from snmpwalk.
Here is the code piece for myTable_load function: (Note that I added "return 0"
at the end of generated codes)
int myTable_load(netsnmp_cache * cache, void *vmagic) {
netsnmp_tdata * table = (netsnmp_tdata *) vmagic;
netsnmp_tdata_row *row;
struct myTable_entry *entry;
u_long i;
for (i = 0; i < total; i++) {
row = myTable_createEntry(table, i);
entry = (struct myTable_entry *)row->data;
entry->state = mytbl[i].state;
entry->count = mytbl[i].count;
}
return 0;
}
I used "-S cache=1" to generate the code with caching support. My net-snmp
verison is 5.3.1.
Can you let me know if I did anything wrong in myTable_load function?
Thanks
Xuan
> Date: Wed, 11 Nov 2009 09:04:39 +0000
> Subject: Re: Question about mib2c.create-dataset.conf
> From: [email protected]
> To: [email protected]
> CC: [email protected]
>
> 2009/11/10 X Z <[email protected]>:
> > I didn't change anything but I am still getting the same error:
> >
> > myTable.c:117: error: conflicting types for myTable_free
> > myTable.h:16: error: previous declaration of myTable_free was here
>
> OK - I was wrong.
> You *do* need to tweak the generated code.
>
> Take the definition of
> int myTable_free(netsnmp_cache * cache, void *vmagic)
>
> in your C file, and change "int" to "void".
> Don't touch the code for myTable_load.
>
>
> One thing still confuses me.
> You said that you had generated the code using mib2c.create-dataset.conf,
> But this template doesn't include any reference to caching support
> (in *any* of the code branches).
>
> I've fixed the two mib2c templates that do use the caching helper
> (and had the broken definition of the free routine).
> These are mib2c.iterate.conf (5.2ff) and mib2c.table_data.conf (5.3ff)
>
> But mib2c.create-dataset.conf doesn't seem to be affected.
> I don't understand how you are seeing this problem if you've
> used that template?
>
> Dave
_________________________________________________________________
Windows 7: Unclutter your desktop.
http://go.microsoft.com/?linkid=9690331&ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users