Wireshark  4.3.0
The Wireshark network protocol analyzer
packet-json.h
1 /* packet-json.h
2  * Routines for JSON dissection
3  * References:
4  * RFC 4627: https://tools.ietf.org/html/rfc4627
5  * Website: http://json.org/
6  *
7  * Copyright 2010, Jakub Zawadzki <darkjames-ws@darkjames.pl>
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald@wireshark.org>
11  * Copyright 1998 Gerald Combs
12  *
13  * SPDX-License-Identifier: GPL-2.0-or-later
14  */
15 
16 #ifndef _PACKET_JSON_H
17 #define _PACKET_JSON_H
18 
19 extern GHashTable *json_header_fields_hash;
20 
21 /* json data decoding function
22  */
23 typedef void(*json_data_decoder_func)(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo, int offset, int len, const char* key_str, gboolean use_compact);
24 
25 /* Array of functions to dissect IEs
26 */
27 typedef struct _json_ie {
28  json_data_decoder_func json_data_decoder;
29 } json_ie_t;
30 
31 /* A struct to hold the hf and callback function stored in a hastable with the json key as key.
32  * If the callback is null NULL the filter will be used useful to create filterable items in json.
33  * XXX Todo: Implement hte UAT from the http dissector to enable the users to create filters? and/or
34  * read config from file, similar to Diameter(filter only)?
35  */
36 typedef struct {
37  int *hf_id;
38  json_data_decoder_func json_data_decoder;
40 
41 typedef struct _json_key {
42  int offset;
43  int len;
44  char* key_str;
45  gboolean use_compact;
46 } json_key_t;
47 
48 #endif /* _PACKET_JSON_H */
49 
50 /*
51  * Editor modelines - https://www.wireshark.org/tools/modelines.html
52  *
53  * Local variables:
54  * c-basic-offset: 4
55  * tab-width: 8
56  * indent-tabs-mode: nil
57  * End:
58  *
59  * vi: set shiftwidth=4 tabstop=8 expandtab:
60  * :indentSize=4:tabSize=8:noTabs=true:
61  */
Definition: packet-json.h:27
Definition: packet-json.h:41
Definition: packet_info.h:44
Definition: proto.h:897
Definition: packet-json.h:36
Definition: tvbuff-int.h:35