Question regarding ASN_OCTET_STR Type

Farid Farid <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
HI Every one,

I have a basic question regarding  how to   pass mibs with string content .

I want to pass a string ( like "Hello world") when I retrieve  my MIB.

In  my mib handler I have the following lines:


char my_data[] = "Hello World";

switch ( reqinfo->mode) {

case   MODE_GET:

snmp_set_var_typed_value( request->requestvb , ASN_OCTECT_CTR, (u_char *) &my_data , sizeof(my_data));

break;
..
..





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 

Appreciate your help,
Farid

------------------------------------------------------------------------------
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.