diff options
author | Matthias Lang <matthias@corelatus.com> | 2019-03-22 12:04:11 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-03-27 08:11:59 +0000 |
commit | 303ccbe4b5c6df61a64fe89c5a05a2e6f8ab9801 (patch) | |
tree | 0932cbb7c2582543f92c55d2647ac8613baef4c1 /epan | |
parent | 45a8c2dbf4e15cb6874549f34bf616a4754d6645 (diff) |
MTP2: Optionally enable checksum verification
Add a protocol preference to specify whether or not the
MTP-2 frame check sequence is present in the capture file.
Allows Wireshark to correctly check the FCS and length indicator in
PCapNG files containing MTP-2 with the FCS present. The same checks are
already possible for MTP-2 in ERF files, because Wireshark assumes that
ERF includes the CRC.
Change-Id: Ica7256818a3195ccd7f8349847446626b0ecb21c
Reviewed-on: https://code.wireshark.org/review/32513
Reviewed-by: Matthias Lang <matthias@corelatus.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-mtp2.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/epan/dissectors/packet-mtp2.c b/epan/dissectors/packet-mtp2.c index 36ac83d505..1ff1db69ff 100644 --- a/epan/dissectors/packet-mtp2.c +++ b/epan/dissectors/packet-mtp2.c @@ -171,6 +171,7 @@ static gint ett_mtp2 = -1; static dissector_handle_t mtp3_handle; static gboolean use_extended_sequence_numbers_default = FALSE; +static gboolean capture_contains_fcs_crc_default = FALSE; /* sequence number of the actual packet to be reassembled * this is needed because the reassemble handler uses a key based on the @@ -506,7 +507,10 @@ dissect_mtp2_with_phdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void return tvb_captured_length(tvb); } -/* Dissect MTP2 frame with CRC16 included at end of payload */ +/* Dissect MTP2 frame with CRC16 included at end of payload. Used + * if the user has associated "mtp2_with_crc" with a DLT or if the + * packets come from an Endace ERF file. + */ static int dissect_mtp2_with_crc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { @@ -514,11 +518,14 @@ dissect_mtp2_with_crc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* return tvb_captured_length(tvb); } -/* Dissect MTP2 frame without CRC16 included at end of payload */ +/* Dissect MTP2 frame where we don't know if the CRC16 is included at + * end of payload or not. + */ static int dissect_mtp2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - dissect_mtp2_common(tvb, pinfo, tree, FALSE, use_extended_sequence_numbers_default); + dissect_mtp2_common(tvb, pinfo, tree, capture_contains_fcs_crc_default, + use_extended_sequence_numbers_default); return tvb_captured_length(tvb); } @@ -1275,6 +1282,11 @@ proto_register_mtp2(void) "Use extended sequence numbers", "Whether the MTP2 dissector should use extended sequence numbers as described in Q.703, Annex A as a default.", &use_extended_sequence_numbers_default); + prefs_register_bool_preference(mtp2_module, + "capture_contains_frame_check_sequence", + "Assume packets have FCS", + "Some SS7 capture hardware includes the FCS at the end of the packet, others do not.", + &capture_contains_fcs_crc_default); /* register bool and range preferences */ prefs_register_bool_preference(mtp2_module, |