aboutsummaryrefslogtreecommitdiff
path: root/src/include/ndpi_api.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/ndpi_api.h.in')
-rw-r--r--src/include/ndpi_api.h.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/ndpi_api.h.in b/src/include/ndpi_api.h.in
index 38cd7edc1..9401731fa 100644
--- a/src/include/ndpi_api.h.in
+++ b/src/include/ndpi_api.h.in
@@ -1541,6 +1541,13 @@ extern "C" {
int ndpi_deserialize_clone_item(ndpi_deserializer *deserializer, ndpi_serializer *serializer);
int ndpi_deserialize_clone_all(ndpi_deserializer *deserializer, ndpi_serializer *serializer);
+ /*
+ * Escape a string to be suitable for a JSON value, adding double quotes, and terminating the string with a null byte.
+ * It is recommended to provide a destination buffer (dst) which is as large as double the source buffer (src) at least.
+ * Upon successful return, these functions return the number of characters printed (excluding the null byte used to terminate the string).
+ */
+ int ndpi_json_string_escape(const char *src, int src_len, char *dst, int dst_max_len);
+
/* Data analysis */
struct ndpi_analyze_struct* ndpi_alloc_data_analysis(u_int16_t _max_series_len);
void ndpi_init_data_analysis(struct ndpi_analyze_struct *s, u_int16_t _max_series_len);