Fix a whole bunch of doxygen warnings, mostly typos or renamed parameters.
[metze/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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  */
26
27 #ifndef __EXPERT_H__
28 #define __EXPERT_H__
29
30 #include <epan/packet_info.h>
31 #include <epan/proto.h>
32 #include "value_string.h"
33 #include "ws_symbol_export.h"
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38
39 /** only for internal and display use. */
40 typedef struct expert_info_s {
41         guint32 packet_num;
42         int group;
43         int severity;
44         const gchar *protocol;
45         gchar *summary;
46         proto_item *pitem;
47 } expert_info_t;
48
49 static const value_string expert_group_vals[] = {
50         { PI_CHECKSUM,          "Checksum" },
51         { PI_SEQUENCE,          "Sequence" },
52         { PI_RESPONSE_CODE,     "Response" },
53         { PI_REQUEST_CODE,      "Request" },
54         { PI_UNDECODED,         "Undecoded" },
55         { PI_REASSEMBLE,        "Reassemble" },
56         { PI_MALFORMED,         "Malformed" },
57         { PI_DEBUG,             "Debug" },
58         { PI_PROTOCOL,          "Protocol" },
59         { PI_SECURITY,          "Security" },
60         { PI_COMMENTS_GROUP,    "Comment" },
61         { 0, NULL }
62 };
63
64 static const value_string expert_severity_vals[] = {
65         { PI_ERROR,             "Error" },
66         { PI_WARN,              "Warn" },
67         { PI_NOTE,              "Note" },
68         { PI_CHAT,              "Chat" },
69         { PI_COMMENT,           "Comment" },
70         { 0,                    "Ok" },
71         { 0, NULL }
72 };
73
74 /* "proto_expert" is exported from libwireshark.dll.
75  * Thus we need a special declaration.
76  */
77 WS_DLL_PUBLIC int proto_expert;
78
79 extern void
80 expert_init(void);
81
82 extern void
83 expert_cleanup(void);
84
85 WS_DLL_PUBLIC int
86 expert_get_highest_severity(void);
87
88 /** Add an expert info.
89  Add an expert info tree to a protocol item, with classification and message.
90  @param pinfo Packet info of the currently processed packet. May be NULL if
91         pi is supplied
92  @param pi Current protocol item (or NULL)
93  @param group The expert group (like PI_CHECKSUM - see: proto.h)
94  @param severity The expert severity (like PI_WARN - see: proto.h)
95  @param format Printf-style format string for additional arguments
96  */
97 WS_DLL_PUBLIC void
98 expert_add_info_format(packet_info *pinfo, proto_item *pi, int group,
99         int severity, const char *format, ...)
100         G_GNUC_PRINTF(5, 6);
101
102 /** Add an expert info about not dissected "item"
103  Add an expert info tree to a not dissected protocol item.
104  @param tvb The tvb associated with the item.
105  @param pinfo Packet info of the currently processed packet. May be NULL.
106  @param tree Tree to add the item to
107  @param offset Offset in tvb
108  @param length The length of the item.
109  @param severity The expert severity (like PI_WARN - see: proto.h)
110   */
111
112 WS_DLL_PUBLIC void
113 expert_add_undecoded_item(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int length, const int severity);
114 #ifdef __cplusplus
115 }
116 #endif /* __cplusplus */
117
118 #endif /* __EXPERT_H__ */