summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-mac-lte.c6
-rw-r--r--epan/dissectors/packet-mac-lte.h4
-rw-r--r--gtk/mac_lte_stat_dlg.c20
3 files changed, 26 insertions, 4 deletions
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index da09fc9aaf..688fe6f842 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -1635,6 +1635,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
p_mac_lte_info->subframeNumber,
p_mac_lte_info->ueid);
+ tap_info->raw_length = p_mac_lte_info->length;
/* For downlink frames, can try to work out if this looks like a HARQ resend */
if ((direction == DIRECTION_DOWNLINK) && global_mac_lte_attempt_dl_harq_resend_detect) {
@@ -1979,6 +1980,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
break;
case PADDING_LCID:
/* No payload (in this position) */
+ tap_info->padding_bytes++;
break;
default:
@@ -2142,6 +2144,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
break;
case PADDING_LCID:
/* No payload, in this position */
+ tap_info->padding_bytes++;
break;
default:
@@ -2347,6 +2350,9 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
p_mac_lte_info->length - offset);
PROTO_ITEM_SET_GENERATED(padding_length_ti);
+ /* Update padding bytes in stats */
+ tap_info->padding_bytes += (p_mac_lte_info->length - offset);
+
/* Make sure the PDU isn't bigger than reported! */
if (offset > p_mac_lte_info->length) {
expert_add_info_format(pinfo, padding_length_ti, PI_MALFORMED, PI_ERROR,
diff --git a/epan/dissectors/packet-mac-lte.h b/epan/dissectors/packet-mac-lte.h
index 99cbf7f260..d789372ae4 100644
--- a/epan/dissectors/packet-mac-lte.h
+++ b/epan/dissectors/packet-mac-lte.h
@@ -111,6 +111,10 @@ typedef struct mac_lte_tap_info {
guint32 bytes_for_lcid[11];
guint32 sdus_for_lcid[11];
guint8 number_of_rars;
+
+ /* Number of padding bytes includes padding subheaders and trailing padding */
+ guint16 padding_bytes;
+ guint16 raw_length;
} mac_lte_tap_info;
diff --git a/gtk/mac_lte_stat_dlg.c b/gtk/mac_lte_stat_dlg.c
index 800a5a5451..f147d28834 100644
--- a/gtk/mac_lte_stat_dlg.c
+++ b/gtk/mac_lte_stat_dlg.c
@@ -65,6 +65,7 @@ enum {
RNTI_TYPE_COLUMN,
UL_FRAMES_COLUMN,
UL_BYTES_COLUMN,
+ UL_PADDING_PERCENT_COLUMN,
UL_CRC_ERRORS_COLUMN,
UL_RETX_FRAMES_COLUMN,
DL_FRAMES_COLUMN,
@@ -92,8 +93,8 @@ enum {
};
static const gchar *ue_titles[] = { "RNTI", "Type",
- "UL Frames", "UL Bytes", "UL CRC Errors", "UL ReTX Frames",
- "DL Frames", "DL Bytes", "DL CRC Errors", "DL ReTX Frames"};
+ "UL Frames", "UL Bytes", "UL Padding %", "UL CRC Errors", "UL ReTX Frames",
+ "DL Frames", "DL Bytes", "DL CRC Errors", "DL ReTX Frames"};
static const gchar *channel_titles[] = { "CCCH",
"LCID 1", "LCID 2", "LCID 3", "LCID 4", "LCID 5",
@@ -110,7 +111,9 @@ typedef struct mac_lte_row_data {
gboolean is_predefined_data;
guint32 UL_frames;
- guint32 UL_total_bytes;
+ guint32 UL_raw_bytes; /* all bytes */
+ guint32 UL_total_bytes; /* payload */
+ guint32 UL_padding_bytes;
guint32 UL_CRC_errors;
guint32 UL_retx_frames;
@@ -238,6 +241,8 @@ static mac_lte_ep_t* alloc_mac_lte_ep(struct mac_lte_tap_info *si, packet_info *
ep->stats.UL_frames = 0;
ep->stats.DL_frames = 0;
ep->stats.UL_total_bytes = 0;
+ ep->stats.UL_raw_bytes = 0;
+ ep->stats.UL_padding_bytes = 0;
ep->stats.DL_total_bytes = 0;
ep->stats.UL_CRC_errors = 0;
ep->stats.DL_CRC_errors = 0;
@@ -358,6 +363,9 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
}
te->stats.UL_frames++;
+ te->stats.UL_raw_bytes += si->raw_length;
+ te->stats.UL_padding_bytes += si->padding_bytes;
+
if (si->isPredefinedData) {
te->stats.UL_total_bytes += si->single_number_of_bytes;
}
@@ -545,6 +553,10 @@ mac_lte_stat_draw(void *phs)
(tmp->stats.rnti_type == C_RNTI) ? "C-RNTI" : "SPS-RNTI",
UL_FRAMES_COLUMN, tmp->stats.UL_frames,
UL_BYTES_COLUMN, tmp->stats.UL_total_bytes,
+ UL_PADDING_PERCENT_COLUMN,
+ tmp->stats.UL_total_bytes ?
+ (((float)tmp->stats.UL_padding_bytes / (float)tmp->stats.UL_raw_bytes) * 100.0) :
+ 0.0,
UL_CRC_ERRORS_COLUMN, tmp->stats.UL_CRC_errors,
UL_RETX_FRAMES_COLUMN, tmp->stats.UL_retx_frames,
DL_FRAMES_COLUMN, tmp->stats.DL_frames,
@@ -710,7 +722,7 @@ static void mac_lte_stat_dlg_create(void)
/* Create the table of UE data */
store = gtk_list_store_new(NUM_UE_COLUMNS, G_TYPE_INT, G_TYPE_STRING,
- G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, /* UL */
+ G_TYPE_INT, G_TYPE_INT, G_TYPE_FLOAT, G_TYPE_INT, G_TYPE_INT, /* UL */
G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, /* DL */
G_TYPE_POINTER);
hs->ue_table = GTK_TREE_VIEW(tree_view_new(GTK_TREE_MODEL(store)));