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> |
>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 ) if(*((unsigned int *)ptr) != EXCEPTION_NO_SUCH_INSTANCE) { type= *((int *)ptr); switch(type) {  
; case TYPE_STRING: snmp_set_var_typed_value(requestvb,AS
N_OCTET_STR,(u_char *) ptr, str_len); break; case TYPE_INT: snmp_set_var_typed_value(requestvb,ASN_INTEGER, (u_char *) ptr, sizeof(INT)); break;
case TYPE_IPADDR: snmp_set_var_typed_value(re
questvb,ASN_IPADDRESS, (u_char *) ptr, sizeof(unsigned long)); break; default: return SNMP_ERR_RESOURCEUNAVAILABLE; break; } } return SNMP_ER
R_NOERROR; }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, string = 0xb7a395b0 "", objid = 0xb7a395b0, bitstring = 0xb7a395b0 "", counter64 = 0xb7a395b0, floatVal = 0xb7a395b0, doubleVal = 0xb7a395b0}, val_len = 0, name_loc = {1, 3, 6, 1, 1, 1, 144, 1, 122, 1, 1, 4, 0 <repeats 116 times>}, buf = '\0' <repeats 39 times>, data = 0x0, dataFreeHook = 0, index = 0}>
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