aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-json.h
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-json.h')
-rw-r--r--epan/dissectors/packet-json.h61
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 0000000000..b334b1e71d
--- /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:
+ */