On 11 January 2012 10:38, <[email protected]> wrote: >>make -f dot1qVlanStaticTable_Makefile >>Have you tried this approach? > > Yes, I have already tried this approach also.
> They give another set of errors. > [root@localhost vlan]# make -f dot1qVlanStaticTable_Makefile > gcc -I. `net-snmp-config --base-cflags` -Wall -Wstrict-prototypes -c -o > dot1qVlanStaticTable_data_access.o dot1qVlanStaticTable_data_access.c > dot1qVlanStaticTable_data_access.c:327: error: dot1qVlanStaticName_len > undeclared (first use in this function) <etc> > make: *** [dot1qVlanStaticTable_data_access.o] Error 1 > > But it remains a fact that these are the exact set of errors you will get, > when you try to compile all the c files using > > [root@localhost vlan]# net-snmp-config --compile-subagent --norm vlan *.c > > > > These variables are declared and defined in dot1qVlanStaticTable.h and the > file is included also. Actually no - these names are defined as *fields* within the dot1qVlanStaticTable_data data structure. They're not defined as separate variables, which is how they are being used in the data_access file. > Ideally this should work. > > I have no idea of how to solve this error. What changes have you made to the generated code? There are two blocks marked "EXAMPLE CODE" which probably need to be tweaked to finish implementing the MIB. In particular, the second one includes a comment /* parse line into variables */ which is probably where dot1qVlanStaticName (& dot1qVlanStaticName_len) and similar should be set up. > Moreover I found out one thing in these days.. > > I know this is not the correct way to try. > > But if you manually edit the Q-BRIDGE-MIB: dot1qVlanStaticTable to some > other name, say ipAddressTable or ifTable > > (The new name should be the name of a table which Net-SNMP already > supports.) > > The subagent will get created. I suspect that's because it's then referring to variables that *have* been declared elsewhere in the agent - i.e. the "container_load" routine is sort-of-complete. I also suspect that this only works if you choose a table that has been implemented using the MfD framework. I'd be much less confident that things would compile if you chose a table that was coded in a different way (such as the DisMan Event MIB mteTriggerTable or the Net-SNMP specific nsModuleTable) > So I think there is some bug in mib2c preventing me to compile or > Most probably I may be doing something terribly wrong. It's certainly possible that there is a bug in mib2c or the MfD framework, though I'd be surprised. This isn't an approach that I'm particularly fond of myself (which is why I don't personally use it), but Robert swears by it. So it's unlikely that the code framework that it produces is fundamentally broken. But remember that the code generated by mib2c is just a *template* for implementing your MIB. It doesn't pretend to be a complete working implementation straight off. You still need to fill in the gaps. If you're trying to take the output and compile it as it stands, then no, this won't work. Dave ------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
