| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
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/* XXX - This should probably be a string or custom dissector table */
20 extern GHashTable *json_header_fields_hash;
21
22/* json data decoding function
23 */
24 typedef void(*json_data_decoder_func)(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo, int offset, int len, const char* key_str);
25
26/* Array of functions to dissect IEs
27*/
28 typedef struct _json_ie {
29 json_data_decoder_func json_data_decoder;
30} json_ie_t;
31
32/* A struct to hold the hf and callback function stored in a hastable with the json key as key.
33 * If the callback is null NULL the filter will be used useful to create filterable items in json.
34 * XXX Todo: Implement hte UAT from the http dissector to enable the users to create filters? and/or
35 * read config from file, similar to Diameter(filter only)?
36 */
37 typedef struct {
38 int *hf_id;
39 json_data_decoder_func json_data_decoder;
40} json_data_decoder_t;
41
42 typedef struct _json_key {
43 int offset;
44 int len;
45 char* key_str;
46 bool use_compact;
47} json_key_t;
48
49#endif /* _PACKET_JSON_H */
50
51/*
52 * Editor modelines - https://www.wireshark.org/tools/modelines.html
53 *
54 * Local variables:
55 * c-basic-offset: 4
56 * tab-width: 8
57 * indent-tabs-mode: nil
58 * End:
59 *
60 * vi: set shiftwidth=4 tabstop=8 expandtab:
61 * :indentSize=4:tabSize=8:noTabs=true:
62 */
_json_ie
Definition packet-json.h:28
_json_key
Definition packet-json.h:42
_packet_info
Definition packet_info.h:43
_proto_node
Definition proto.h:907
json_data_decoder_t
Definition packet-json.h:37
tvbuff
Definition tvbuff-int.h:35