diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /epan/dissectors/packet-json.h | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-json.h')
-rw-r--r-- | epan/dissectors/packet-json.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/epan/dissectors/packet-json.h b/epan/dissectors/packet-json.h new file mode 100644 index 0000000..b334b1e --- /dev/null +++ b/epan/dissectors/packet-json.h @@ -0,0 +1,61 @@ +/* packet-json.h + * Routines for JSON dissection + * References: + * RFC 4627: https://tools.ietf.org/html/rfc4627 + * Website: http://json.org/ + * + * Copyright 2010, Jakub Zawadzki <darkjames-ws@darkjames.pl> + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _PACKET_JSON_H +#define _PACKET_JSON_H + +extern GHashTable *json_header_fields_hash; + +/* json data decoding function + */ +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); + +/* Array of functions to dissect IEs +*/ +typedef struct _json_ie { + json_data_decoder_func json_data_decoder; +} json_ie_t; + +/* A struct to hold the hf and callback function stored in a hastable with the json key as key. + * If the callback is null NULL the filter will be used useful to create filterable items in json. + * XXX Todo: Implement hte UAT from the http dissector to enable the users to create filters? and/or + * read config from file, similar to Diameter(filter only)? + */ +typedef struct { + int *hf_id; + json_data_decoder_func json_data_decoder; +} json_data_decoder_t; + +typedef struct _json_key { + int offset; + int len; + char* key_str; + gboolean use_compact; +} json_key_t; + +#endif /* _PACKET_JSON_H */ + +/* + * Editor modelines - https://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ |