diff options
author | Toni <matzeton@googlemail.com> | 2022-09-06 11:38:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 11:38:31 +0200 |
commit | 37f918322c0a489b5143a987c8f1a44a6f78a6f3 (patch) | |
tree | e2e1897b20ab2cab1868fde902c0576dcccd8457 /src/lib/ndpi_utils.c | |
parent | e5063f9883790f245bf87e26455255213faf728e (diff) |
Serialize nDPI detection/dissection data as object. (#1725)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/ndpi_utils.c')
-rw-r--r-- | src/lib/ndpi_utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index 2653a8f83..b86313c75 100644 --- a/src/lib/ndpi_utils.c +++ b/src/lib/ndpi_utils.c @@ -1198,7 +1198,6 @@ void ndpi_serialize_proto(struct ndpi_detection_module_struct *ndpi_struct, { char buf[64]; - ndpi_serialize_start_of_block(serializer, "ndpi"); ndpi_serialize_risk(serializer, risk); ndpi_serialize_confidence(serializer, confidence); ndpi_serialize_string_string(serializer, "proto", ndpi_protocol2name(ndpi_struct, l7_protocol, buf, sizeof(buf))); @@ -1213,7 +1212,6 @@ void ndpi_serialize_proto(struct ndpi_detection_module_struct *ndpi_struct, ndpi_serialize_string_uint32(serializer, "category_id", l7_protocol.category); ndpi_serialize_string_string(serializer, "category", ndpi_category_get_name(ndpi_struct, l7_protocol.category)); } - ndpi_serialize_end_of_block(serializer); } /* ********************************** */ @@ -1314,6 +1312,7 @@ int ndpi_dpi2json(struct ndpi_detection_module_struct *ndpi_struct, if(flow == NULL) return(-1); + ndpi_serialize_start_of_block(serializer, "ndpi"); ndpi_serialize_proto(ndpi_struct, serializer, flow->risk, flow->confidence, l7_protocol); host_server_name = ndpi_get_flow_info(flow, &l7_protocol); @@ -1522,6 +1521,8 @@ int ndpi_dpi2json(struct ndpi_detection_module_struct *ndpi_struct, break; } /* switch */ + ndpi_serialize_end_of_block(serializer); // "ndpi" + return(0); } |