diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2024-07-03 18:02:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-03 18:02:07 +0200 |
commit | 843e4872706b07b9e78418986d35fc86bc156d60 (patch) | |
tree | 6198692542842324200ff783d5daf5398b5c92d0 /example/ndpiReader.c | |
parent | e5661337d07fb1f7b2d55318bfef0929e3ca6e61 (diff) |
Add infrastructure for explicit support of Fist Packet Classification (#2488)
Let's start with some basic helpers and with FPC based on flow addresses.
See: #2322
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r-- | example/ndpiReader.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index b79b2573b..dd908e5ce 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1747,6 +1747,24 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa flow->detected_protocol) ? "Encrypted" : "ClearText"); fprintf(out, "[Confidence: %s]", ndpi_confidence_get_name(flow->confidence)); + + if(flow->fpc.master_protocol == NDPI_PROTOCOL_UNKNOWN) { + fprintf(out, "[FPC: %u/%s, ", + flow->fpc.app_protocol, + ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, + flow->fpc.app_protocol)); + } else { + fprintf(out, "[FPC: %u.%u/%s.%s, ", + flow->fpc.master_protocol, + flow->fpc.app_protocol, + ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, + flow->fpc.master_protocol), + ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, + flow->fpc.app_protocol)); + } + fprintf(out, "Confidence: %s]", + ndpi_fpc_confidence_get_name(flow->fpc.confidence)); + /* If someone wants to have the num_dissector_calls variable per flow, he can print it here. Disabled by default to avoid too many diffs in the unit tests... */ |