HI,
It appears that you have misunderstood the definition of the DataAndTime
textual convention. Here is the definition from RFC 2579:
DateAndTime ::= TEXTUAL-CONVENTION
DISPLAY-HINT "2d-1d-1d,1d:1d:1d.1d,1a1d:1d"
STATUS current
DESCRIPTION
"A date-time specification.
field octets contents range
----- ------ -------- -----
1 1-2 year* 0..65536
2 3 month 1..12
3 4 day 1..31
4 5 hour 0..23
5 6 minutes 0..59
6 7 seconds 0..60
(use 60 for leap-second)
7 8 deci-seconds 0..9
8 9 direction from UTC '+' / '-'
9 10 hours from UTC* 0..13
10 11 minutes from UTC 0..59
* Notes:
- the value of year is in network-byte order
- daylight saving time in New Zealand is +13
For example, Tuesday May 26, 1992 at 1:30:15 PM EDT would be
displayed as:
1992-5-26,13:30:15.0,-4:0
Note that if only local time is known, then timezone
information (fields 8-10) is not present."
SYNTAX OCTET STRING (SIZE (8 | 11))
The value of an item with data type DateAndTime is a binary
string and NOT a displayable string. The value of the
DISPLAY-HINT clause tells you how to decode the binary
string to construct a displayable value. It appears that
the DESCRIPTION clause is incomplete in that it should have
said that the value of
0x07C8 05 1a 0d 1e 0e 00 2d 04 00 (i put in spaces to show the fields)
or without spaces:
0x07C8051a0d1e0e002d0400 (length of 11)
Regards,
/david t. perkins
On Sun, 27 Nov 2005 [EMAIL PROTECTED] wrote:
> Hi
>
> One of our Property MIB is defined as
> "SYNTAX DateAndTime
> MAX-ACCESS read-only".
>
> For this mib i had generated c code , using mib2c script (
> mib2c.scalar.conf). In the code, for that particular scalar i am sending
> string
> "1992-5-26,13:30:15.0,-4:0" by filling set_var_type value as
>
>
> snmp_set_var_typed_value
> (requests,ASN_OCTET_STR,"1992-5-26,13:30:15.0,-4:0",
> strlen ("1992-5-26,13:30:15.0,-4:0").
>
> When i am giving get on this scalar it is showing big strig...
> Does net-snmp coverts for DateAndTime to some other format ( the
> formate what i had given is already in dateAndtime format).
>
>
> ------------------------------------------------------------------------
> ------------------------------------
> [EMAIL PROTECTED] weTst]$ snmpget -v2c -c motro 10.201.114.139 mySclalar.0
> MY-MIB::myScalar.0 = STRING:
> 12601-57-50,45:53:45.50,644:495158514858495346484445525848
>
> ------------------------------------------------------------------------
> ------------------------------------
>
>
> Can some body help me , how i can display the same string what i am
> sending in the code , as snmpget output.
>
> regards
> Kanda
>
>
>
>
> -------------------------------------------------------
> 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_idv37&alloc_id865&op?k
> _______________________________________________
> Net-snmp-coders mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>
-------------------------------------------------------
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_idv37&alloc_id865&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders