From 5d23935519c9063c1dd58ab6f54511f19e19f86a Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 15 Oct 2001 03:54:05 +0000 Subject: Fixes from Steffen Weinreich: fix the processing of the month and year fields in the SCTC Timestamp (the month is 1-origin, so subtract 1 from it before putting it in "tm_mon", which is 0-origin; the year is a 2-digit field that is, at least, Y2K-safe (but Y2.1K-unsafe), so if it's less than 90, assume it's in the 21st century); UCP OT 50-57 messages have a fixed number of fields and a special handling of the MT is not necessary, so get rid of that. Also, fix a typo in a comment. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4030 f5534014-38df-0310-8fa8-9805f1628bb7 --- packet-ucp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'packet-ucp.c') diff --git a/packet-ucp.c b/packet-ucp.c index 6a841fbd29..21ab8683fd 100644 --- a/packet-ucp.c +++ b/packet-ucp.c @@ -2,7 +2,7 @@ * Routines for Universal Computer Protocol dissection * Copyright 2001, Tom Uijldert * - * $Id: packet-ucp.c,v 1.3 2001/10/08 17:42:18 guy Exp $ + * $Id: packet-ucp.c,v 1.4 2001/10/15 03:54:04 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -670,8 +670,10 @@ ucp_mktime(char *datestr) struct tm r_time; r_time.tm_mday = 10 * (datestr[0] - '0') + (datestr[1] - '0'); - r_time.tm_mon = 10 * (datestr[2] - '0') + (datestr[3] - '0'); + r_time.tm_mon = (10 * (datestr[2] - '0') + (datestr[3] - '0')) - 1; r_time.tm_year = 10 * (datestr[4] - '0') + (datestr[5] - '0'); + if (r_time.tm_year < 90) + r_time.tm_year += 100; r_time.tm_hour = 10 * (datestr[6] - '0') + (datestr[7] - '0'); r_time.tm_min = 10 * (datestr[8] - '0') + (datestr[9] - '0'); if (datestr[10]) @@ -680,7 +682,7 @@ ucp_mktime(char *datestr) } /*! - * Scanning rouines to add standard types (byte, int, string, data) + * Scanning routines to add standard types (byte, int, string, data) * to the protocol-tree. Each field is seperated with a slash ('/'). * * \param tree The protocol tree to add to @@ -1446,7 +1448,9 @@ add_5xO(proto_tree *tree, tvbuff_t *tvb) UcpHandleByte(hf_ucp_parm_Dst); UcpHandleInt(hf_ucp_parm_Rsn); UcpHandleTime(hf_ucp_parm_DSCTS); - ucp_handle_mt(tree, tvb, &offset); + UcpHandleByte(hf_ucp_parm_MT); + UcpHandleString(hf_ucp_parm_NB); + UcpHandleData(hf_ucp_data_section); UcpHandleByte(hf_ucp_parm_MMS); UcpHandleByte(hf_ucp_parm_PR); UcpHandleByte(hf_ucp_parm_DCs); -- cgit v1.2.3