Re: Question regarding ASN_OCTET_STR Type

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAKoMtGY0K=-XA2S4iN5DwphW=1A4pSVy6w+oqSyf9Q2z8LXKSw@mail.gmail.com>
On 18 January 2013 19:57, Farid Farid <[email protected]> wrote:
> When I run  snmpget to read my_mib   I get the Hex and not  ASCII for "Hello
> World".
>
> So I get 48 65 6c 6c 6f 20 57 6f 72 6c 64 1f.   instead of  "Hello World"
>
> How can I send the data to see the string in ASCII format

Looking at those hex values, I suspect the problem is the last
one ('1f') - that's probably being regarded as "non-printable",
so the whole string is represented in hex, rather than ascii.

Try setting the value using
  snmp_set_var_typed_value( request->requestvb , ASN_OCTECT_CTR,
       (u_char *) &my_data , strlen(my_data));

(instead of 'sizeof'), and see if that helps.

Dave

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
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.