diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2023-05-05 13:35:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 13:35:20 +0200 |
commit | 0223d3c4f5219910e0f7dc3c5f5b2c95df72dea7 (patch) | |
tree | 4151ba9dc3c2c6a82e8d6adda2b4e3486527a3aa /example/ndpiReader.c | |
parent | 02a2c804530e21f3fd9ba05e68009eb64b35ba1b (diff) |
HTTP: improve extraction of metadata and of flow risks (#1959)
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r-- | example/ndpiReader.c | 19 |
1 files changed, 12 insertions, 7 deletions
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); |