aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-catapult-dct2000.c
diff options
context:
space:
mode:
authorJose Rubio <joserubiovidales@gmail.com>2020-12-10 23:12:06 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2020-12-13 11:17:42 +0000
commit270561ade17f9a20b0355962149347211b419c6b (patch)
tree7f76629d33500552727dae19994c01bfa7c27587 /epan/dissectors/packet-catapult-dct2000.c
parent02c5f500090261947b3e9a65dafff83a71edb17b (diff)
DCT2000: Allow any PDU to be dissected.
There are traffic dumps that only include the PDU payload without lower layer information. This commit allows any dissector to be embedded in the DCT2000 as a protocol name. tshark/wireshark will decode it despite having no lower layer information. The change allows a DCT2000 protocol field to look for a dissector. The change can be enabled or disabled with the preference dct2000.use_protocol_name_as_dissector_name and it defaults to FALSE. Example: Session Transcript (format 3.1) December 6, 2020 16:45:20.5185 LTE-RRC.1/lte_rrc.dl_dcch/1/// r tm 22.5695 l $2c02 S1AP.1/s1ap/1/// s tm 23.3926 l $001700130000020063000608023d7c00830002400202a0
Diffstat (limited to 'epan/dissectors/packet-catapult-dct2000.c')
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c
index 221c0e145d..7b6ac19446 100644
--- a/epan/dissectors/packet-catapult-dct2000.c
+++ b/epan/dissectors/packet-catapult-dct2000.c
@@ -121,6 +121,7 @@ static gboolean catapult_dct2000_try_sctpprim_heuristic = TRUE;
static gboolean catapult_dct2000_dissect_lte_rrc = TRUE;
static gboolean catapult_dct2000_dissect_mac_lte_oob_messages = TRUE;
static gboolean catapult_dct2000_dissect_old_protocol_names = FALSE;
+static gboolean catapult_dct2000_use_protocol_name_as_dissector_name = FALSE;
/* Protocol subtree. */
static int ett_catapult_dct2000 = -1;
@@ -3087,7 +3088,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
}
}
- /* Last chance: is there a (private) registered protocol of the form
+ /* Next chance: is there a (private) registered protocol of the form
"dct2000.protocol" ? */
if (protocol_handle == 0) {
/* TODO: only look inside if a preference enabled? */
@@ -3098,6 +3099,13 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
protocol_handle = find_dissector(dotted_protocol_name);
}
+ /* Last resort: Allow any PDU to be dissected if the protocol matches with
+ a dissector name */
+ if ( !protocol_handle && catapult_dct2000_use_protocol_name_as_dissector_name) {
+ protocol_handle = find_dissector(protocol_name);
+ }
+
+
break;
default:
@@ -3677,6 +3685,16 @@ void proto_register_catapult_dct2000(void)
"When set, look for some older protocol names so that"
"they may be matched with wireshark dissectors.",
&catapult_dct2000_dissect_old_protocol_names);
+
+ /* Determines if the protocol field in the DCT2000 shall be used to lookup for disector*/
+ prefs_register_bool_preference(catapult_dct2000_module, "use_protocol_name_as_dissector_name",
+ "Look for a dissector using the protocol name in the "
+ "DCT2000 record",
+ "When set, if there is a Wireshark dissector matching "
+ "the protocol name, it will parse the PDU using "
+ "that dissector. This may be slow, so should be "
+ "disabled unless you are using this feature.",
+ &catapult_dct2000_use_protocol_name_as_dissector_name);
}
/*