diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-08-15 22:55:19 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-08-15 22:55:19 +0200 |
commit | 0fd59f060e97b558cf0fdd905817945b782845aa (patch) | |
tree | b41969e5503856d8abdd8d3302c960d36eddd454 /examples/c-collectd | |
parent | 905545487d9f44970fe36b75de467f8b6f78302a (diff) |
Split `*_l4_payload_len' into `*_src_l4_payload_len' and `*_dst_l4_payload_len'.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/c-collectd')
-rw-r--r-- | examples/c-collectd/c-collectd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/c-collectd/c-collectd.c b/examples/c-collectd/c-collectd.c index b4c83d795..e46a50508 100644 --- a/examples/c-collectd/c-collectd.c +++ b/examples/c-collectd/c-collectd.c @@ -424,11 +424,12 @@ static int mainloop(int epollfd, struct nDPIsrvd_socket * const sock) static uint64_t get_total_flow_bytes(struct nDPIsrvd_socket * const sock) { - nDPIsrvd_ull total_bytes_ull = 0; + nDPIsrvd_ull total_bytes_ull[2] = {0, 0}; - if (TOKEN_VALUE_TO_ULL(TOKEN_GET_SZ(sock, "flow_tot_l4_payload_len"), &total_bytes_ull) == CONVERSION_OK) + if (TOKEN_VALUE_TO_ULL(TOKEN_GET_SZ(sock, "flow_src_tot_l4_payload_len"), &total_bytes_ull[0]) == CONVERSION_OK && + TOKEN_VALUE_TO_ULL(TOKEN_GET_SZ(sock, "flow_dst_tot_l4_payload_len"), &total_bytes_ull[1]) == CONVERSION_OK) { - return total_bytes_ull; + return total_bytes_ull[0] + total_bytes_ull[1]; } else { |