aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/wsjson.h
diff options
context:
space:
mode:
authorPascal Quantin <pascal@wireshark.org>2019-06-16 12:40:14 +0200
committerPascal Quantin <pascal@wireshark.org>2019-06-16 11:30:24 +0000
commitbe3d469ddccf2295bf4fb5335e6116cd8d5303ee (patch)
treed9f491b06026beef12a044c7106fff0c6b6c7ace /wsutil/wsjson.h
parent3487b8f9c35932d4fa71f5b770278442d0047473 (diff)
NGAP: fix dissection of N2 Information Content
Change-Id: I8aaf578c8eb71533313cf2cfd42871eae0c0ff57 Reviewed-on: https://code.wireshark.org/review/33603 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Diffstat (limited to 'wsutil/wsjson.h')
-rw-r--r--wsutil/wsjson.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/wsutil/wsjson.h b/wsutil/wsjson.h
index 197e82eccf..165de1e743 100644
--- a/wsutil/wsjson.h
+++ b/wsutil/wsjson.h
@@ -30,6 +30,25 @@ WS_DLL_PUBLIC gboolean json_validate(const guint8 *buf, const size_t len);
WS_DLL_PUBLIC int json_parse(const char *buf, jsmntok_t *tokens, unsigned int max_tokens);
/**
+ * Get the pointer to an object belonging to parent object and named as the name variable.
+ * Returns NULL if not found.
+ */
+WS_DLL_PUBLIC jsmntok_t *json_get_object(const char *buf, jsmntok_t *parent, const gchar* name);
+
+/**
+ * Get the unescaped value of a string object belonging to parent object and named as the name variable.
+ * Returns NULL if not found. Caution: it modifies input buffer.
+ */
+WS_DLL_PUBLIC char *json_get_string(char *buf, jsmntok_t *parent, const gchar* name);
+
+/**
+ * Get the value of a number object belonging to parent object and named as the name variable.
+ * Returns FALSE if not found. Caution: it modifies input buffer.
+ * Scientific notation not supported yet.
+ */
+WS_DLL_PUBLIC gboolean json_get_double(char *buf, jsmntok_t *parent, const gchar* name, gdouble *val);
+
+/**
* Decode the contents of a JSON string value by overwriting the input data.
* Returns TRUE on success and FALSE if invalid characters were encountered.
*/