Work out better whether RLC segment is a complete upper-layer PDU or not.
[obnox/wireshark/wip.git] / epan / dissectors / packet-rlc-lte.c
index 194d369f0d8fe48beaad346938cc87654c2023cb..23584f299d4ea429aa02aa3dd533a59b8780af09 100644 (file)
@@ -315,7 +315,7 @@ static GHashTable *rlc_lte_sequence_analysis_channel_hash = NULL;
 /* Types for sequence analysis frame report hash table                  */
 /* This is a table from framenum -> state_report_in_frame               */
 /* This is necessary because the per-packet info is already being used  */
-/* for conext information before the dissector is called                */
+/* for context information before the dissector is called               */
 
 /* Info to attach to frame when first read, recording what to show about sequence */
 typedef struct
@@ -389,7 +389,7 @@ static void write_pdu_label_and_info(proto_item *pdu_ti, proto_item *sub_ti,
 
 
 /* Dissect extension headers (common to both UM and AM) */
-static int dissect_rlc_lte_extension_header(tvbuff_t *tvb, packet_info *pinfo,
+static int dissect_rlc_lte_extension_header(tvbuff_t *tvb, packet_info *pinfo _U_,
                                             proto_tree *tree,
                                             int offset)
 {
@@ -448,10 +448,6 @@ static int dissect_rlc_lte_extension_header(tvbuff_t *tvb, packet_info *pinfo,
         padding = tvb_get_guint8(tvb, offset) & 0x0f;
         ti = proto_tree_add_item(tree, hf_rlc_lte_extension_padding,
                                  tvb, offset, 1, FALSE);
-        if (padding != 0) {
-            expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
-                      "Extension Header padding not zero (found 0x%x)", padding);
-        }
         offset++;
     }
 
@@ -1119,9 +1115,9 @@ static void dissect_rlc_lte_tm(tvbuff_t *tvb, packet_info *pinfo,
 
             case CHANNEL_TYPE_SRB:
             case CHANNEL_TYPE_DRB:
+
             default:
-                /* Shouldn't happen, just return...
-                   TODO: should flag an error? */
+                /* Shouldn't happen, just return... */
                 return;
         }
 
@@ -1438,7 +1434,8 @@ static void dissect_rlc_lte_am_status_pdu(tvbuff_t *tvb,
     offset = (bit_offset+7) / 8;
     if (tvb_length_remaining(tvb, offset) > 0) {
         expert_add_info_format(pinfo, status_ti, PI_MALFORMED, PI_ERROR,
-                               "%u bytes remaining after Status PDU complete",
+                               "%cL %u bytes remaining after Status PDU complete",
+                               (p_rlc_lte_info->direction == DIRECTION_UPLINK) ? 'U' : 'D',
                                tvb_length_remaining(tvb, offset));
     }
 
@@ -1611,7 +1608,7 @@ static void dissect_rlc_lte_am(tvbuff_t *tvb, packet_info *pinfo,
         int n;
         for (n=0; n < s_number_of_extensions; n++) {
             show_AM_PDU_in_tree(pinfo, tree, tvb, offset, s_lengths[n], p_rlc_lte_info,
-                                first_includes_start && last_includes_end);
+                                (n==0) ? first_includes_start : TRUE);
             show_PDU_in_info(pinfo, top_ti, s_lengths[n],
                              (n==0) ? first_includes_start : TRUE,
                              TRUE);
@@ -1623,7 +1620,7 @@ static void dissect_rlc_lte_am(tvbuff_t *tvb, packet_info *pinfo,
     /* Final data element */
     if (tvb_length_remaining(tvb, offset) > 0) {
         show_AM_PDU_in_tree(pinfo, tree, tvb, offset, -1, p_rlc_lte_info,
-                            first_includes_start && last_includes_end);
+                            ((s_number_of_extensions == 0) ? first_includes_start : TRUE) && last_includes_end);
         show_PDU_in_info(pinfo, top_ti, (guint16)tvb_length_remaining(tvb, offset),
                          (s_number_of_extensions == 0) ? first_includes_start : TRUE,
                          last_includes_end);
@@ -2186,7 +2183,7 @@ void proto_register_rlc_lte(void)
         { &hf_rlc_lte_am_ack_sn,
             { "ACK Sequence Number",
               "rlc-lte.am.ack-sn", FT_UINT16, BASE_DEC, 0, 0x0,
-              "Sequence Number we're next expecting to receive", HFILL
+              "Sequence Number we expect to receive next", HFILL
             }
         },
         { &hf_rlc_lte_am_e1,