Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
expert.h
Go to the documentation of this file.
1
13#pragma once
14#include <epan/proto.h>
15#include <epan/packet_info.h>
16#include <wsutil/value_string.h>
17#include "ws_symbol_export.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif /* __cplusplus */
22
26typedef struct expert_info_s {
27 uint32_t packet_num;
28 int group;
31 const char* protocol;
32 char* summary;
35
36
40typedef struct expert_field
41{
42 int ei;
43 int hf;
45
46#define EI_INIT_EI 0
47#define EI_INIT_HF 0
48#define EI_INIT {EI_INIT_EI, EI_INIT_HF}
53typedef struct expert_field_info {
54 /* ---------- set by dissector --------- */
55 const char* name;
56 int group;
58 const char* summary;
60 /* ------- set by register routines (prefilled by EXPFILL macro) ------ */
61 int id;
62 const char* protocol;
67
71#define EXPFILL 0, NULL, 0, NULL, \
72 {0, {NULL, NULL, FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}}
73
81
82typedef struct expert_module expert_module_t;
83
84#define PRE_ALLOC_EXPERT_FIELDS_MEM 5000
85
86/* "proto_expert" is exported from libwireshark.dll.
87 * Thus we need a special declaration.
88 */
89WS_DLL_PUBLIC int proto_expert;
90
96extern void
97expert_init(void);
98
104extern void
106
110extern void
111expert_cleanup(void);
112
119extern void
121
127WS_DLL_PUBLIC int
129
135WS_DLL_PUBLIC void
136expert_update_comment_count(uint64_t count);
137
148WS_DLL_PUBLIC proto_item *
150
161WS_DLL_PUBLIC proto_item *
163 const char *format, ...) G_GNUC_PRINTF(4, 5);
164
177WS_DLL_PUBLIC proto_item *
179 tvbuff_t *tvb, unsigned start, unsigned length);
180
196WS_DLL_PUBLIC proto_item*
198 tvbuff_t* tvb, unsigned start);
199
219WS_DLL_PUBLIC proto_item *
221 tvbuff_t *tvb, unsigned start, unsigned length, const char *format, ...) G_GNUC_PRINTF(7, 8);
222
240WS_DLL_PUBLIC proto_item*
242 tvbuff_t* tvb, unsigned start, const char* format, ...) G_GNUC_PRINTF(6, 7);
243
249WS_DLL_PUBLIC expert_module_t *expert_register_protocol(int id);
250
255void expert_deregister_expertinfo (const char *abbrev);
256
262
267
276WS_DLL_PUBLIC const char* expert_get_summary(expert_field *eiindex);
277
284WS_DLL_PUBLIC void
285expert_register_field_array(expert_module_t *module, ei_register_info *ei, const int num_records);
286
287#define EXPERT_CHECKSUM_DISABLED -2
288#define EXPERT_CHECKSUM_UNKNOWN -1
289#define EXPERT_CHECKSUM_GOOD 0
290#define EXPERT_CHECKSUM_BAD 1
291
292WS_DLL_PUBLIC const value_string expert_group_vals[];
293
294WS_DLL_PUBLIC const value_string expert_severity_vals[];
295
296WS_DLL_PUBLIC const value_string expert_checksum_vals[];
297
298#ifdef __cplusplus
299}
300#endif /* __cplusplus */
301
302/*
303 * Editor modelines - https://www.wireshark.org/tools/modelines.html
304 *
305 * Local variables:
306 * c-basic-offset: 8
307 * tab-width: 8
308 * indent-tabs-mode: t
309 * End:
310 *
311 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
312 * :indentSize=8:tabSize=8:noTabs=false:
313 */
struct expert_info_s expert_info_t
Holds expert info data for a single packet event; used internally and for display purposes only.
void expert_init(void)
Initializes expert system.
Definition expert.c:269
WS_DLL_PUBLIC void expert_update_comment_count(uint64_t count)
Update the expert info comment count.
Definition expert.c:320
WS_DLL_PUBLIC void expert_register_field_array(expert_module_t *module, ei_register_info *ei, const int num_records)
Register a expert field array.
Definition expert.c:444
WS_DLL_PUBLIC proto_item * expert_add_info(packet_info *pinfo, proto_item *pi, expert_field *eiindex)
Add an expert info.
Definition expert.c:682
void expert_deregister_expertinfo(const char *abbrev)
Deregister a expert info.
Definition expert.c:342
WS_DLL_PUBLIC expert_module_t * expert_register_protocol(int id)
Register that a protocol has expert info.
Definition expert.c:327
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,...)
Add an expert info associated with some byte data.
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
void expert_packet_cleanup(void)
Cleans up resources used by expert processing.
Definition expert.c:280
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
WS_DLL_PUBLIC int expert_get_highest_severity(void)
Get the highest severity of expert information.
Definition expert.c:314
void expert_free_deregistered_expertinfos(void)
Free deregistered expert infos.
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)
Deregister expert info from a protocol.
Definition expert.c:354
WS_DLL_PUBLIC const char * expert_get_summary(expert_field *eiindex)
Get summary text of an expert_info field.
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)
Add an expert info associated with some byte data.
Definition expert.c:769
void expert_packet_init(void)
Initializes the expert system for each packet.
Definition expert.c:195
void expert_cleanup(void)
Cleans up resources used by expert processing.
Definition expert.c:285
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Definition proto.h:909
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33
Bundles an expert_field handle with its expert_field_info for use in bulk registration.
Definition expert.h:77
expert_field_info eiinfo
Definition expert.h:79
expert_field * ids
Definition expert.h:78
Describes a registered expert info field, including dissector-supplied metadata and registration stat...
Definition expert.h:53
int group
Definition expert.h:56
hf_register_info hf_info
Definition expert.h:65
const char * protocol
Definition expert.h:62
const char * name
Definition expert.h:55
int orig_severity
Definition expert.h:63
int id
Definition expert.h:61
int severity
Definition expert.h:57
struct expert_field_info * same_name_next
Definition expert.h:64
const char * summary
Definition expert.h:58
Pairs an expert info index with its associated header field index for registration and display.
Definition expert.h:41
int hf
Definition expert.h:43
int ei
Definition expert.h:42
Holds expert info data for a single packet event; used internally and for display purposes only.
Definition expert.h:26
proto_item * pitem
Definition expert.h:33
const char * protocol
Definition expert.h:31
int severity
Definition expert.h:29
int hf_index
Definition expert.h:30
char * summary
Definition expert.h:32
int group
Definition expert.h:28
uint32_t packet_num
Definition expert.h:27
Definition expert.c:48
Definition proto.h:804
Core tvbuff (testy virtual buffer) structure representing a region of packet data,...
Definition tvbuff-int.h:95