On Wed, 2005-11-30 at 21:06 +0530, [EMAIL PROTECTED] wrote:
> I had tried the value, what you had send,
> still i am getting some big number.
> I had filled the snmp_set_var_typed_value as

>    snmp_set_var_typed_value (requests, ASN_OCTET_STR, 
>                             "0x07C8051a0d1e0e002d0400",
>                     strlen ("0x07C8051a0d1e0e002d0400"))


No - that's not correct.
A DateAnd Time value is not a printable string.  It's a
*binary* string, with the binary values that David suggested.

Try:

    char date_val[] = { 0x07, 0xc8, 0x05, 0x1a, 0x0d, 0x1e,
                        0x0e, 0x00, 0x2d, 0x04, 0x00 };
    snmp_set_var_typed_value (requests, ASN_OCTET_STR,
                              date_val, 11 );



> For dateAndTime scalars, Do i have to send the (hexa values),
> in some other format?

Yes - see above.

> 
> In mib2c code, i am getting variable->type as "ASN_OCTET_STR",
> wheather myScalar SYNTAX is DisplayString or DateAndTime.

That's correct.
Both DateAndTime and DisplayString objects are represented
as ASN_OCTET_STR values on the wire.
Distinguishing between them is handled at the application
level - either the agent code that implements the object,
or the manager code that interprets the value.

This behaviour is either hardcoded (e.g in the agent),
or follows from loading the relevant MIB definition
(typical manager behaviour).

But the two syntaxes look identical as far as on-the-wire
traffic is concerned.


Dave


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to