diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2009-03-23 22:16:25 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2009-03-23 22:16:25 +0000 |
commit | f474eaedd849c963ec78faff87ac9edeee0f2e47 (patch) | |
tree | 20338240066889b1bb1523436535bd11553df582 /epan/dissectors | |
parent | 84bea61368c9c42f5e549cbdc3b0bd9cedf3d0df (diff) |
Add CRC error flag to frames, and show in stats window.
svn path=/trunk/; revision=27837
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-catapult-dct2000.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-mac-lte.c | 30 | ||||
-rw-r--r-- | epan/dissectors/packet-mac-lte.h | 2 |
3 files changed, 37 insertions, 3 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c index f4fc970cee..37cc2718de 100644 --- a/epan/dissectors/packet-catapult-dct2000.c +++ b/epan/dissectors/packet-catapult-dct2000.c @@ -1326,6 +1326,8 @@ static void attach_mac_lte_info(packet_info *pinfo) } /* Populate the struct from outhdr values */ + p_mac_lte_info->crcStatus = TRUE; + p_mac_lte_info->radioType = outhdr_values[i++]; p_mac_lte_info->rntiType = outhdr_values[i++]; p_mac_lte_info->direction = outhdr_values[i++]; @@ -1333,10 +1335,14 @@ static void attach_mac_lte_info(packet_info *pinfo) p_mac_lte_info->isPredefinedData = outhdr_values[i++]; p_mac_lte_info->rnti = outhdr_values[i++]; p_mac_lte_info->ueid = outhdr_values[i++]; + p_mac_lte_info->length = outhdr_values[i++]; if (outhdr_values_found > 8) { p_mac_lte_info->reTxCount = outhdr_values[i++]; } - p_mac_lte_info->length = outhdr_values[i++]; + if (outhdr_values_found > 9) { + p_mac_lte_info->crcStatus = outhdr_values[i++]; + } + /* Store info in packet */ p_add_proto_data(pinfo->fd, proto_mac_lte, p_mac_lte_info); diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c index e809c20185..2200cc218a 100644 --- a/epan/dissectors/packet-mac-lte.c +++ b/epan/dissectors/packet-mac-lte.c @@ -43,7 +43,6 @@ - more testing of control bodies - TDD mode - add a preference so that padding can be verified against an expected pattern? - - context value to show CRC-passed flag */ /* Initialize the protocol and registered fields. */ @@ -62,6 +61,7 @@ static int hf_mac_lte_context_predefined_frame = -1; static int hf_mac_lte_context_length = -1; static int hf_mac_lte_context_bch_transport_channel = -1; static int hf_mac_lte_context_retx_count = -1; +static int hf_mac_lte_context_crc_status = -1; /* MAC SCH header fields */ static int hf_mac_lte_ulsch_header = -1; @@ -163,6 +163,13 @@ static const value_string bch_transport_channel_vals[] = { 0, NULL } }; +static const value_string crc_status_vals[] = +{ + { 0, "CRC Status Failed"}, + { 1, "CRC Status OK"}, + { 0, NULL } +}; + #define UE_CONTENTION_RESOLUTION_IDENTITY_LCID 0x1c @@ -1059,11 +1066,24 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } + ti = proto_tree_add_uint(mac_lte_tree, hf_mac_lte_context_crc_status, + tvb, 0, 0, p_mac_lte_info->crcStatus); + PROTO_ITEM_SET_GENERATED(ti); + 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>"); + } + } + + /* Set context-info parts of tap struct */ tap_info.rnti = p_mac_lte_info->rnti; tap_info.rnti_type = p_mac_lte_info->rntiType; tap_info.is_predefined_data = p_mac_lte_info->isPredefinedData; tap_info.reTxCount = p_mac_lte_info->reTxCount; + tap_info.crcStatus = p_mac_lte_info->crcStatus; tap_info.direction = p_mac_lte_info->direction; /* Also set total number of bytes (won't be used for UL/DL-SCH) */ @@ -1191,10 +1211,16 @@ void proto_register_mac_lte(void) }, { &hf_mac_lte_context_retx_count, { "ReTX count", - "mac-lte.bch-transport-channel", FT_UINT8, BASE_DEC, 0, 0x0, + "mac-lte.retx-count", FT_UINT8, BASE_DEC, 0, 0x0, "Number of times this PDU has been retransmitted", HFILL } }, + { &hf_mac_lte_context_crc_status, + { "CRC Status", + "mac-lte.crc-status", FT_UINT8, BASE_DEC, VALS(crc_status_vals), 0x0, + "CRC Status as reported by PHY", HFILL + } + }, /*******************************************/ diff --git a/epan/dissectors/packet-mac-lte.h b/epan/dissectors/packet-mac-lte.h index 884ea14179..56df48b67f 100644 --- a/epan/dissectors/packet-mac-lte.h +++ b/epan/dissectors/packet-mac-lte.h @@ -53,6 +53,7 @@ typedef struct mac_lte_info guint8 isPredefinedData; guint16 length; guint8 reTxCount; + guint8 crcStatus; } mac_lte_info; @@ -62,6 +63,7 @@ typedef struct mac_lte_tap_info { guint8 rnti_type; guint8 is_predefined_data; guint8 reTxCount; + guint8 crcStatus; guint8 direction; /* Number of bytes (which part is used depends upon context settings) */ |