From Tyson Key:
[obnox/wireshark/wip.git] / epan / expert.h
1 /* expert.h
2  * Collecting of Expert information.
3  *
4  * For further info, see: http://wiki.wireshark.org/Development/ExpertInfo
5  *
6  * $Id$
7  *
8  * Wireshark - Network traffic analyzer
9  * By Gerald Combs <gerald@wireshark.org>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifndef __EXPERT_H__
28 #define __EXPERT_H__
29
30 #include <epan/proto.h>
31 #include "value_string.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif /* __cplusplus */
36
37 /** only for internal and display use. */
38 typedef struct expert_info_s {
39         guint32 packet_num;
40         int group;
41         int severity;
42         const gchar *protocol;
43         gchar *summary;
44         proto_item *pitem;
45 } expert_info_t;
46
47 WS_VAR_IMPORT const value_string expert_severity_vals[];
48 WS_VAR_IMPORT const value_string expert_group_vals[];
49
50 /* "proto_expert" is exported from libwireshark.dll.
51  * Thus we need a special declaration.
52  */
53 WS_VAR_IMPORT int proto_expert;
54
55 extern void
56 expert_init(void);
57
58 extern void
59 expert_cleanup(void);
60
61 extern int
62 expert_get_highest_severity(void);
63
64 /** Add an expert info.
65  Add an expert info tree to a protocol item, with classification and message.
66  @param pinfo packet info of the currently processed packet
67  @param pi current protocol item (or NULL)
68  @param group the expert group (like PI_CHECKSUM - see: proto.h)
69  @param severity the expert severity (like PI_WARN - see: proto.h)
70  @param format printf like format string with further infos
71  */
72 extern void
73 expert_add_info_format(packet_info *pinfo, proto_item *pi, int group,
74         int severity, const char *format, ...)
75         G_GNUC_PRINTF(5, 6);
76
77 /** Add an expert info about not dissected "item"
78  Add an expert info tree to a not dissected protocol item.
79  @patam tvb the tvb with the item.
80  @param pinfo packet info of the currently processed packet
81  @param tree tree to add the item to
82  @param offset in tvb
83  @param length the length of the item.
84  @param severity the expert severity (like PI_WARN - see: proto.h)
85   */
86
87 extern void
88 expert_add_undecoded_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int length, const int severity);
89 #ifdef __cplusplus
90 }
91 #endif /* __cplusplus */
92
93 #endif /* __EXPERT_H__ */