aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-udp.h
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-08-17 20:34:47 -0400
committerAnders Broman <a.broman58@gmail.com>2015-08-18 12:50:29 +0000
commitc05df9932caeb14dd32f5edce65cb9c348b5984c (patch)
treea40040496a3991311f33831c085ea327432b3359 /epan/dissectors/packet-udp.h
parentdb5b786e55d25139b8806fcbc2852941a77118db (diff)
Add udp_dissect_pdus.
It works similar to tcp_dissect_pdus, but only works on a single packet. Intended for protocols that go over TCP and UDP so that they can have a common dissection function. Will of course, also work on UDP-only protocols with a fixed length header and size. Used DNP3 as a guinea pig since "multiple PDU support" over UDP was just added. Change-Id: Ib7af8eaf7102c96b4f8b5c1b891ae2d8f0886f9d Reviewed-on: https://code.wireshark.org/review/10083 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-udp.h')
-rw-r--r--epan/dissectors/packet-udp.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/epan/dissectors/packet-udp.h b/epan/dissectors/packet-udp.h
index 164c5e3592..6bffbb190b 100644
--- a/epan/dissectors/packet-udp.h
+++ b/epan/dissectors/packet-udp.h
@@ -109,6 +109,28 @@ WS_DLL_PUBLIC void decode_udp_ports(tvbuff_t *, int, packet_info *,
WS_DLL_PUBLIC struct udp_analysis *get_udp_conversation_data(conversation_t *,
packet_info *);
+/*
+ * Loop for dissecting PDUs within a UDP packet; Similar to tcp_dissect_pdus,
+ * but doesn't have stream support. Assumes that a PDU consists of a
+ * fixed-length chunk of data that contains enough information
+ * to determine the length of the PDU, followed by rest of the PDU.
+ *
+ * The first three arguments are the arguments passed to the dissector
+ * that calls this routine.
+ *
+ * "fixed_len" is the length of the fixed-length part of the PDU.
+ *
+ * "get_pdu_len()" is a routine called to get the length of the PDU from
+ * the fixed-length part of the PDU; it's passed "pinfo", "tvb", "offset" and
+ * "dissector_data".
+ *
+ * "dissect_pdu()" is the routine to dissect a PDU.
+ */
+WS_DLL_PUBLIC void
+udp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
+ guint fixed_len, guint (*get_pdu_len)(packet_info *, tvbuff_t *, int, void*),
+ new_dissector_t dissect_pdu, void* dissector_data);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */