Expose RTPS dissector for Lua.

See https://ask.wireshark.org/questions/61824/how-to-get-a-reference-to-an-existing-heuristic-dissector-in-lua-in-order-to-wrap-rtps

Change-Id: I926b974da8e2de35c64cc46cba7b38e71368fcdd
Reviewed-on: https://code.wireshark.org/review/22137
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2017-06-17 11:10:53 -04:00
parent c89f4c628c
commit 57fece13e0
1 changed files with 13 additions and 0 deletions

View File

@ -9531,6 +9531,16 @@ static gboolean dissect_rtps_rtitcp(tvbuff_t *tvb, packet_info *pinfo, proto_tre
return dissect_rtps(tvb, pinfo, tree, offset);
}
static int dissect_simple_rtps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
gint offset = 0;
if (dissect_rtps(tvb, pinfo, tree, offset) == FALSE)
return 0;
return tvb_captured_length(tvb);
}
void proto_register_rtps(void) {
static hf_register_info hf[] = {
@ -11710,6 +11720,9 @@ void proto_register_rtps(void) {
proto_rtps, FT_STRING, BASE_NONE);
registry = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid);
/* In order to get this dissector in LUA (aka "chained-dissector") */
register_dissector("rtps", dissect_simple_rtps, proto_rtps);
}