This is a multi-part message in MIME format.

--===============0639730478==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C8830F.C8858B92"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C8830F.C8858B92
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

=20

Hi,

=20

I'm using Release 5.3.1; and got a problem in receiving notifications
which includes a DateAndTime type object.=20

=20

The routine send_v2trap(var_list) is called. To build the var_list, the
snmp_varlist_add_variable( ) is called as below:

snmp_varlist_add_variable(&var_list,

=20
notificationEventTime_oid,

=20
OID_LENGTH(notificationEventTime_oid),

ASN_OCTET_STR,

notif->time,

8);

=20

The notf->time is define as char time[12].

=20

It works fine when the hours and minutes are non-zero values. For
example, when notif->time is assigned 0x07, 0xd8, 0x03, 0x0a, 0x0c,
0x0e, 0x0a, 0x0, the notificationEventTime in the notification message
received by manager (MG-SOFT) is: 2008-3-10,12:14:10.0. It's coorect.

=20

However, if the hours =3D 0, {0x07, 0xd8, 0x03, 0x0a, 0x0, 0x0e, 0x0a,
0x0} then the notificationEventTime in the notification message received
by the manager becomes: 2008-3-10,0:0:0.0; i.e., the minutes and seconds
incorrectly become 0, Similar situation happens to the minutes: if
minutes is 0, the seconds incorrectly becomes 0.

=20

I used Ethereal to capture the data, it's the same as MG-SOFT got.

=20

I'll appreciate any help.

=20

John Wang =20

=20

=20


------_=_NextPart_001_01C8830F.C8858B92
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

=3D"urn:schemas-microsoft-comfficeffice" =
xmlns:w=3D"urn:schemas-microsoft-comffice:word" =
xmlns:x=3D"urn:schemas-microsoft-comffice:excel" =
xmlns=3D"http://www.w3.org/TR/REC-html40">


charset=3Dus-ascii">









face=3D"Times New Roman"> style=3D'font-size:12.0pt'>>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>Hi,>>=



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>I’m using Release =
5.3.1; and
got a problem in receiving notifications which includes a DateAndTime =
type
object. >>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>The routine =
send_v2trap(var_list) is
called. To build the var_list, the snmp_varlist_add_variable( ) is =
called as
below:>>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>    &nbs=
p;      
snmp_varlist_add_variable(&var_list,>>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>    &nbs=
p;           &nbsp=
;            =

            &=
nbsp;    
   notificationEventTime_oid,>>

=


face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>    &nbs=
p;           &nbsp=
;    
            &=
nbsp;           &n=
bsp;    OID_LENGTH(notificationEventTime_oid),> o>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>    &nbs=
p;           &nbsp=
;            =

            &=
nbsp;        ASN_OCTET_STR,><=
/o>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>    &nbs=
p;           &nbsp=
;   
            &=
nbsp;           &n=
bsp;     notif->time,>>
>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>    &nbs=
p;           &nbsp=
;           
            &=
nbsp;         8);>>=



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>The notf->time is define =
as char
time[12].>>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>It works fine when the =
hours and
minutes are non-zero values. For example, when notif->time is =
assigned 0x07,
0xd8, 0x03, 0x0a, 0x0c, 0x0e, 0x0a, 0x0, the notificationEventTime in =
the
notification message received by manager (MG-SOFT) is: =
2008-3-10,12:14:10.0.
It’s coorect.>>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>However, if the hours =3D =
0, {0x07,
0xd8, 0x03, 0x0a, 0x0, 0x0e, 0x0a, 0x0} then the notificationEventTime =
in the
notification message received by the manager becomes: 2008-3-10,0:0:0.0; =
i.e.,
the minutes and seconds incorrectly become 0, Similar situation happens =
to the
minutes: if minutes is 0, the seconds incorrectly becomes =
0.>>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>I used Ethereal to capture =
the data,
it’s the same as MG-SOFT got.>>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>I’ll appreciate any =
help.>>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>John Wang =
 >>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>



face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'>> nt>









------_=_NextPart_001_01C8830F.C8858B92--


--===============0639730478==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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/
--===============0639730478==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users

--===============0639730478==--