My code
"
u_char response[1];
case MODE_GET:
response[0] = 0x69;
snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
(u_char *)response, 1);
break;
Output for snmpget.
SNMPv2-SMI::enterprises.27594.2.1.1.24.0 = STRING: "i"
Interesting thing is if I set my response to a small number, say 0x06. It's
showing my desire value 06.
Any help? Thanks
On Sat, Dec 20, 2008 at 10:12 PM, Lucian Romi <[email protected]> wrote:
> Hi, I'm implementing a hex parameter has one byte only.
> The value of it is 0x69. As this is a hex value, we don't want to define it
> as Integer.
> Also, it's one byte only, so from 0x0 to 0xff.
> At the begining, I think OCTET STRING(size(1)) will work.
> However, when I give it a one byte value like 0x69, it's showing ASCII
> string "i" as result.
> Surely 0x69 has ASCII value "i", but we don't want that. We just want it
> showing 0x69 or 69.
> Is there anyway to do that? Thanks!
>
------------------------------------------------------------------------------
_______________________________________________
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