Add entry for TPDU in the tree
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 26 Feb 2012 17:10:40 +0000 (17:10 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 26 Feb 2012 17:10:40 +0000 (17:10 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@41194 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-gtp.c

index ea8ec34..69d4979 100644 (file)
@@ -13,7 +13,7 @@
  * Copyright 2011, Grzegorz Szczytowski <grzegorz.szczytowski@gmail.com>
  *
  * Updates and corrections:
- * Copyright 2011, Anders Broman <anders.broman@ericsson.com>
+ * Copyright 2011-2012, Anders Broman <anders.broman@ericsson.com>
  *
  * PDCP PDU number extension header support added by Martin Isaksson <martin.isaksson@ericsson.com>
  *
@@ -7096,6 +7096,7 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
                } else
                        offset = 20;
 
+               proto_tree_add_text(tree, tvb, offset, gtp_hdr.length, "T-PDU Data %u bytes", gtp_hdr.length);
                /* Can only handle one extension header type... */
                if (noOfExtHdrs != 0) offset+= 1 + noOfExtHdrs*4;
 
@@ -7131,6 +7132,19 @@ static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
 
                col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "GTP <");
                col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
+       }else{
+               if (gtp_prime)
+                       offset = 6;
+               else if (gtp_version == 1) {
+                       if (gtp_hdr.flags & 0x07) {
+                               offset = 11;
+                               if (tvb_get_guint8(tvb, offset) == 0)
+                                       offset++;
+                       } else
+                               offset = 8;
+               } else
+                       offset = 20;
+               proto_tree_add_text(tree, tvb, offset, gtp_hdr.length, "T-PDU Data %u bytes", gtp_hdr.length);
        }
        pinfo->private_data = pd_save;
 }