On Tue, 2004-11-16 at 05:51, Robert Story wrote:
> On 05 Nov 2004 10:50:22 +0530 Sasikumar wrote:
> SB> below is the code snippet.
> SB> cVal contains the result returned by the agent in string form, cVal is 
> SB> 
> SB> static u_char cVal[100];
> SB> 
> SB> fLog("COLUMN_IPNETTOMEDIAPHYSADDRESS in string form is %s\n", cVal);
> SB> snmp_set_var_typed_value(var, ASN_OCTET_STR,
> SB>                         (u_char *) cVal,
> SB>                          strlen(cVal)*sizeof(u_char)
> SB>                          );
> SB> 
> SB> The fLog output is as follows
> SB> 
> SB> COLUMN_IPNETTOMEDIAPHYSADDRESS in string form is 00 00 5E 00 01 01
> 
> This is the problem. You want to pass the raw hex to snmp_set_var_typed_value,
> not an actual string. If cVal is an ASCII string, you need to convert it to 6
> hex bytes before passing it in, and you don't want to be using strlen. In
> other words, cVal should not be a printable string.

Hi,
  cVal is not containing ASCII string 
  As i mentioned in my first mail about the BRIDGE-MIB. This mib has one
entry called dot1dBaseBridgeAddress syntax is MacAddress. In this case
also like ipNettoMediaPhyAddress cVal contains the hex format value
which is then passed to snmp_set_var_typed_value, but 
dot1dBaseBridgeAddress output is in hex format and
ipNettoMediaPhyAddress output in ASCII format.

Another observation in both the cases I am passing cVal string
containing the hex format value which i got from the agent.
I also examined the PDU of both the entries and found that for
dot1dBaseBridgeAddress has value part in hex format.
ipNettoMediaPhyAddress has value part in ASCII format.



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
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

Reply via email to