Hello,
i have written my own mib2c.conf file to generate header files from MIB
which lists all traps and the corresponding structure entries for storing
data passed with the traps.
Here is wht my mib2c.conf files looks like
------------------------------------------------------------------------
@open ./public/${NAME}.h@
/*
This is autogenerated code please dont edit
*/
@foreach $i scalar@
#define $i.uc {$i.objectID,$i.decl,$i.syntax,$i.oidlength}
@end@
@foreach $i table@
@foreach $c column@
#define $c.uc {$c.objectID, $c.decl,$c.syntax,$i.oidlength}
@end@
@end@
@foreach $i notifications@
@eval $g=$MODULEID@
@eval $g = $g + $i.subid@
#define $i.uc $g
@end@
@close $NAME@
@open ./lib/${NAME}.h@
/*
This is autogenerated code. Please dont edit
*/
typedef struct _oidtable_{
int m_EventID;
char* m_Oid;
}OIDTABLE;
@foreach $i notifications@
@eval $r=$i.moduleid@
@end@
OIDTABLE l_EventTable[] = {
@foreach $i notifications@
@eval $g=$MODULEID@
@eval $g = $g + $i.subid@
{$g, "$i.objectID"},
@end@
{0,NULL}
};
@foreach $i notification@
typedef struct _${i}_ {
@foreach $i varbinds@
@if $i.hashint@
@if $i.decl eq "char"@
$i.decl $i.uc[$i.hint]
@else@
$i.decl $i.uc
@end@
@end@
@end@
}${i};
@end@
@close ./lib/$NAME.h@
-------------------------------------------------------------------------
The problem i m facing all traps dont have variable bindings and i end up
generating empty structures which is not standard C.
I just wanted pointers if any of u have faced similiar problems and is their
a way around this while writing ur own mib2c.conf files
-SIGTERM
amit
--
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders