Add a convinience function to add expert warnings for not dissected items.

svn path=/trunk/; revision=37391
This commit is contained in:
Anders Broman 2011-05-25 11:05:23 +00:00
parent 780efd342c
commit ccecf5b98b
3 changed files with 25 additions and 0 deletions

View File

@ -220,4 +220,16 @@ expert_add_info_format(packet_info *pinfo, proto_item *pi, int group, int severi
va_end(ap);
}
void
expert_add_undecoded_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int length, const int severity)
{
proto_item *expert_item;
expert_item = proto_tree_add_text(tree, tvb, offset, length, "Not dissected yet");
expert_add_info_format(pinfo, expert_item, PI_PROTOCOL, severity, "Not dissected yet(report to wireshark.org)"); \
PROTO_ITEM_SET_GENERATED(expert_item); \
}

View File

@ -69,6 +69,18 @@ expert_add_info_format(packet_info *pinfo, proto_item *pi, int group,
int severity, const char *format, ...)
G_GNUC_PRINTF(5, 6);
/** Add an expert info about not dissected "item"
Add an expert info tree to a not dissected protocol item.
@patam tvb the tvb with the item.
@param pinfo packet info of the currently processed packet
@param tree tree to add the item to
@param offset in tvb
@param length the length of the item.
@param severity the expert severity (like PI_WARN - see: proto.h)
*/
extern void
expert_add_undecoded_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int length, const int severity);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -428,6 +428,7 @@ except_throwd
except_throwf
except_unhandled_catcher
expert_add_info_format
expert_add_undecoded_item
expert_get_highest_severity
expert_group_vals DATA
expert_severity_vals DATA