Re: Problem with multiple get

"girish" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <1201016464.S.6151.18793.f4mail-234-217.rediffmail.com.old.1201081154.32153@webmail.rediffmail.com>
Thanks a lot Dave,I changed the code accordingly and it worked for me. But what I doubt is if we send a get request with multiple attributes in a single request how it will be handled by the Master. How it will forward it to the subagent. I can see in the subagent side that different requests are coming from master and if I see the same in master side using wireshark I could see that the a single request has been sent to subagent with multiple var binds??? How actually this handled at master side???On Tue, 22 Jan 2008 15:34:26 +0000 "Dave Shield"  wrote  On 22 Jan 2008 15:03:29 -0000, girish  wrote:  &gt;  &gt; &gt;What does the code *around* this fragment look like?  &gt;   &gt;In particular, how is the variable 'requestvb' assigned?    &gt; Here is the code which handles response:  &gt; 
 Response_handle(unsigned char *Buffer,int size, netsnmp_request_info *requests)  &gt; {  &gt;         ptr = (unsigned char *)pbuf;  &gt;         netsnmp_variable_list *Vbsvd = NULL;  &gt;   
       for (Vbsvd = requests-&gt;requestvb; Vbsvd; Vbsvd = Vbsvd-&gt;next_variable )    No - you don't step through the 'requestvb' list.  You step through the 'requests' list.    Try             netsnmp_request_info *r;               for ( r=requests;  r;  r=r-&gt;next )   {                 requestvb = r-&gt;requestvb;      &gt;               case TYPE_STRING:  &gt;                     snmp_set_var_typed_value(requestvb,ASN_OCTET_STR,(u_char *) ptr, str_len);  &gt;                     break;    You've never actually given 'requestvb' a value.  Your loop uses the variable 'Vbsvb' (although this is wrong anyway).  'requestvb' will probably have some random junk in it, so might easily  blow up when you try to access it.        &gt; and requestvb at the time of debugging looks like this(for t
 he 1st attribute):    I didn't ask what it looked like.  I asked how you *assigned* its value.  The answer appears to be that you don't.          Please try with the code fragments shown abo
 ve.  It might also be worth starting with a fresh mib2c template output,  which should have a cleaner codebase.  You seem to have mangled  this fairly effectively!    Dave    -------------------------------------------------------------------------  This SF.net email is sponsored by: Microsoft  Defy all challenges. Microsoft(R) Visual Studio 2008.  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/  _______________________________________________  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    


Regards,
Girish

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
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.