diff --git a/epan/libwireshark.def b/epan/libwireshark.def index 5e83b94442..40517e4e02 100644 --- a/epan/libwireshark.def +++ b/epan/libwireshark.def @@ -43,6 +43,7 @@ bytes_to_str_punct bytestring_to_str call_ber_oid_callback call_dissector +call_dissector_with_data call_dissector_only camel_opr_code_strings DATA camelSRTtype_naming DATA diff --git a/epan/packet.c b/epan/packet.c index 69b88a7009..13204995b5 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -2028,12 +2028,12 @@ call_dissector_only(dissector_handle_t handle, tvbuff_t *tvb, * dissector. */ int -call_dissector(dissector_handle_t handle, tvbuff_t *tvb, - packet_info *pinfo, proto_tree *tree) +call_dissector_with_data(dissector_handle_t handle, tvbuff_t *tvb, + packet_info *pinfo, proto_tree *tree, void *data) { int ret; - ret = call_dissector_only(handle, tvb, pinfo, tree, NULL); + ret = call_dissector_only(handle, tvb, pinfo, tree, data); if (ret == 0) { /* * The protocol was disabled, or the dissector rejected @@ -2047,6 +2047,13 @@ call_dissector(dissector_handle_t handle, tvbuff_t *tvb, return ret; } +int +call_dissector(dissector_handle_t handle, tvbuff_t *tvb, + packet_info *pinfo, proto_tree *tree) +{ + return call_dissector_with_data(handle, tvb, pinfo, tree, NULL); +} + /* * Dumps the "layer type"/"decode as" associations to stdout, similar * to the proto_registrar_dump_*() routines. diff --git a/epan/packet.h b/epan/packet.h index b560f9296f..daff3ec51d 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -362,11 +362,14 @@ extern dissector_handle_t new_create_dissector_handle(new_dissector_t dissector, * @param tvb The buffer to dissect. * @param pinfo Packet Info. * @param tree The protocol tree. + * @param data parameter to pass to dissector * @return If the protocol for that handle isn't enabled call the data * dissector. Otherwise, if the handle refers to a new-style * dissector, call the dissector and return its return value, otherwise call * it and return the length of the tvbuff pointed to by the argument. */ +extern int call_dissector_with_data(dissector_handle_t handle, tvbuff_t *tvb, + packet_info *pinfo, proto_tree *tree, void *data); extern int call_dissector(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); @@ -377,6 +380,7 @@ extern int call_dissector(dissector_handle_t handle, tvbuff_t *tvb, * @param tvb The buffer to dissect. * @param pinfo Packet Info. * @param tree The protocol tree. + * @param data parameter to pass to dissector * @return If the protocol for that handle isn't enabled, return 0 without * calling the dissector. Otherwise, if the handle refers to a new-style * dissector, call the dissector and return its return value, otherwise call