aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-mac-lte.c104
-rw-r--r--epan/dissectors/packet-pdcp-lte.c163
-rw-r--r--epan/dissectors/packet-rlc-lte.c99
3 files changed, 122 insertions, 244 deletions
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 9864a6fa61..6b05abfd5d 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -40,8 +40,8 @@
/* TODO:
- - more testing of control bodies
- - TDD mode
+ - TDD mode?
+ - compare Msg3 with contention resolution body
- add a preference so that padding can be verified against an expected pattern?
*/
@@ -568,10 +568,8 @@ static gint dissect_rar_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_item_append_text(rar_body_ti, " RAPID=%u (TA=%u, UL-Grant=%u, Temp C-RNTI=%u)",
rapid, timing_advance, ul_grant, temp_crnti);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (RAPID=%u: TA=%u, UL-Grant=%u, Temp C-RNTI=%u)",
- rapid, timing_advance, ul_grant, temp_crnti);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (RAPID=%u: TA=%u, UL-Grant=%u, Temp C-RNTI=%u)",
+ rapid, timing_advance, ul_grant, temp_crnti);
proto_item_set_len(rar_body_ti, offset-start_body_offset);
@@ -593,10 +591,8 @@ static void dissect_rar(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *rar_headers_ti;
int start_headers_offset = offset;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "RAR (RA-RNTI=%u, SF=%u)",
- p_mac_lte_info->rnti, p_mac_lte_info->subframeNumber);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "RAR (RA-RNTI=%u, SF=%u)",
+ p_mac_lte_info->rnti, p_mac_lte_info->subframeNumber);
/* Create hidden 'virtual root' so can filter on mac-lte.rar */
ti = proto_tree_add_item(tree, hf_mac_lte_rar, tvb, offset, -1, FALSE);
@@ -661,10 +657,8 @@ static void dissect_rar(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item_append_text(rar_header_ti, " (Backoff Indicator=%sms)",
val_to_str(backoff_indicator, rar_bi_vals, "Illegal value"));
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (Backoff Indicator=%sms)",
- val_to_str(backoff_indicator, rar_bi_vals, "Illegal value"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (Backoff Indicator=%sms)",
+ val_to_str(backoff_indicator, rar_bi_vals, "Illegal value"));
if (number_of_rars > 0) {
expert_add_info_format(pinfo, bi_ti, PI_MALFORMED, PI_WARN,
"Backoff Indicator should only appear as first subheader");
@@ -721,13 +715,11 @@ static void dissect_bch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
proto_item *ti;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "BCH PDU (%u bytes, on %s transport) ",
- tvb_length_remaining(tvb, offset),
- val_to_str(p_mac_lte_info->rntiType,
- bch_transport_channel_vals,
- "Unknown"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "BCH PDU (%u bytes, on %s transport) ",
+ tvb_length_remaining(tvb, offset),
+ val_to_str(p_mac_lte_info->rntiType,
+ bch_transport_channel_vals,
+ "Unknown"));
/* Show which transport layer it came in on (inferred from RNTI type) */
ti = proto_tree_add_uint(tree, hf_mac_lte_context_bch_transport_channel,
@@ -782,10 +774,8 @@ static void dissect_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
proto_item *ti;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "PCH PDU (%u bytes) ",
- tvb_length_remaining(tvb, offset));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "PCH PDU (%u bytes) ",
+ tvb_length_remaining(tvb, offset));
/****************************************/
/* Whole frame is PCH data */
@@ -888,11 +878,9 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
gboolean have_seen_bsr = FALSE;
gboolean expecting_body_data = FALSE;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s: (SF=%u) ",
- (direction == DIRECTION_UPLINK) ? "UL-SCH" : "DL-SCH",
- p_mac_lte_info->subframeNumber);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s: (SF=%u) ",
+ (direction == DIRECTION_UPLINK) ? "UL-SCH" : "DL-SCH",
+ p_mac_lte_info->subframeNumber);
/* Add PDU block header subtree */
pdu_header_ti = proto_tree_add_string_format(tree,
@@ -948,20 +936,16 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (direction == DIRECTION_UPLINK) {
lcid_ti = proto_tree_add_item(pdu_subheader_tree, hf_mac_lte_ulsch_lcid,
tvb, offset, 1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s",
- val_to_str(lcids[number_of_headers],
- ulsch_lcid_vals, "(Unknown LCID)"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s",
+ val_to_str(lcids[number_of_headers],
+ ulsch_lcid_vals, "(Unknown LCID)"));
}
else {
lcid_ti = proto_tree_add_item(pdu_subheader_tree, hf_mac_lte_dlsch_lcid,
tvb, offset, 1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s",
- val_to_str(lcids[number_of_headers],
- dlsch_lcid_vals, "(Unknown LCID)"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s",
+ val_to_str(lcids[number_of_headers],
+ dlsch_lcid_vals, "(Unknown LCID)"));
}
offset++;
@@ -1034,19 +1018,17 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* Close off description in info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- switch (pdu_lengths[number_of_headers]) {
- case 0:
- col_append_str(pinfo->cinfo, COL_INFO, ") ");
- break;
- case -1:
- col_append_str(pinfo->cinfo, COL_INFO, ":remainder) ");
- break;
- default:
- col_append_fstr(pinfo->cinfo, COL_INFO, ":%u bytes) ",
- pdu_lengths[number_of_headers]);
- break;
- }
+ switch (pdu_lengths[number_of_headers]) {
+ case 0:
+ col_append_str(pinfo->cinfo, COL_INFO, ") ");
+ break;
+ case -1:
+ col_append_str(pinfo->cinfo, COL_INFO, ":remainder) ");
+ break;
+ default:
+ col_append_fstr(pinfo->cinfo, COL_INFO, ":%u bytes) ",
+ pdu_lengths[number_of_headers]);
+ break;
}
/* Append summary to subheader root */
@@ -1343,9 +1325,7 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
memset(&tap_info, 0, sizeof(mac_lte_tap_info));
/* Set protocol name */
- if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC-LTE");
- }
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC-LTE");
/* Create protocol tree. */
ti = proto_tree_add_item(tree, proto_mac_lte, tvb, offset, -1, FALSE);
@@ -1365,9 +1345,7 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Clear info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_clear(pinfo->cinfo, COL_INFO);
- }
+ col_clear(pinfo->cinfo, COL_INFO);
/*****************************************/
@@ -1433,9 +1411,7 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (p_mac_lte_info->crcStatus != TRUE) {
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
"Frame has CRC error");
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "<CRC FAILURE>");
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "<CRC FAILURE>");
}
}
@@ -1455,9 +1431,7 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* If we know its predefined data, don't try to decode any further */
if (p_mac_lte_info->isPredefinedData) {
proto_tree_add_item(mac_lte_tree, hf_mac_lte_predefined_pdu, tvb, offset, -1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "Predefined data (%u bytes)", tvb_length_remaining(tvb, offset));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "Predefined data (%u bytes)", tvb_length_remaining(tvb, offset));
/* Queue tap info */
if (!pinfo->in_error_pkt) {
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index 8e90b62d58..e0707f543f 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -469,9 +469,7 @@ static int dissect_pdcp_irdyn_packet(proto_tree *tree _U_,
struct pdcp_lte_info *p_pdcp_info _U_,
packet_info *pinfo)
{
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " IRDYN");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " IRDYN");
proto_item_append_text(root_item, " (IRDYN)");
/* Large CID */
@@ -507,9 +505,7 @@ static int dissect_pdcp_ir_packet(proto_tree *tree,
{
unsigned char dynamic_chain_present;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " IR");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " IR");
proto_item_append_text(root_item, " (IR)");
/* Is dynamic chain present? */
@@ -652,9 +648,7 @@ static int dissect_pdcp_feedback_feedback1(proto_tree *tree,
proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_feedback1, tvb, offset, 1, FALSE);
offset++;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
return offset;
}
@@ -699,22 +693,18 @@ static int dissect_pdcp_feedback_feedback2(proto_tree *tree,
proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_mode, tvb, offset, 1, FALSE);
/* Show ACK-TYPE(Mode) in info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- full_mode_name = val_to_str(mode, rohc_mode_vals, "Error");
+ full_mode_name = val_to_str(mode, rohc_mode_vals, "Error");
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%c)",
- val_to_str(ack_type, feedback_ack_vals, "Unknown"),
- full_mode_name[0]);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%c)",
+ val_to_str(ack_type, feedback_ack_vals, "Unknown"),
+ full_mode_name[0]);
/* 11 bits of SN */
proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_sn, tvb, offset, 2, FALSE);
sn = tvb_get_ntohs(tvb, offset) & 0x7ff;
offset += 2;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
/* Loop over any remaining feedback options */
size_remaining = size - 2;
@@ -738,9 +728,7 @@ static int dissect_pdcp_feedback_feedback2(proto_tree *tree,
/* CRC */
one_byte_value = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_crc, tvb, offset, 1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " CRC=%u ", one_byte_value);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " CRC=%u ", one_byte_value);
break;
case 2:
/* REJECT: TODO */
@@ -752,17 +740,13 @@ static int dissect_pdcp_feedback_feedback2(proto_tree *tree,
/* SN */
one_byte_value = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_option_sn, tvb, offset, 1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " SN=%u ", one_byte_value);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " SN=%u ", one_byte_value);
break;
case 5:
/* Clock */
one_byte_value = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_pdcp_lte_rohc_feedback_option_clock, tvb, offset, 1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " Clock=%u ", one_byte_value);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Clock=%u ", one_byte_value);
break;
case 6:
/* Jitter: TODO */
@@ -800,9 +784,7 @@ static int dissect_pdcp_feedback_packet(proto_tree *tree,
proto_item *feedback_ti;
proto_tree *feedback_tree;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " Feedback");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " Feedback");
proto_item_append_text(root_item, " (Feedback)");
/* Create feedback tree root */
@@ -868,9 +850,7 @@ static int dissect_pdcp_r_0_packet(proto_tree *tree,
{
guint8 sn;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " R-0");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " R-0");
proto_item_append_text(root_item, " (R-0)");
/* 6 bits of sn */
@@ -883,9 +863,7 @@ static int dissect_pdcp_r_0_packet(proto_tree *tree,
offset = dissect_large_cid(tree, tvb, offset);
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
return offset;
}
@@ -902,9 +880,7 @@ static int dissect_pdcp_r_0_crc_packet(proto_tree *tree,
{
guint8 sn;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " R-0-CRC");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " R-0-CRC");
proto_item_append_text(root_item, " (R-0-CRC)");
proto_tree_add_item(tree, hf_pdcp_lte_rohc_r_0_crc, tvb, offset, -1, FALSE);
@@ -928,9 +904,7 @@ static int dissect_pdcp_r_0_crc_packet(proto_tree *tree,
offset++;
/* Show SN in info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
return offset;
}
@@ -947,9 +921,7 @@ static int dissect_pdcp_uo_0_packet(proto_tree *tree,
{
guint8 sn;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " U0-0");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " U0-0");
proto_item_append_text(root_item, " (UO-0)");
/* SN */
@@ -967,9 +939,7 @@ static int dissect_pdcp_uo_0_packet(proto_tree *tree,
}
/* Show SN in info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
return offset;
}
@@ -984,9 +954,7 @@ static int dissect_pdcp_r_1_packet(proto_tree *tree,
struct pdcp_lte_info *p_pdcp_info,
packet_info *pinfo)
{
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " R-1");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " R-1");
proto_item_append_text(root_item, " (R-1)");
/* TODO: octet before large-cid */
@@ -1031,15 +999,11 @@ static int dissect_pdcp_r_1_ts_or_id_packet(proto_tree *tree,
T = tvb_get_guint8(tvb, ++offset) >> 7;
proto_tree_add_item(tree, hf_pdcp_lte_rohc_type1_t, tvb, offset, 1, FALSE);
if (T) {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " R-1-TS");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " R-1-TS");
proto_item_append_text(root_item, " (R-1-TS)");
}
else {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " R-1-ID");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " R-1-ID");
proto_item_append_text(root_item, " (R-1-ID)");
}
@@ -1063,9 +1027,7 @@ static int dissect_pdcp_uo_1_packet(proto_tree *tree,
struct pdcp_lte_info *p_pdcp_info,
packet_info *pinfo)
{
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " UO-1");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " UO-1");
proto_item_append_text(root_item, " (UO-1)");
/* TODO: octet before large-cid */
@@ -1110,15 +1072,11 @@ static int dissect_pdcp_uo_1_ts_or_id_packet(proto_tree *tree,
T = tvb_get_guint8(tvb, ++offset) >> 5;
proto_tree_add_item(tree, hf_pdcp_lte_rohc_type0_t, tvb, offset, 1, FALSE);
if (T) {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " UO-1-TS");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " UO-1-TS");
proto_item_append_text(root_item, " (UO-1-TS)");
}
else {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " UO-1-ID");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " UO-1-ID");
proto_item_append_text(root_item, " (UO-1-ID)");
}
@@ -1147,9 +1105,7 @@ static int dissect_pdcp_uor_2_packet(proto_tree *tree,
{
guint8 ts;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " U0R-2");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " U0R-2");
proto_item_append_text(root_item, " (UOR-2)");
/* TS straddles CID */
@@ -1209,15 +1165,11 @@ static int dissect_pdcp_uor_2_ts_or_id_packet(proto_tree *tree,
proto_tree_add_item(tree, hf_pdcp_lte_rohc_type2_t, tvb, offset, 1, FALSE);
if (T) {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " U0R-2-TS");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " U0R-2-TS");
proto_item_append_text(root_item, " (UOR-2-TS)");
}
else {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " U0R-2-ID");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " U0R-2-ID");
proto_item_append_text(root_item, " (UOR-2-ID)");
}
@@ -1358,10 +1310,8 @@ static void show_pdcp_config(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree
PROTO_ITEM_SET_GENERATED(configuration_ti);
/* Show plane in info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s: ",
- val_to_str(p_pdcp_info->plane, pdcp_plane_vals, "Unknown"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s: ",
+ val_to_str(p_pdcp_info->plane, pdcp_plane_vals, "Unknown"));
}
@@ -1420,8 +1370,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
gboolean ip_id_needed = TRUE;
/* Append this protocol name rather than replace. */
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- col_add_str(pinfo->cinfo, COL_PROTOCOL, "PDCP-LTE");
+ col_add_str(pinfo->cinfo, COL_PROTOCOL, "PDCP-LTE");
/* Create pdcp tree. */
if (tree) {
@@ -1447,9 +1396,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
/* Show ROHC mode */
- if (p_pdcp_info->rohc_compression &&
- check_col(pinfo->cinfo, COL_INFO)) {
-
+ if (p_pdcp_info->rohc_compression) {
col_append_fstr(pinfo->cinfo, COL_INFO, " (mode=%c)", mode[0]);
}
@@ -1465,10 +1412,8 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* 5-bit sequence number */
proto_tree_add_item(pdcp_tree, hf_pdcp_lte_seq_num_5, tvb, offset, 1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " sn=%u ",
- tvb_get_guint8(tvb, offset) & 0x1f);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " sn=%u ",
+ tvb_get_guint8(tvb, offset) & 0x1f);
offset++;
@@ -1505,10 +1450,8 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_item(pdcp_tree, hf_pdcp_lte_mac, tvb, offset, 4, FALSE);
offset += 4;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " MAC=0x%08x (%u bytes data)",
- mac, data_length);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " MAC=0x%08x (%u bytes data)",
+ mac, data_length);
return;
}
@@ -1557,9 +1500,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
return;
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " sn=%u ", seqnum);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " sn=%u ", seqnum);
}
else {
/*******************************/
@@ -1604,11 +1545,9 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
proto_item_append_text(bitmap_ti, " (not-received=%u)", not_received);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
- " Status Report (fms=%u) not-received=%u",
- fms, not_received);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO,
+ " Status Report (fms=%u) not-received=%u",
+ fms, not_received);
}
return;
@@ -1623,18 +1562,14 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
else {
/* Invalid plane setting...! */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " - INVALID PLANE (%u)",
- p_pdcp_info->plane);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " - INVALID PLANE (%u)",
+ p_pdcp_info->plane);
return;
}
}
else {
/* Show that its a no-header PDU */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " No-Header ");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " No-Header ");
}
@@ -1673,10 +1608,8 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
}
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%u bytes data)",
- tvb_length_remaining(tvb, offset));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%u bytes data)",
+ tvb_length_remaining(tvb, offset));
}
}
return;
@@ -1687,16 +1620,14 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* ROHC packets */
/***************************/
- if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
- col_append_fstr(pinfo->cinfo, COL_PROTOCOL, "|ROHC(%s)",
- val_to_str(p_pdcp_info->profile, rohc_profile_vals, "Unkown"));
- }
+ col_append_fstr(pinfo->cinfo, COL_PROTOCOL, "|ROHC(%s)",
+ val_to_str(p_pdcp_info->profile, rohc_profile_vals, "Unkown"));
/* Only attempt ROHC if configured to */
if (!global_pdcp_dissect_rohc) {
return;
}
-
+
/* Create pdcp tree. */
if (pdcp_tree) {
rohc_ti = proto_tree_add_item(pdcp_tree, hf_pdcp_lte_rohc, tvb, offset, -1, FALSE);
diff --git a/epan/dissectors/packet-rlc-lte.c b/epan/dissectors/packet-rlc-lte.c
index 3fe50c1970..4fc43b01b7 100644
--- a/epan/dissectors/packet-rlc-lte.c
+++ b/epan/dissectors/packet-rlc-lte.c
@@ -318,13 +318,11 @@ static void show_PDU_in_info(packet_info *pinfo,
gboolean last_includes_end)
{
/* Reflect this PDU in the info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s%u-byte%s%s",
- (first_includes_start) ? "[" : "..",
- length,
- (length > 1) ? "s" : "",
- (last_includes_end) ? "]" : "..");
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s%u-byte%s%s",
+ (first_includes_start) ? "[" : "..",
+ length,
+ (length > 1) ? "s" : "",
+ (last_includes_end) ? "]" : "..");
}
@@ -685,10 +683,7 @@ static void dissect_rlc_lte_um(tvbuff_t *tvb, packet_info *pinfo,
}
/* Show SN in info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " SN=%04u",
- (guint16)sn);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " SN=%04u", (guint16)sn);
/* Show SN in UM header root */
proto_item_append_text(um_header_ti, " (SN=%u)", (guint16)sn);
@@ -778,10 +773,7 @@ static void dissect_rlc_lte_am_status_pdu(tvbuff_t *tvb,
proto_tree_add_bits_ret_val(tree, hf_rlc_lte_am_ack_sn, tvb,
bit_offset, 10, &ack_sn, FALSE);
bit_offset += 10;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " ACK_SN=%u", (guint16)ack_sn);
- }
-
+ col_append_fstr(pinfo->cinfo, COL_INFO, " ACK_SN=%u", (guint16)ack_sn);
/* E1 */
proto_tree_add_bits_ret_val(tree, hf_rlc_lte_am_e1, tvb,
@@ -802,9 +794,7 @@ static void dissect_rlc_lte_am_status_pdu(tvbuff_t *tvb,
nack_ti = proto_tree_add_bits_ret_val(tree, hf_rlc_lte_am_nack_sn, tvb,
bit_offset, 10, &nack_sn, FALSE);
bit_offset += 10;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " NACK_SN=%u", (guint16)nack_sn);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " NACK_SN=%u", (guint16)nack_sn);
expert_add_info_format(pinfo, nack_ti, PI_SEQUENCE, PI_WARN,
"Status PDU reports NACK for SN=%u", (guint16)nack_sn);
@@ -830,13 +820,11 @@ static void dissect_rlc_lte_am_status_pdu(tvbuff_t *tvb,
bit_offset, 15, &so_end, FALSE);
bit_offset += 15;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " (SOstart=%u SOend=%u)",
- (guint16)so_start, (guint16)so_end);
+ col_append_fstr(pinfo->cinfo, COL_INFO, " (SOstart=%u SOend=%u)",
+ (guint16)so_start, (guint16)so_end);
- if ((guint16)so_end == 0x7fff) {
- col_append_str(pinfo->cinfo, COL_INFO, " (missing portion reaches end of AMD PDU)");
- }
+ if ((guint16)so_end == 0x7fff) {
+ col_append_str(pinfo->cinfo, COL_INFO, " (missing portion reaches end of AMD PDU)");
}
/* Reset this flag here */
@@ -893,9 +881,8 @@ static void dissect_rlc_lte_am(tvbuff_t *tvb, packet_info *pinfo,
/**************************************************/
if (!is_data) {
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, " [CONTROL]");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, " [CONTROL]");
+
/* Control PDUs are a completely separate format */
dissect_rlc_lte_am_status_pdu(tvb, pinfo, am_header_tree, am_header_ti, offset);
return;
@@ -908,17 +895,13 @@ static void dissect_rlc_lte_am(tvbuff_t *tvb, packet_info *pinfo,
is_segment = (tvb_get_guint8(tvb, offset) & 0x40) >> 6;
proto_tree_add_item(am_header_tree, hf_rlc_lte_am_rf, tvb, offset, 1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, (is_segment) ? " [DATA-SEGMENT]" : " [DATA]");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, (is_segment) ? " [DATA-SEGMENT]" : " [DATA]");
/* Polling bit */
polling = (tvb_get_guint8(tvb, offset) & 0x20) >> 5;
proto_tree_add_item(am_header_tree, hf_rlc_lte_am_p, tvb, offset, 1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_str(pinfo->cinfo, COL_INFO, (polling) ? " (P) " : " ");
- }
+ col_append_str(pinfo->cinfo, COL_INFO, (polling) ? " (P) " : " ");
if (polling) {
proto_item_append_text(am_header_ti, " (P)");
}
@@ -936,9 +919,7 @@ static void dissect_rlc_lte_am(tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_item(am_header_tree, hf_rlc_lte_am_fixed_sn, tvb, offset, 2, FALSE);
offset += 2;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "sn=%u", sn);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, "sn=%u", sn);
/* Show SN in AM header root */
@@ -956,9 +937,7 @@ static void dissect_rlc_lte_am(tvbuff_t *tvb, packet_info *pinfo,
/* SO */
segmentOffset = tvb_get_ntohs(tvb, offset) & 0x7fff;
proto_tree_add_item(am_header_tree, hf_rlc_lte_am_segment_so, tvb, offset, 2, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " SO=%u ", segmentOffset);
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " SO=%u ", segmentOffset);
offset += 2;
}
@@ -1029,9 +1008,7 @@ void dissect_rlc_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
struct rlc_lte_info *p_rlc_lte_info = NULL;
/* Set protocol name */
- if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC-LTE");
- }
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC-LTE");
/* Create protocol tree. */
ti = proto_tree_add_item(tree, proto_rlc_lte, tvb, offset, -1, FALSE);
@@ -1095,23 +1072,21 @@ void dissect_rlc_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Append context highlights to info column */
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO,
- "[%s] [%s] ",
- (p_rlc_lte_info->direction == 0) ? "UL" : "DL",
- val_to_str(p_rlc_lte_info->rlcMode, rlc_mode_short_vals, "Unknown"));
- if (p_rlc_lte_info->ueid != 0) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "UEId=%u ", p_rlc_lte_info->ueid);
- }
- if (p_rlc_lte_info->channelId == 0) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s",
- val_to_str(p_rlc_lte_info->channelType, rlc_channel_type_vals, "Unknown"));
- }
- else {
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s:%u",
- val_to_str(p_rlc_lte_info->channelType, rlc_channel_type_vals, "Unknown"),
- p_rlc_lte_info->channelId);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO,
+ "[%s] [%s] ",
+ (p_rlc_lte_info->direction == 0) ? "UL" : "DL",
+ val_to_str(p_rlc_lte_info->rlcMode, rlc_mode_short_vals, "Unknown"));
+ if (p_rlc_lte_info->ueid != 0) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, "UEId=%u ", p_rlc_lte_info->ueid);
+ }
+ if (p_rlc_lte_info->channelId == 0) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s",
+ val_to_str(p_rlc_lte_info->channelType, rlc_channel_type_vals, "Unknown"));
+ }
+ else {
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s:%u",
+ val_to_str(p_rlc_lte_info->channelType, rlc_channel_type_vals, "Unknown"),
+ p_rlc_lte_info->channelId);
}
/* Reset this count */
@@ -1123,10 +1098,8 @@ void dissect_rlc_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case RLC_TM_MODE:
/* Remaining bytes are all data */
proto_tree_add_item(rlc_lte_tree, hf_rlc_lte_tm_data, tvb, offset, -1, FALSE);
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " [%u-bytes]",
- tvb_length_remaining(tvb, offset));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " [%u-bytes]",
+ tvb_length_remaining(tvb, offset));
break;
case RLC_UM_MODE: