diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-05-19 15:07:11 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-05-19 15:56:20 +0200 |
commit | db39772aa7b10ee6fb9e21db8f44c0f5fca7a1d2 (patch) | |
tree | 44997ae9b6efeae85286f7e0c04decf2f67f090a /examples | |
parent | 9ffaeef24d167bc1b99446bc07c7765c3375f776 (diff) |
Fixed CMake global CFLAGS misuse which can cause xcompile errors.
nDPIsrvd-captured supports skipping flows w/o any layer 4 payload.
* libndpi update
* run_tests does not generate any *.out files for fuzz-*.pcap anymore and
does not fail if nDPId-test exits with value 1 (most likely caused by a libpcap failure)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c-captured/c-captured.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/examples/c-captured/c-captured.c b/examples/c-captured/c-captured.c index 836cbd4c0..6ffb0296a 100644 --- a/examples/c-captured/c-captured.c +++ b/examples/c-captured/c-captured.c @@ -63,6 +63,7 @@ static uint8_t process_guessed = 0; static uint8_t process_undetected = 0; static uint8_t process_risky = 0; static uint8_t process_midstream = 0; +static uint8_t ignore_empty_flows = 0; static void packet_data_copy(void * dst, const void * src) { @@ -388,7 +389,12 @@ static enum nDPIsrvd_callback_return captured_json_callback(struct nDPIsrvd_sock return CALLBACK_OK; } + nDPIsrvd_ull total_l4_bytes = 0; + perror_ull(TOKEN_VALUE_TO_ULL(TOKEN_GET_SZ(sock, "flow_tot_l4_data_len"), &total_l4_bytes), + "flow_tot_l4_data_len"); + if (flow_user->detection_finished != 0 && + (total_l4_bytes > 0 || ignore_empty_flows == 0) && ((flow_user->guessed != 0 && process_guessed != 0) || (flow_user->detected == 0 && process_undetected != 0) || (flow_user->risky != 0 && process_risky != 0) || (flow_user->midstream != 0 && process_midstream != 0))) @@ -461,9 +467,10 @@ static int parse_options(int argc, char ** argv) "\t-G\tGuessed - Dump guessed flows to a PCAP file.\n" "\t-U\tUndetected - Dump undetected flows to a PCAP file.\n" "\t-R\tRisky - Dump risky flows to a PCAP file.\n" - "\t-M\tMidstream - Dump midstream flows to a PCAP file.\n"; + "\t-M\tMidstream - Dump midstream flows to a PCAP file.\n" + "\t-E\tEmpty - Ignore flows w/o any layer 4 payload\n"; - while ((opt = getopt(argc, argv, "hdp:s:r:u:g:D:GURM")) != -1) + while ((opt = getopt(argc, argv, "hdp:s:r:u:g:D:GURME")) != -1) { switch (opt) { @@ -509,6 +516,9 @@ static int parse_options(int argc, char ** argv) case 'M': process_midstream = 1; break; + case 'E': + ignore_empty_flows = 1; + break; default: fprintf(stderr, usage, argv[0]); return 1; |