diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/ndpiReader.c | 5 | ||||
-rw-r--r-- | example/reader_util.c | 2 | ||||
-rw-r--r-- | example/reader_util.h | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 364ee6b50..268fea160 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1143,8 +1143,9 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa } if(flow->http.url[0] != '\0') - fprintf(out, "[URL: %s][StatusCode: %u]", - flow->http.url, flow->http.response_status_code); + fprintf(out, "[URL: %s][StatusCode: %u][ContentType: %s][UserAgent: %s]", + flow->http.url, flow->http.response_status_code, + flow->http.content_type, flow->http.user_agent); if(flow->ssh_tls.ssl_version != 0) fprintf(out, "[%s]", ndpi_ssl_version2str(flow->ssh_tls.ssl_version, &known_tls)); if(flow->ssh_tls.client_info[0] != '\0') fprintf(out, "[Client: %s]", flow->ssh_tls.client_info); diff --git a/example/reader_util.c b/example/reader_util.c index 3d9fde695..44e02616e 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -980,6 +980,8 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl if(flow->ndpi_flow->http.url != NULL) { 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; + snprintf(flow->http.content_type, sizeof(flow->http.content_type), "%s", flow->ndpi_flow->http.content_type ? flow->ndpi_flow->http.content_type : ""); + snprintf(flow->http.user_agent, sizeof(flow->http.user_agent), "%s", flow->ndpi_flow->http.user_agent ? flow->ndpi_flow->http.user_agent : ""); } } else if(is_ndpi_proto(flow, NDPI_PROTOCOL_TELNET)) { snprintf(flow->telnet.username, sizeof(flow->telnet.username), "%s", flow->ndpi_flow->protos.telnet.username); diff --git a/example/reader_util.h b/example/reader_util.h index 3ca584c18..93df6b03a 100644 --- a/example/reader_util.h +++ b/example/reader_util.h @@ -194,7 +194,7 @@ typedef struct ndpi_flow_info { } ssh_tls; struct { - char url[256]; + char url[256], content_type[64], user_agent[128]; u_int response_status_code; } http; |