Problem in receiving a DateAndTime type object in notification

"Wang, John" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
 

Hi,

 

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

 

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,

 
notificationEventTime_oid,

 
OID_LENGTH(notificationEventTime_oid),

                                                   ASN_OCTET_STR,

                                                   notif->time,

                                                   8);

 

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

 

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.

 

However, if the hours = 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.

 

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

 

I'll appreciate any help.

 

John Wang

-------------------------------------------------------------------------
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/

_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.