Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
expert.h
Go to the documentation of this file.
1
14#ifndef __EXPERT_H__
15#define __EXPERT_H__
16
17#include <epan/proto.h>
18#include <epan/packet_info.h>
19#include <wsutil/value_string.h>
20#include "ws_symbol_export.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* __cplusplus */
25
27typedef struct expert_info_s {
28 uint32_t packet_num;
29 int group; /* from a bitfield, should probably be unsigned */
30 int severity; /* from a bitfield, should probably be unsigned */
31 int hf_index; /* hf_index of the expert item. Might be -1. */
32 const char *protocol;
33 char *summary;
34 proto_item *pitem;
36
37/* Expert Info and Display hf data */
38typedef struct expert_field
39{
40 int ei;
41 int hf;
43
44#define EI_INIT_EI 0
45#define EI_INIT_HF 0
46#define EI_INIT {EI_INIT_EI, EI_INIT_HF}
47
48typedef struct expert_field_info {
49 /* ---------- set by dissector --------- */
50 const char *name;
51 int group;
52 int severity;
53 const char *summary;
54
55 /* ------- set by register routines (prefilled by EXPFILL macro, see below) ------ */
56 int id;
57 const char *protocol;
58 int orig_severity; /* Matches severity when registered, used to restore original severity
59 * if UAT severity entry is removed */
61 hf_register_info hf_info;
62
64
65#define EXPFILL 0, NULL, 0, NULL, \
66 {0, {NULL, NULL, FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}}
67
72
73typedef struct expert_module expert_module_t;
74
75#define PRE_ALLOC_EXPERT_FIELDS_MEM 5000
76
77/* "proto_expert" is exported from libwireshark.dll.
78 * Thus we need a special declaration.
79 */
80WS_DLL_PUBLIC int proto_expert;
81
82extern void
83expert_init(void);
84
85extern void
86expert_packet_init(void);
87
88extern void
89expert_cleanup(void);
90
91extern void
92expert_packet_cleanup(void);
93
94WS_DLL_PUBLIC int
95expert_get_highest_severity(void);
96
97WS_DLL_PUBLIC void
98expert_update_comment_count(uint64_t count);
99
108WS_DLL_PUBLIC proto_item *
110
121WS_DLL_PUBLIC proto_item *
123 const char *format, ...) G_GNUC_PRINTF(4, 5);
124
137WS_DLL_PUBLIC proto_item *
139 tvbuff_t *tvb, unsigned start, unsigned length);
140
154WS_DLL_PUBLIC proto_item*
156 tvbuff_t* tvb, unsigned start);
157
173WS_DLL_PUBLIC proto_item *
175 tvbuff_t *tvb, unsigned start, unsigned length, const char *format, ...) G_GNUC_PRINTF(7, 8);
176
194WS_DLL_PUBLIC proto_item*
196 tvbuff_t* tvb, unsigned start, const char* format, ...) G_GNUC_PRINTF(6, 7);
197
198/*
199 * Register that a protocol has expert info.
200 */
201WS_DLL_PUBLIC expert_module_t *expert_register_protocol(int id);
202
206void expert_deregister_expertinfo (const char *abbrev);
207
212
217
223WS_DLL_PUBLIC const char* expert_get_summary(expert_field *eiindex);
224
229WS_DLL_PUBLIC void
230expert_register_field_array(expert_module_t *module, ei_register_info *ei, const int num_records);
231
232#define EXPERT_CHECKSUM_DISABLED -2
233#define EXPERT_CHECKSUM_UNKNOWN -1
234#define EXPERT_CHECKSUM_GOOD 0
235#define EXPERT_CHECKSUM_BAD 1
236
237WS_DLL_PUBLIC const value_string expert_group_vals[];
238
239WS_DLL_PUBLIC const value_string expert_severity_vals[];
240
241WS_DLL_PUBLIC const value_string expert_checksum_vals[];
242
243#ifdef __cplusplus
244}
245#endif /* __cplusplus */
246
247#endif /* __EXPERT_H__ */
248
249/*
250 * Editor modelines - https://www.wireshark.org/tools/modelines.html
251 *
252 * Local variables:
253 * c-basic-offset: 8
254 * tab-width: 8
255 * indent-tabs-mode: t
256 * End:
257 *
258 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
259 * :indentSize=8:tabSize=8:noTabs=false:
260 */
struct expert_info_s expert_info_t
WS_DLL_PUBLIC void expert_register_field_array(expert_module_t *module, ei_register_info *ei, const int num_records)
Definition expert.c:444
WS_DLL_PUBLIC proto_item * expert_add_info(packet_info *pinfo, proto_item *pi, expert_field *eiindex)
Definition expert.c:682
void expert_deregister_expertinfo(const char *abbrev)
Definition expert.c:342
WS_DLL_PUBLIC proto_item * proto_tree_add_expert_format(proto_tree *tree, packet_info *pinfo, expert_field *eiindex, tvbuff_t *tvb, unsigned start, unsigned length, const char *format,...)
Definition expert.c:776
WS_DLL_PUBLIC proto_item * proto_tree_add_expert(proto_tree *tree, packet_info *pinfo, expert_field *eiindex, tvbuff_t *tvb, unsigned start, unsigned length)
Definition expert.c:762
WS_DLL_PUBLIC proto_item * expert_add_info_format(packet_info *pinfo, proto_item *pi, expert_field *eiindex, const char *format,...)
Definition expert.c:690
void expert_free_deregistered_expertinfos(void)
Definition expert.c:367
WS_DLL_PUBLIC proto_item * proto_tree_add_expert_format_remaining(proto_tree *tree, packet_info *pinfo, expert_field *eiindex, tvbuff_t *tvb, unsigned start, const char *format,...)
Definition expert.c:808
void expert_deregister_protocol(expert_module_t *module)
Definition expert.c:354
WS_DLL_PUBLIC const char * expert_get_summary(expert_field *eiindex)
Definition expert.c:500
WS_DLL_PUBLIC proto_item * proto_tree_add_expert_remaining(proto_tree *tree, packet_info *pinfo, expert_field *eiindex, tvbuff_t *tvb, unsigned start)
Definition expert.c:769
Definition packet_info.h:43
Definition proto.h:907
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33
Definition expert.h:68
expert_field_info eiinfo
Definition expert.h:70
expert_field * ids
Definition expert.h:69
Definition expert.h:48
struct expert_field_info * same_name_next
Definition expert.h:60
Definition expert.h:39
Definition expert.h:27
Definition expert.c:48
Definition proto.h:803
Definition tvbuff-int.h:36