Wireshark 4.5.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 "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;
30 int severity;
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 -1
45#define EI_INIT_HF -1
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 */
60 hf_register_info hf_info;
61
63
64#define EXPFILL 0, NULL, 0, \
65 {0, {NULL, NULL, FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}}
66
71
72typedef struct expert_module expert_module_t;
73
74#define PRE_ALLOC_EXPERT_FIELDS_MEM 5000
75
76/* "proto_expert" is exported from libwireshark.dll.
77 * Thus we need a special declaration.
78 */
79WS_DLL_PUBLIC int proto_expert;
80
81extern void
82expert_init(void);
83
84extern void
85expert_packet_init(void);
86
87extern void
88expert_cleanup(void);
89
90extern void
91expert_packet_cleanup(void);
92
93WS_DLL_PUBLIC int
94expert_get_highest_severity(void);
95
96WS_DLL_PUBLIC void
97expert_update_comment_count(uint64_t count);
98
107WS_DLL_PUBLIC proto_item *
109
120WS_DLL_PUBLIC proto_item *
122 const char *format, ...) G_GNUC_PRINTF(4, 5);
123
136WS_DLL_PUBLIC proto_item *
138 tvbuff_t *tvb, int start, int length);
139
156WS_DLL_PUBLIC proto_item *
158 tvbuff_t *tvb, int start, int length, const char *format, ...) G_GNUC_PRINTF(7, 8);
159
160/*
161 * Register that a protocol has expert info.
162 */
163WS_DLL_PUBLIC expert_module_t *expert_register_protocol(int id);
164
168void expert_deregister_expertinfo (const char *abbrev);
169
174
179
185WS_DLL_PUBLIC const char* expert_get_summary(expert_field *eiindex);
186
191WS_DLL_PUBLIC void
192expert_register_field_array(expert_module_t *module, ei_register_info *ei, const int num_records);
193
194#define EXPERT_CHECKSUM_DISABLED -2
195#define EXPERT_CHECKSUM_UNKNOWN -1
196#define EXPERT_CHECKSUM_GOOD 0
197#define EXPERT_CHECKSUM_BAD 1
198
199WS_DLL_PUBLIC const value_string expert_group_vals[];
200
201WS_DLL_PUBLIC const value_string expert_severity_vals[];
202
203WS_DLL_PUBLIC const value_string expert_checksum_vals[];
204
205#ifdef __cplusplus
206}
207#endif /* __cplusplus */
208
209#endif /* __EXPERT_H__ */
210
211/*
212 * Editor modelines - https://www.wireshark.org/tools/modelines.html
213 *
214 * Local variables:
215 * c-basic-offset: 8
216 * tab-width: 8
217 * indent-tabs-mode: t
218 * End:
219 *
220 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
221 * :indentSize=8:tabSize=8:noTabs=false:
222 */
struct expert_info_s expert_info_t
WS_DLL_PUBLIC proto_item * expert_add_info_format(packet_info *pinfo, proto_item *pi, expert_field *eiindex, const char *format,...) G_GNUC_PRINTF(4
WS_DLL_PUBLIC void expert_register_field_array(expert_module_t *module, ei_register_info *ei, const int num_records)
Definition expert.c:431
WS_DLL_PUBLIC proto_item * expert_add_info(packet_info *pinfo, proto_item *pi, expert_field *eiindex)
Definition expert.c:657
void expert_deregister_expertinfo(const char *abbrev)
Definition expert.c:335
void expert_free_deregistered_expertinfos(void)
Definition expert.c:358
WS_DLL_PUBLIC proto_item WS_DLL_PUBLIC proto_item * proto_tree_add_expert(proto_tree *tree, packet_info *pinfo, expert_field *eiindex, tvbuff_t *tvb, int start, int length)
Definition expert.c:713
void expert_deregister_protocol(expert_module_t *module)
Definition expert.c:345
WS_DLL_PUBLIC const char * expert_get_summary(expert_field *eiindex)
Definition expert.c:486
WS_DLL_PUBLIC proto_item * proto_tree_add_expert_format(proto_tree *tree, packet_info *pinfo, expert_field *eiindex, tvbuff_t *tvb, int start, int length, const char *format,...) G_GNUC_PRINTF(7
Definition packet_info.h:43
Definition proto.h:901
Definition value_string.h:25
Definition expert.h:67
expert_field_info eiinfo
Definition expert.h:69
expert_field * ids
Definition expert.h:68
Definition expert.h:48
Definition expert.h:39
Definition expert.h:27
Definition expert.c:48
Definition proto.h:800
Definition tvbuff-int.h:35