Re: Raw-table doesn't work.

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 22 March 2011 19:32, Naama Bar Menachem
<[email protected]> wrote:
> The code below implements a simple rax-table.
>
> Although the initialize function succeeds the handler isn’t called when we
> send a get or getnext request

Are you sure that the handler isn't being called at all?
Or is it simply that the agent isn't returning the expected results?

I don't see any debug or trace statements in the handler,
so it's difficult to know exactly what testing you've done.


Following a quick look at the code, I have two main comments:

  a)  I'm not sure whether you actually need the
       nsDemodEventsTable_entry structure.   You could
       probably use the ns_entry structure directly,
       and avoid having to copy data between the two.

  b)  There seems to be some confusion between logical
        and bitwise operations.

Statements such as
        tmp = *(idx->val.integer) < 32;
                  are setting a boolean value   (is the value less than 32)
rather than a left-shift  (high-order 32 bits), which I suspect is
what's intended.
And similarly for

     *(idx->val.integer) = (event->utc.tv_sec) && 0xFFFFFFFF;

which will set the index value to 1 regardless
     (anything AND true is true).
This probably ought to be using a bit-wise OR ('&')
rather than logical OR ('&&')

Both of those would explain why the agent wasn't returning the
correct results,   but not why the handler wasn't being called at all.

If that is actually what is happening, then I'm at a loss to explain why.

Dave

PS:  Please post your queries *once*
   There's no point in sending the same request twice,
just to add a missing signature!

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.