Dear All:
I found there exist some mistakes when using mib2c in net-snmp-5-4
when I execute mib2c netSnmpTutorialMIB, and choose ucd-snmp
the resulting mib template is somehow different to ustScalarSet.c which
posted
on the
http://net-snmp.sourceforge.net/tutorial/tutorial-4/toolkit/mib_module/ustScalarSet.c
After I compiler netSnmpTutorialMIB.c, the resulting is error, and its error
message is
as following:
netSnmpTutorialMIB.c:error: "VAR" undeclared ....
and its function is belowed:
switch (vp->magic) {
case NSTAGENTMODULEOBJECT:
*write_method = write_nstAgentModuleObject;
VAR = VALUE; /* XXX */
return (u_char *) & VAR;
case NSTAGENTSUBAGENTOBJECT:
*write_method = write_nstAgentSubagentObject;
VAR = VALUE; /* XXX */
return (u_char *) & VAR;
case NSTAGENTPLUGINOBJECT:
*write_method = write_nstAgentPluginObject;
VAR = VALUE; /* XXX */
return (u_char *) & VAR;
default:
ERROR_MSG("");
}
return NULL;
}
however, in
http://net-snmp.sourceforge.net/tutorial/tutorial-4/toolkit/mib_module/ustScalarSet.c
its switch statement is different , such like:
switch(vp->magic) {
case USTSSSIMPLESTRING:
*write_method = write_ustSSSimpleString;
*var_len = ustSSSimpleString_len;
return (unsigned char *) ustSSSimpleString;
case USTSSSECONDSSINCECHANGED:
/* TimeTicks are seconds*100 */
long_ret = (time(NULL) - lastChanged)*100;
*var_len = sizeof(long_ret);
return (unsigned char *) &long_ret;
default:
ERROR_MSG("");
}
return NULL;
}
Does this is an error of net-snmp 5-4?
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders