Ethereal-dev: [Ethereal-dev] Patch for packet-gsm_sms.c : Human readable Timezone, TP-UDHI fi

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Victor Stratan <hidralisk@xxxxxxxxx>
Date: Sat, 11 Dec 2004 08:35:27 -0800 (PST)
Hello,

Fix 1:
Made Timezone view human readable based on
3GPP TS 23.040 V6.5.0
9.2.3.11

Fix 2:
TP-UDHI field - located within bit no 6
one more place was left over from previous
patch by Viorel Suman made on 9 Dec 2004

=====
Live long and prosper,
  Vik


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250
--- ethereal-2004-12-11/epan/dissectors/packet-gsm_sms.c	2004-12-10 13:20:48.000000000 +0200
+++ ethereal-2004-12-11-new/epan/dissectors/packet-gsm_sms.c	2004-12-11 18:22:03.109261451 +0200
@@ -730,6 +730,7 @@
 dis_field_scts_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset)
 {
     guint8	oct, oct2, oct3;
+    char sign;
 
 
     oct = tvb_get_guint8(tvb, offset);
@@ -766,10 +767,13 @@
 
     oct = tvb_get_guint8(tvb, offset);
 
+    sign = (oct & 0x08)?'-':'+';
+    oct = ((oct >> 4) + (oct & 0x07) * 10) * 15;
+
     proto_tree_add_text(tree,
 	tvb, offset, 1,
-	"Timezone %d",
-	oct);
+	"Timezone: GMT %c %d hours %d minutes",
+	sign, oct / 60, oct % 60);
 }
 
 /* 9.2.3.11 */
@@ -2415,9 +2419,9 @@
 
     oct = tvb_get_guint8(tvb, offset);
 
-    DIS_FIELD_SRR(tree, 0x20, offset);
+    DIS_FIELD_UDHI(tree, 0x40, offset, udhi);
 
-    DIS_FIELD_UDHI(tree, 0x04, offset, udhi);
+    DIS_FIELD_SRR(tree, 0x20, offset);
 
     DIS_FIELD_MTI(tree, 0x03, offset);