Exported HTTP server in metadata

This commit is contained in:
Luca Deri
2022-12-05 21:27:30 +01:00
parent c882120afd
commit e0afc16aa2
7 changed files with 26 additions and 4 deletions
+3
View File
@@ -1578,6 +1578,9 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
fprintf(out, "[Content-Type: %s]", flow->http.content_type);
}
if(flow->http.server[0] != '\0')
fprintf(out, "[Server: %s]", flow->http.server);
if(flow->http.user_agent[0] != '\0')
fprintf(out, "[User-Agent: %s]", flow->http.user_agent);
+1
View File
@@ -1214,6 +1214,7 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
ndpi_snprintf(flow->http.url, sizeof(flow->http.url), "%s", flow->ndpi_flow->http.url);
flow->http.response_status_code = flow->ndpi_flow->http.response_status_code;
ndpi_snprintf(flow->http.content_type, sizeof(flow->http.content_type), "%s", flow->ndpi_flow->http.content_type ? flow->ndpi_flow->http.content_type : "");
ndpi_snprintf(flow->http.server, sizeof(flow->http.server), "%s", flow->ndpi_flow->http.server ? flow->ndpi_flow->http.server : "");
ndpi_snprintf(flow->http.request_content_type, sizeof(flow->http.request_content_type), "%s", flow->ndpi_flow->http.request_content_type ? flow->ndpi_flow->http.request_content_type : "");
}
}
+1 -1
View File
@@ -275,7 +275,7 @@ typedef struct ndpi_flow_info {
} ssh_tls;
struct {
char url[256], request_content_type[64], content_type[64], user_agent[256];
char url[256], request_content_type[64], content_type[64], user_agent[256], server[128];
u_int response_status_code;
} http;