Hi,

 

Can you please help in any way? Please let me know if there is an answer to my question in a former message. Please let me know if my code is completely wrong or has any basic mistakes.

 

Thanks in advance.

 


From: gil shinar [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 14, 2006 7:00 PM
To: Wes Hardaker; Shinar, Gil; [email protected]
Subject: Re: snmpget V2 looping subagent

 

Hi,

 

Thanks for the replay.

 

This is an example code of the first_data_point function of one of the tables :

 

netsnmp_variable_list *
connectionToDBSTable_get_first_data_point(void **my_loop_context,
                                          void **my_data_context,
                                          netsnmp_variable_list *
                                          put_index_data,
                                          netsnmp_iterator_info *mydata)

{

    netsnmp_variable_list *vptr;
    int i = 0;

    if(pMIB)
    {
        pMIB->connectionDBS[0].index = 0;
        pConDBS_m = &pMIB->connectionDBS[0];
        i++;
        while(i < SHM_MAX_NO_OF_AMS && pMIB->connectionDBS[i].dbs_num != MAX_ENTITIES_NUM){
                pMIB->connectionDBS[i].index = i;
                pConDBS_m->next = &pMIB->connectionDBS[i];
                pConDBS_m = pConDBS_m->next;
                i++;
        }
        pConDBS_m->next = NULL;

        pConDBS_head = pMIB->connectionDBS;

        *my_loop_context = (void *)pConDBS_head;
        *my_data_context = (void *)pConDBS_head;

        vptr = put_index_data;

        snmp_set_var_value(vptr,
                      (u_char *)&pConDBS_head->index,
                      sizeof(int));

        return put_index_data;
    }
    else
    {
        return NULL;
    }
}

I have removed the part of the code that checks if the table is empty and returns a NULL because

this what causes the endless loop.

 

Let me know if you need other parts of my code.

 

Thanks



----- Original Message -----

 

>>>>> On Tue, 13 Jun 2006 18:06:11 +0300, "Shinar, Gil" <[EMAIL PROTECTED]> said: Gil> When I've tried to debug the code, I saw differences between what I get
Gil> when I use snmpwalk then when I use the snmp manager.
 
Unfortunately, it's unlikely we can help you without looking at the
code you've written.  It certainly is related to how you're handling
your code because the agent itself shouldn't be suffering from any
issues related to multiple requests in a single PDU.
 
Gil> Is there a patch that should fix it ? Is there a difference between V1
Gil> mib file to V2 mib file and if there is, should I use V2 mib file to
Gil> generate the code with mib2c command ?
 
It shouldn't matter.
-- 
Wes Hardaker
Sparta, Inc.
 
 
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders 

 

__________________________________________________________________________________________
This electronic message contains information from Verint Systems, which may be privileged and confidential.
The information is intended to be for the use of the individual(s)or entity named above.
If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited.
If you have received this electronic message in error, please notify us by replying to this email (1).

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to