Home/Support/Support Forum/SNMP custvars.c generated using Netos 7.2
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

SNMP custvars.c generated using Netos 7.2

0 votes
SNMP custvars.c generated using Netos 7.2, can it be used as is for Netos 7.5. Currently I am using as is, call to initializeCustomMibs() and naSnmpStart() is successful. But walk, get etc are not working from Mib browser. Do I need to modify the code to work it on Netos 7.5? Or should I re-generate the custvars.c?
asked Oct 15, 2016 in NET+OS by arunmahendran New to the Community (2 points)

Please log in or register to answer this question.

3 Answers

0 votes
 
Best answer
Definitely some changes; I have the following notes from moving from 7.4 to 7.5, so there may be more:
"Structure NaSnmpTrap_t becomes NaSnmpTrapParms_t - removes enterprisenum field
new custvars.h file
Changes in custvars.c - extra code, slightly different structures
Possible index errors in mib-vars.c - recompile
Various new callbacks available to flag when variables updated.
svarFindVar now svarFindVarPtr (affects makeSNMPvar() in custvars)"


Also, you will find is that you need to modify the netos/bin/mib2src.bat file to create the SNMP files in what Digi call 'legacy' mode (which personally I prefer anyway):
rem Modified to generate legacy format file
@echo off
@if %1$ == $ goto ERROR1

set mibfile=%1

if not exist %mibfile% goto ERROR2

C:\netos75\mibcomp\mibcomp_win321\smi\bin\smidump -f TreckLegacy %mibfile%
@goto DONE

:ERROR1
@echo mib2src <mibfile>
@goto DONE

:ERROR2
@echo File %mibfile% does not exist
@goto DONE

:DONE:


Also, the generated ***_var.c file needs a simple modification before it will compile.

Lines of the form:
if ((err = tfProcessInt(varValPtr, &varValLen, &varValType, &((tt32Bit)intp)))

need changing to:
if ((err = tfProcessInt(varValPtr, &varValLen, &varValType, (tt32BitPtr)(&intp)))
answered Oct 17, 2016 by steved2 Seasoned Professional (151 points)
selected Oct 25, 2016 by arunmahendran
0 votes
Thank you Steev for your help. I have converted converted the MIB to C using Netos7.5 tool. But still call-back functions are not getting called. Now I am trying to test example code(namib) given by Netos7.5, that also does not work in my environment.
Is there any mechanism to debug libsnmp using JTAG? Basically I wanted to see if requests are coming to SNMP thread.
Also I see "libsnmpdbg.a" in lib folder, how can I enable debugging for SNMP?
answered Oct 25, 2016 by arunmahendran New to the Community (2 points)
0 votes
Make sure everything that needs to be initialised, is.

Look at the nasnmp example; maybe try that to see if it works.
answered Oct 27, 2016 by steved2 Seasoned Professional (151 points)
...