2005-09-11 16:55:34 +00:00
|
|
|
/* expert.h
|
|
|
|
* Collecting of Expert information.
|
|
|
|
*
|
2009-09-06 18:25:23 +00:00
|
|
|
* For further info, see: http://wiki.wireshark.org/Development/ExpertInfo
|
2005-09-11 16:55:34 +00:00
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-09-11 16:55:34 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __EXPERT_H__
|
|
|
|
#define __EXPERT_H__
|
|
|
|
|
2005-11-25 23:42:52 +00:00
|
|
|
#include <epan/proto.h>
|
2006-08-31 22:56:38 +00:00
|
|
|
#include "value_string.h"
|
2005-09-13 04:00:47 +00:00
|
|
|
|
2011-02-01 21:03:29 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
2005-09-11 16:55:34 +00:00
|
|
|
|
2010-02-27 22:12:43 +00:00
|
|
|
/** only for internal and display use. */
|
2005-09-11 16:55:34 +00:00
|
|
|
typedef struct expert_info_s {
|
2005-09-11 22:25:33 +00:00
|
|
|
guint32 packet_num;
|
2005-09-11 16:55:34 +00:00
|
|
|
int group;
|
|
|
|
int severity;
|
2010-02-27 22:12:43 +00:00
|
|
|
const gchar *protocol;
|
|
|
|
gchar *summary;
|
|
|
|
proto_item *pitem;
|
2005-09-11 16:55:34 +00:00
|
|
|
} expert_info_t;
|
|
|
|
|
2006-08-31 22:56:38 +00:00
|
|
|
WS_VAR_IMPORT const value_string expert_severity_vals[];
|
|
|
|
WS_VAR_IMPORT const value_string expert_group_vals[];
|
2005-09-11 16:55:34 +00:00
|
|
|
|
|
|
|
extern void
|
|
|
|
expert_init(void);
|
|
|
|
|
|
|
|
extern void
|
|
|
|
expert_cleanup(void);
|
|
|
|
|
2006-08-31 22:56:38 +00:00
|
|
|
extern int
|
|
|
|
expert_get_highest_severity(void);
|
|
|
|
|
2005-09-11 16:55:34 +00:00
|
|
|
/** Add an expert info.
|
2010-02-27 22:12:43 +00:00
|
|
|
Add an expert info tree to a protocol item, with classification and message.
|
2005-09-11 16:55:34 +00:00
|
|
|
@param pinfo packet info of the currently processed packet
|
|
|
|
@param pi current protocol item (or NULL)
|
2009-01-26 19:49:36 +00:00
|
|
|
@param group the expert group (like PI_CHECKSUM - see: proto.h)
|
|
|
|
@param severity the expert severity (like PI_WARN - see: proto.h)
|
2005-09-11 16:55:34 +00:00
|
|
|
@param format printf like format string with further infos
|
|
|
|
*/
|
|
|
|
extern void
|
2005-09-13 04:00:47 +00:00
|
|
|
expert_add_info_format(packet_info *pinfo, proto_item *pi, int group,
|
|
|
|
int severity, const char *format, ...)
|
2010-01-25 13:20:53 +00:00
|
|
|
G_GNUC_PRINTF(5, 6);
|
2005-09-11 16:55:34 +00:00
|
|
|
|
2011-05-25 11:05:23 +00:00
|
|
|
/** 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);
|
2011-02-01 21:03:29 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2005-09-11 16:55:34 +00:00
|
|
|
#endif /* __EXPERT_H__ */
|