From 0223d3c4f5219910e0f7dc3c5f5b2c95df72dea7 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Fri, 5 May 2023 13:35:20 +0200 Subject: HTTP: improve extraction of metadata and of flow risks (#1959) --- example/ndpiReader.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'example/ndpiReader.c') diff --git a/example/ndpiReader.c b/example/ndpiReader.c index e51eea8f5..efa5bd666 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1638,15 +1638,20 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa if(risk != NDPI_NO_RISK) NDPI_SET_BIT(flow->risk, risk); - fprintf(out, "[URL: %s][StatusCode: %u]", - flow->http.url, flow->http.response_status_code); + fprintf(out, "[URL: %s]", flow->http.url); + } - if(flow->http.request_content_type[0] != '\0') - fprintf(out, "[Req Content-Type: %s]", flow->http.request_content_type); + if(flow->http.response_status_code) + fprintf(out, "[StatusCode: %u]", flow->http.response_status_code); - if(flow->http.content_type[0] != '\0') - fprintf(out, "[Content-Type: %s]", flow->http.content_type); - } + if(flow->http.request_content_type[0] != '\0') + fprintf(out, "[Req Content-Type: %s]", flow->http.request_content_type); + + if(flow->http.content_type[0] != '\0') + fprintf(out, "[Content-Type: %s]", flow->http.content_type); + + if(flow->http.nat_ip[0] != '\0') + fprintf(out, "[Nat-IP: %s]", flow->http.nat_ip); if(flow->http.server[0] != '\0') fprintf(out, "[Server: %s]", flow->http.server); -- cgit v1.2.3