回复:Re: about the hex-string

[email protected]
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
----- Original Message -----
From: Dave&nbsp;Shield&nbsp;<[email protected]>
To: [email protected]
Subject: Re:&nbsp;about&nbsp;the&nbsp;hex-string
Date: 08-05-27 17:38:25

2008/5/27&nbsp;&nbsp;<[email protected]>:
>&nbsp;&nbsp;Good&nbsp;all.
>
>&nbsp;I&nbsp;am&nbsp;a&nbsp;new&nbsp;expolder&nbsp;in&nbsp;net-snmp;
>
>&nbsp;I&nbsp;wirte&nbsp;a&nbsp;test&nbsp;mib&nbsp;and&nbsp;registered&nbsp;in&nbsp;the&nbsp;net-snmp&nbsp;lib,but&nbsp;where&nbsp;i&nbsp;run
>&nbsp;snmpwalk&nbsp;command,there&nbsp;are&nbsp;some&nbsp;problem:
>
>&nbsp;#snmpwalk&nbsp;-v&nbsp;2c&nbsp;-c&nbsp;public&nbsp;localhost&nbsp;1.3.6.1.4.1

&nbsp;&nbsp;&nbsp;[snip]

>&nbsp;In&nbsp;the&nbsp;handle&nbsp;functions&nbsp;they&nbsp;are&nbsp;ASN_OCTET_STR&nbsp;type.

>An&nbsp;"Octet&nbsp;String"&nbsp;is&nbsp;simply&nbsp;a&nbsp;string&nbsp;of&nbsp;octets.
>These&nbsp;could&nbsp;be&nbsp;printable&nbsp;characters,&nbsp;or&nbsp;binary&nbsp;data.
>The&nbsp;same&nbsp;ASN.1&nbsp;type&nbsp;is&nbsp;used&nbsp;for&nbsp;both.

>The&nbsp;MIB&nbsp;file&nbsp;would&nbsp;normally&nbsp;include&nbsp;a&nbsp;DISPLAY&nbsp;HINT,
>to&nbsp;indicate&nbsp;how&nbsp;this&nbsp;value&nbsp;should&nbsp;be&nbsp;printed.

>In&nbsp;the&nbsp;absence&nbsp;of&nbsp;such&nbsp;a&nbsp;hint,&nbsp;the&nbsp;Net-SNMP&nbsp;library&nbsp;attempts
>to&nbsp;guess&nbsp;whether&nbsp;this&nbsp;is&nbsp;a&nbsp;printable&nbsp;string,&nbsp;or&nbsp;a&nbsp;binary&nbsp;value,
>based&nbsp;on&nbsp;the&nbsp;value&nbsp;returned.


>&nbsp;Please&nbsp;tell&nbsp;me&nbsp;how&nbsp;could&nbsp;the&nbsp;happen&nbsp;?

>Looking&nbsp;at&nbsp;the&nbsp;value&nbsp;returned:

>&nbsp;iso.3.6.1.4.1.55555.1.1.1.10.1.2.1&nbsp;=&nbsp;Hex-STRING:&nbsp;4E&nbsp;55&nbsp;4C&nbsp;4C&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00
>&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00&nbsp;00

>This&nbsp;contains&nbsp;four&nbsp;printable&nbsp;characters&nbsp;("NULL"),
>followed&nbsp;by&nbsp;a&nbsp;large&nbsp;number&nbsp;of&nbsp;0-valued&nbsp;octets,&nbsp;which
>are&nbsp;not&nbsp;printable.&nbsp;&nbsp;So&nbsp;the&nbsp;library&nbsp;has&nbsp;decided&nbsp;that&nbsp;this
>is&nbsp;a&nbsp;binary&nbsp;string&nbsp;value,&nbsp;and&nbsp;displayed&nbsp;it&nbsp;as&nbsp;such.

>It&nbsp;looks&nbsp;as&nbsp;if&nbsp;the&nbsp;code&nbsp;implementing&nbsp;this&nbsp;particular
>object&nbsp;has&nbsp;returned&nbsp;the&nbsp;full&nbsp;buffer&nbsp;holding&nbsp;the&nbsp;value,
>rather&nbsp;than&nbsp;just&nbsp;the&nbsp;printable&nbsp;value&nbsp;itself.
>I.e.

>&nbsp;&nbsp;&nbsp;snmp_set_var_typed_value(
&nbsp;>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request->requestvb,&nbsp;ASN_OCTET_STR,
&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myRow->myColumn,&nbsp;&nbsp;sizeof(myRow->myColumn));

>instead&nbsp;of

>&nbsp;&nbsp;&nbsp;snmp_set_var_typed_value(
&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request->requestvb,&nbsp;ASN_OCTET_STR,
&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myRow->myColumn,&nbsp;&nbsp;strlen(myRow->myColumn));


>If&nbsp;you&nbsp;use&nbsp;strlen,&nbsp;things&nbsp;should&nbsp;be&nbsp;OK.

>Dave
Yes ,thank you very much.There only a small problem on chinese.
When i use comand snmpwalk,there were often appear the informations:
iso.3.6.1.4.1.55555.1.1.7.1.0 = No more variables left in this MIB View (It is past the end of the MIB tree)
If i want not display this informations,what i should do.
Thanks!

-------------------------------------------------------------------------
This&nbsp;SF.net&nbsp;email&nbsp;is&nbsp;sponsored&nbsp;by:&nbsp;Microsoft
Defy&nbsp;all&nbsp;challenges.&nbsp;Microsoft(R)&nbsp;Visual&nbsp;Studio&nbsp;2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users&nbsp;mailing&nbsp;list
[email protected]
Please&nbsp;see&nbsp;the&nbsp;following&nbsp;page&nbsp;to&nbsp;unsubscribe&nbsp;or&nbsp;change&nbsp;other&nbsp;options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users



-------------------------------------------------------------------
谷歌金山词霸&nbsp;网民必备的免费翻译软件&nbsp;下载(&nbsp;http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2008/mail_zhuiyu_20080526.html&nbsp;)

-------------------------------------------------------------------
震撼2008发誓找到爱情&nbsp;上世纪佳缘免费注册(http://www.jiayuan.com/st/?id=3456&amp;url=http://www.jiayuan.com/register/new_step_1.php)

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