Title: Re: timestamp issue

Hi David,

        Thank you for quick the response

        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"))
the reply i got is,
------------------------------------------------------------------------------------------
[EMAIL PROTECTED] kanda]$ snmpget -v2c -c motro localhost myScalar.0
MY-MIB::myScalar.0 = STRING: 12408-48-55,67:56:48.53,197:48100491014810148485010048524848
------------------------------------------------------------------------------------------
       
if i change myScalar MIB definition from "SYNTAX  DateAndTime " to "SYNTAX  DisplayString"
and if i send "1992-5-26,13:30:15.0,-4:0" to snmp_set_var_typed_value(), i am getting the
same string what i had passed.

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

In mib2c code, i am getting variable->type as "ASN_OCTET_STR", wheather myScalar SYNTAX is
DisplayString or DateAndTime. How i can differenciate this displayString and dateAndTime in
mib2c code, Since you are telling for dateAndTime, i have to give hexa format string for
dateAndTime type scalars.


Regards
Kanda,

-----Original Message-----
From: David T. Perkins [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 27, 2005 4:01 AM
To: Siddesh P R (WT01 - Broadband Networks)
Cc: [email protected]
Subject: Re: timestamp issue

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


Reply via email to