Add new function: call_dissector_with_data

svn path=/trunk/; revision=44873
This commit is contained in:
Jakub Zawadzki 2012-09-11 09:06:13 +00:00
parent 9f92dc93c5
commit 27fb6880c4
3 changed files with 15 additions and 3 deletions

View File

@ -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

View File

@ -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.

View File

@ -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