Don't allocate context struct until/unless heuristic signature string matches.
authormartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 2 Nov 2010 15:17:58 +0000 (15:17 +0000)
committermartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 2 Nov 2010 15:17:58 +0000 (15:17 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34752 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-pdcp-lte.c
epan/dissectors/packet-rlc-lte.c

index 1846f672d7a09cae27ec2225731e4424b24ebe4e..6cebc3da1518e6c4c8fa9b01c4a1260bbe49002c 100644 (file)
@@ -264,6 +264,9 @@ static dissector_handle_t ip_handle;
 static gboolean global_pdcp_show_feedback_option_tag_length = FALSE;
 static gboolean global_pdcp_dissect_user_plane_as_ip = FALSE;
 static gboolean global_pdcp_dissect_signalling_plane_as_rrc = FALSE;
+#if 0
+static gboolean global_pdcp_check_missing_sequence_numbers = FALSE;
+#endif
 static gboolean global_pdcp_dissect_rohc = FALSE;
 
 /* Dissect a Large-CID field.
@@ -1390,17 +1393,6 @@ static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
         return FALSE;
     }
 
-    /* If redissecting, use previous info struct (if available) */
-    p_pdcp_lte_info = p_get_proto_data(pinfo->fd, proto_pdcp_lte);
-    if (p_pdcp_lte_info == NULL) {
-        /* Allocate new info struct for this frame */
-        p_pdcp_lte_info = se_alloc0(sizeof(struct pdcp_lte_info));
-        infoAlreadySet = FALSE;
-    }
-    else {
-        infoAlreadySet = TRUE;
-    }
-
     /* Do this again on re-dissection to re-discover offset of actual PDU */
 
     /* Needs to be at least as long as:
@@ -1418,6 +1410,19 @@ static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
     }
     offset += (gint)strlen(PDCP_LTE_START_STRING);
 
+
+    /* If redissecting, use previous info struct (if available) */
+    p_pdcp_lte_info = p_get_proto_data(pinfo->fd, proto_pdcp_lte);
+    if (p_pdcp_lte_info == NULL) {
+        /* Allocate new info struct for this frame */
+        p_pdcp_lte_info = se_alloc0(sizeof(struct pdcp_lte_info));
+        infoAlreadySet = FALSE;
+    }
+    else {
+        infoAlreadySet = TRUE;
+    }
+
+
     /* Read fixed fields */
     p_pdcp_lte_info->no_header_pdu = tvb_get_guint8(tvb, offset++);
     p_pdcp_lte_info->plane = tvb_get_guint8(tvb, offset++);
@@ -2549,6 +2554,14 @@ void proto_register_pdcp(void)
         "Show unciphered Signalling-Plane data as RRC",
         &global_pdcp_dissect_signalling_plane_as_rrc);
 
+#if 0
+    /* Check for missing sequence numbers */
+    prefs_register_bool_preference(pdcp_lte_module, "check_sequence_numbers",
+        "Check for missing sequence numbers",
+        "Check for missing sequence numbers",
+        &global_pdcp_check_missing_sequence_numbers);
+#endif
+
     /* Attempt to dissect ROHC headers */
     prefs_register_bool_preference(pdcp_lte_module, "dissect_rohc",
         "Attempt to decode ROHC data",
index 2138390d3b8d2956c0fe971a4485eb55ab71c03a..066c792c830ee730eddd5b3509bda6563539e93d 100644 (file)
@@ -45,7 +45,7 @@
  */
 
 /* TODO:
-   - AM re-assembly?
+   - UM & AM re-assembly?
 */
 
 /********************************/
@@ -1815,17 +1815,6 @@ static gboolean dissect_rlc_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
         return FALSE;
     }
 
-    /* If redissecting, use previous info struct (if available) */
-    p_rlc_lte_info = p_get_proto_data(pinfo->fd, proto_rlc_lte);
-    if (p_rlc_lte_info == NULL) {
-        /* Allocate new info struct for this frame */
-        p_rlc_lte_info = se_alloc0(sizeof(struct rlc_lte_info));
-        infoAlreadySet = FALSE;
-    }
-    else {
-        infoAlreadySet = TRUE;
-    }
-
     /* Do this again on re-dissection to re-discover offset of actual PDU */
 
     /* Needs to be at least as long as:
@@ -1843,6 +1832,19 @@ static gboolean dissect_rlc_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
     }
     offset += (gint)strlen(RLC_LTE_START_STRING);
 
+
+    /* If redissecting, use previous info struct (if available) */
+    p_rlc_lte_info = p_get_proto_data(pinfo->fd, proto_rlc_lte);
+    if (p_rlc_lte_info == NULL) {
+        /* Allocate new info struct for this frame */
+        p_rlc_lte_info = se_alloc0(sizeof(struct rlc_lte_info));
+        infoAlreadySet = FALSE;
+    }
+    else {
+        infoAlreadySet = TRUE;
+    }
+
+
     /* Read fixed fields */
     p_rlc_lte_info->rlcMode = tvb_get_guint8(tvb, offset++);