Hi Dave,

Sorry to bother you but i think this time is the last question or aid, in my extended agent of snmp by using the dlmod, in the function of registering the variables in init_Filename i use these functions:

in init_Filename()

init_mib()
/* after the parsing of my private mibs that 's contain many tables */
i register my variable by using this function:
register_mib_range(descr, (struct variable *)var, sizeof(struct vartype), var_len, theoid, sizeof(theoid)/sizeof(oid), DEFAULT_MIB_PRIORITY, 1, 1, NULL)!= MIB_REGISTERED_OK)

so my question is: if i define an index in the mib for a table how can i register this index after these functions above?

my solution for this problem is to construct the oid manually in the var_filename() function by manually parsing the mib to get the index and then construct the oid with index and return it as argument sturct oid name to var_filename()

i want to know if there a better solution than this solution above

thank you very much for ur time

Best Regards

Elias


From: Dave Shield <[EMAIL PROTECTED]>
To: elias bou rahal <[EMAIL PROTECTED]>
CC: net-snmp-users@lists.sourceforge.net
Subject: Re: FW: Re: how can i get the index of a mib by using any snmpapi.c
Date: Thu, 02 Mar 2006 16:02:47 +0000

On Thu, 2006-03-02 at 15:56 +0000, elias bou rahal wrote:
> i am talking about the indexes used when registering the MIB table

OK.
Then you should provide this information manually (by looking
at the MIB file yourself).  The agent doesn't actually need the
MIB file at all, so it doesn't rely on looking up the syntax of
the table - that's part of the static design and ends up hardcoded
into the MIB implementation.

If you look at the code for some of the existing tables, you'll
see that they specify the syntax of the indexes as part of the
initialisation routine.  You should do the same.

Dave




-------------------------------------------------------
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-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to