Re :Re: Problem with multiple get

"girish" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <1200994862.S.5466.13363.f4mail-235-218.rediffmail.com.old.1201014209.28700@webmail.rediffmail.com>
&gt;What does the code *around* this fragment look like?  &gt;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){&nbsp;&nbsp;&nbsp; ptr = (unsigned char *)pbuf;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; netsnmp_variable_list *Vbsvd = NULL;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (Vbsvd = requests-&gt;requestvb; Vbsvd; Vbsvd = Vbsvd-&gt;next_variable )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(*((unsigned int *)ptr) != EXCEPTION_NO_SUCH_INSTANCE)&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; type= *((int *)ptr);&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; switch(type)&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp
 ; &nbsp;&nbsp;&nbsp; case TYPE_STRING:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; snmp_set_var_typed_value(requestvb,AS
 N_OCTET_STR,(u_char *) ptr, str_len);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case TYPE_INT:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; snmp_set_var_typed_value(requestvb,ASN_INTEGER, (u_char *) ptr, sizeof(INT));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case TYPE_IPADDR:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; snmp_set_var_typed_value(re
 questvb,ASN_IPADDRESS, (u_char *) ptr, sizeof(unsigned long));&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return SNMP_ERR_RESOURCEUNAVAILABLE;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return SNMP_ER
 R_NOERROR;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }and requestvb at the time of debugging looks like this(for the 1st attribute):    (gdb) p *requestvb$6 = {next_variable = 0x0, name = 0x
 b7a393b0, name_length = 13, type = 5 '\005', val = {integer = 0xb7a395b0, &nbsp;&nbsp;&nbsp; string = 0xb7a395b0 "", objid = 0xb7a395b0, bitstring = 0xb7a395b0 "", counter64 = 0xb7a395b0, floatVal = 0xb7a395b0, &nbsp;&nbsp;&nbsp; doubleVal = 0xb7a395b0}, val_len = 0, name_loc = {1, 3, 6, 1, 1, 1, 144, 1, 122, 1, 1, 4, 0 &lt;repeats 116 times&gt;}, &nbsp; buf = '\0' &lt;repeats 39 times&gt;, data = 0x0, dataFreeHook = 0, index = 0}&gt;
Please *always* give a sensible amount of context.
Sorry for this.

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.