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:  >  > 
>What does the code *around* this fragment look like?  >   >In 
particular, how is the variable 'requestvb' assigned?    > Here is the code 
which handles response:  > Response_handle(unsigned char *Buffer,int size, 
netsnmp_request_info *requests)  > {  >         ptr = (unsigned char 
*)pbuf;  >         netsnmp_variable_list *Vbsvd = NULL;  >   
       for (Vbsvd = requests->requestvb; Vbsvd; Vbsvd = 
Vbsvd->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->next )   {                 
requestvb = r->requestvb;      >               case TYPE_STRING:  >    
                 snmp_set_var_typed_value(requestvb,ASN_OCTET_STR,(u_char *) 
ptr, str_len);  >                     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.        > and requestvb at the 
time of debugging looks like this(for the 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

Reply via email to