diff --git a/epan/expert.c b/epan/expert.c index 9d13580f8f..611746c3de 100644 --- a/epan/expert.c +++ b/epan/expert.c @@ -357,7 +357,7 @@ expert_set_info_vformat(packet_info *pinfo, proto_item *pi, int group, int sever void -expert_add_info_format(packet_info *pinfo, proto_item *pi, int group, int severity, const char *format, ...) +expert_add_info_format_internal(packet_info *pinfo, proto_item *pi, int group, int severity, const char *format, ...) { va_list ap; @@ -378,7 +378,7 @@ expert_add_info(packet_info *pinfo, proto_item *pi, expert_field *expindex) } void -expert_add_info_format_text(packet_info *pinfo, proto_item *pi, expert_field *expindex, const char *format, ...) +expert_add_info_format(packet_info *pinfo, proto_item *pi, expert_field *expindex, const char *format, ...) { va_list ap; expert_field_info* eiinfo; diff --git a/epan/expert.h b/epan/expert.h index 48e71fce1f..a6351df964 100644 --- a/epan/expert.h +++ b/epan/expert.h @@ -139,7 +139,7 @@ expert_update_comment_count(guint64 count); WS_DLL_PUBLIC void expert_add_info(packet_info *pinfo, proto_item *pi, expert_field* eiindex); -/** Add an expert info. TO BE DEPRECATED IN ITS CURRENT FORM!!! +/** Add an expert info. FOR INTERNAL (NON-DISSECTOR) USE ONLY!!! Add an expert info tree to a protocol item, with classification and message. @param pinfo Packet info of the currently processed packet. May be NULL if pi is supplied @@ -149,12 +149,12 @@ expert_add_info(packet_info *pinfo, proto_item *pi, expert_field* eiindex); @param format Printf-style format string for additional arguments */ WS_DLL_PUBLIC void -expert_add_info_format(packet_info *pinfo, proto_item *pi, int group, +expert_add_info_format_internal(packet_info *pinfo, proto_item *pi, int group, int severity, const char *format, ...) G_GNUC_PRINTF(5, 6); /** Add an expert info. - Add an expert info tree to a protocol item, using registered expert info item, + Add an expert info tree to a protocol item, using registered expert info item, but with a formatted message. @param pinfo Packet info of the currently processed packet. May be NULL if pi is supplied @@ -163,9 +163,12 @@ expert_add_info_format(packet_info *pinfo, proto_item *pi, int group, @param format Printf-style format string for additional arguments */ WS_DLL_PUBLIC void -expert_add_info_format_text(packet_info *pinfo, proto_item *pi, expert_field *eiindex, +expert_add_info_format(packet_info *pinfo, proto_item *pi, expert_field *eiindex, const char *format, ...) G_GNUC_PRINTF(4, 5); +/* XXX - TEMPORARY WHILE SEARCH/REPLACE OF expert_add_info_format_text IS DONE */ +#define expert_add_info_format_text expert_add_info_format + /** Add an expert info associated with some byte data Add an expert info tree to a protocol item using registered expert info item. This function is intended to replace places where diff --git a/epan/proto.c b/epan/proto.c index fc1b0f7afc..d13a1789a2 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -1052,7 +1052,7 @@ report_type_length_mismatch(proto_tree *tree, const gchar *descr, int length, gb /* Keep the current item from getting freed by proto_tree_new_item. */ tree_data->fi_tmp = NULL; - expert_add_info_format(NULL, tree, PI_MALFORMED, is_error ? PI_ERROR : PI_WARN, "Trying to fetch %s with length %d", descr, length); + expert_add_info_format_internal(NULL, tree, PI_MALFORMED, is_error ? PI_ERROR : PI_WARN, "Trying to fetch %s with length %d", descr, length); tree_data->fi_tmp = fi_save; } @@ -6917,7 +6917,7 @@ proto_tree_add_bitmask_len(proto_tree *parent_tree, tvbuff_t *tvb, if (decodable_len < len) { /* Dissector likely requires updating for new protocol revision */ - expert_add_info_format(NULL, item, PI_UNDECODED, PI_WARN, + expert_add_info_format_internal(NULL, item, PI_UNDECODED, PI_WARN, "Only least-significant %d of %d bytes decoded", decodable_len, len); } diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c index 5c43c158ff..d773658422 100644 --- a/epan/wslua/init_wslua.c +++ b/epan/wslua/init_wslua.c @@ -99,7 +99,7 @@ int dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data const gchar* error = lua_tostring(L,-1); proto_item* pi = proto_tree_add_text(tree,tvb,0,0,"Lua Error: %s",error); - expert_add_info_format(pinfo, pi, PI_UNDECODED, PI_ERROR ,"Lua Error"); + expert_add_info_format_internal(pinfo, pi, PI_UNDECODED, PI_ERROR ,"Lua Error"); } else { /* if the Lua dissector reported the consumed bytes, pass it to our caller */ @@ -114,7 +114,7 @@ int dissect_lua(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data proto_item* pi = proto_tree_add_text(tree,tvb,0,0,"Lua Error: did not find the %s dissector" " in the dissectors table",pinfo->current_proto); - expert_add_info_format(pinfo, pi, PI_UNDECODED, PI_ERROR ,"Lua Error"); + expert_add_info_format_internal(pinfo, pi, PI_UNDECODED, PI_ERROR ,"Lua Error"); } register_frame_end_routine(pinfo, lua_frame_end); diff --git a/epan/wslua/wslua_tree.c b/epan/wslua/wslua_tree.c index 4452abee8c..b9447a7471 100644 --- a/epan/wslua/wslua_tree.c +++ b/epan/wslua/wslua_tree.c @@ -336,7 +336,7 @@ WSLUA_METHOD TreeItem_add_expert_info(lua_State *L) { luaL_error(L,"expired TreeItem"); return 0; } - expert_add_info_format(lua_pinfo, ti->item, group, severity, "%s", str); + expert_add_info_format_internal(lua_pinfo, ti->item, group, severity, "%s", str); } return 0;