From Mike Morrin:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 22 Nov 2010 20:24:12 +0000 (20:24 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 22 Nov 2010 20:24:12 +0000 (20:24 +0000)
In bssmap, track L3 handover target (GSM or UMTS) between PDUs
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5294

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35009 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-gsm_a_bssmap.c
epan/dissectors/packet-sccp.h

index 56b086bfe8e2ac852699f62b2c1f348985dca6bf..2d6e83aceac4979d6de466a49b13e0666602f4c3 100644 (file)
@@ -1855,22 +1855,29 @@ be_l3_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *ad
        as defined in 3GPP TS 44.018. */
 
     /* note that we can't (from this PDU alone) determine whether a handover is to UMTS or cdma2000
-       for now we will always assume (GSM or) UMTS.
-       Maybe if cdma2000 support is added later, a preference option would select dissection of cdma2000 or UMTS. */
-    if (cell_discriminator < 8) {
+       Maybe if cdma2000 support is added later, a preference option would select dissection of cdma2000 or UMTS.
+       If SCCP trace is enabled (and the cell discriminator has correctly appeared in an earlier PDU)
+       then we will have remembered the discriminator */
+    if ( cell_discriminator == 0xFF)
+    {
+        proto_tree_add_text(tree, l3_tvb, curr_offset, len, "Cell Discriminator not initialised, try enabling the SCCP protocol option [Trace Associations], \n or maybe the file does not contain the PDUs needed for SCCP trace");
+    }
+    else if ((cell_discriminator & 0x0f) < 8) {
         /* GSM */
         call_dissector(dtap_handle, l3_tvb, g_pinfo, g_tree);
     }
-    else if (cell_discriminator < 13) {
+    else if ((cell_discriminator & 0x0f) < 13) {
+  
+        /* UMTS or CDMA 2000 */
         dissect_rrc_HandoverToUTRANCommand_PDU(l3_tvb, g_pinfo, g_tree);
     }
-
+    else{
+        proto_tree_add_text(tree, l3_tvb, curr_offset, len, "Unrecognised Cell Discriminator %x",cell_discriminator);
+    }
     curr_offset += len;
 
     EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
 
-    cell_discriminator = 0x0f;
-
     return(curr_offset - offset);
 }
 
@@ -1955,6 +1962,7 @@ be_cell_id_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gcha
     proto_tree_add_bits_item(tree, hf_gsm_a_bssmap_spare_bits, tvb, curr_offset<<3, 4, FALSE);
 
     disc = oct & 0x0f;
+    cell_discriminator = disc; /* may be required later */
     proto_tree_add_item(tree, hf_gsm_a_bssmap_be_cell_id_disc, tvb, curr_offset, 1, FALSE);
     curr_offset++;
 
@@ -6282,10 +6290,7 @@ dissect_bssmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
         bssmap_tree = proto_item_add_subtree(bssmap_item, ett_gsm_bssmap_msg[idx]);
 
-        if (check_col(pinfo->cinfo, COL_INFO))
-        {
-            col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", str);
-        }
+        col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", str);
 
         /*
          * add BSSMAP message name
@@ -6306,15 +6311,20 @@ dissect_bssmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /*
      * decode elements
      */
-    if (idx < 0 || bssmap_msg_fcn[idx] == NULL)
-    {
+    if (idx < 0 || bssmap_msg_fcn[idx] == NULL){
         proto_tree_add_text(bssmap_tree,
             tvb, offset, len - offset,
             "Message Elements");
-    }
-    else
-    {
+    }else{
+        if (sccp_msg_p && ((sccp_msg_p->data.co.assoc->app_info & 0xCD00) == 0xCD00)){
+            cell_discriminator = sccp_msg_p->data.co.assoc->app_info & 0xFF;
+        }else{
+            cell_discriminator = 0xFF;
+        }
         (*bssmap_msg_fcn[idx])(tvb, bssmap_tree, offset, len - offset);
+        if (sccp_msg_p){
+            sccp_msg_p->data.co.assoc->app_info = cell_discriminator | 0xCDF0;
+        }
     }
     g_pinfo = NULL;
     g_tree = NULL;
index ba736038e3b2992670570f5e20a4e2580c838bc2..2d79749988e9e8f4324dadf2dc6cd01df8a85add 100644 (file)
@@ -101,6 +101,7 @@ typedef struct _sccp_assoc_info_t {
     gchar* calling_party;
     gchar* called_party;
     gchar* extra_info;
+    guint32 app_info;  /* used only by dissectors of protocols above SCCP */
 
 } sccp_assoc_info_t;