On Thu, Apr 17, 2008 at 3:47 AM, Dave Shield <[EMAIL PROTECTED]>
wrote:
> On 17/04/2008, Alejandro Islas <[EMAIL PROTECTED]> wrote:
> > I tried to use mib2c.container.conf file but mib2c
> > wasn't able to found it
>
> Hmmm... what version of the toolkit are you using?
> mib2c.container.conf has been around since the 5.2 release
> (although the internals have changed significantly since then).
>
> I'm using NET-SNMP version: 5.2.1.2
>
>
> > 1)After using mib2c my .c file only contains create/remove entries
> > functions. As far as I understand, I need to implement a fetch entrie,
> to
> > avoid duplicate row entries..correct???
>
> Sorry - I don't understand what you're asking here.
After using mib2c to generate my code, I noticed that it created a
create_row_entry and a
remove_row_entry functions. I implemented a fetch_row_entry, so that my
code would be able to check
if it doesn't have a previously created entry for a particular index.
>
>
> > 2) Besides including data reading functions (i'm using text files),
>
> What do you mean by "data reading functions"?
> How are you storing the table contents within your module?
I read a text file created by another process. Each line of such text
file contains a row's info
of my table, so my process checks for such entry(using the index) in the
linked list and updated it or create a new entry
if its the first time I received inf of such row.
>
>
> > do I need to do anything else?? I did not do anything to the handler,
> > get_first_data_point and get_next_data_point functions, I left them as
> mib2
> > generated them.
>
> The get_{first,next}_data_point routines need to step through the
> rows of your table - in whatever way is appropriate for your module.
> The template code assumes that the table is held as a linked list
> of individual row entries - if this is how your data reading functions
> store the table, then you probably don't need to change this code
> much (if at all).
> If you are storing the table in a different manner (or pulling it from
> external sources), then you will need to amend these two routines
> to match.
Yes, I'm using the linked list of individual row entries created by
mib2c.
>
>
> > 3) Could you explain (or send me an info link) of how my table handler
> is
> > called by the system?? I don't see where my table list is called on it.
>
> When you register the table, the agent includes this information in
> a list of all the OIDs that it knows about. When it receives a request,
> it searches this list for the appropriate match(es), and calls the
> corresponding handlers.
>
>
> > 4) I used gdb...but didn't help me a lot, it only confirmed a
> segmentation
> > fault.
>
> But it should also indicate *where* this segmentation fault occurs.
> This would help track down what is causing it.
You're right, I think I need to play a little bit more with gbd
>
>
> > I'm not compiling the whole project, only adding my so files using
> > dlmod command. Can I still use dbg using this method or do I need to
> compile
> > the whole deamon including my handlers???
>
> Ummm... not sure.
> It would probably be sensible to start by working with a "traditional"
> approach,
> at least until you get the module working. The same module code can be
> embedded within the main agent, loaded dynamically, or used within a
> subagent - with no changes to the code.
>
I'll try this and let you know.
Alejandro
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders