diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-02-06 16:01:54 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-02-06 16:01:54 +0100 |
commit | 7218990e5826e4179fcb6360ef8e087fcc45467a (patch) | |
tree | 7c3ff78bcd08a95f819321ca87f508b95d774cde /examples | |
parent | 69b4e662c773c3cfdad29035e7668457e5960c99 (diff) |
Removed superfluous nDPI (header) dependency for examples/c-captured. Use header definitions from libc instead.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c-captured/c-captured.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/c-captured/c-captured.c b/examples/c-captured/c-captured.c index 316cc97d3..d0e60521d 100644 --- a/examples/c-captured/c-captured.c +++ b/examples/c-captured/c-captured.c @@ -1,7 +1,8 @@ #include <arpa/inet.h> #include <errno.h> -#include <ndpi_main.h> -#include <ndpi_typedefs.h> +#include <netinet/ip_icmp.h> +#include <netinet/tcp.h> +#include <netinet/udp.h> #include <pcap/pcap.h> #include <signal.h> #include <stdio.h> @@ -278,16 +279,14 @@ static enum nDPIsrvd_callback_return captured_json_callback(struct nDPIsrvd_sock struct nDPIsrvd_json_token const * const l4_proto = TOKEN_GET_SZ(sock, "l4_proto"); if (TOKEN_VALUE_EQUALS_SZ(l4_proto, "tcp") != 0) { - flow_user->flow_l4_header_len = sizeof(struct ndpi_tcphdr); + flow_user->flow_l4_header_len = sizeof(struct tcphdr); } else if (TOKEN_VALUE_EQUALS_SZ(l4_proto, "udp") != 0) { - flow_user->flow_l4_header_len = sizeof(struct ndpi_udphdr); - } else if (TOKEN_VALUE_EQUALS_SZ(l4_proto, "icmp") != 0) + flow_user->flow_l4_header_len = sizeof(struct udphdr); + } else if (TOKEN_VALUE_EQUALS_SZ(l4_proto, "icmp") != 0 || + TOKEN_VALUE_EQUALS_SZ(l4_proto, "icmp6") != 0) { - flow_user->flow_l4_header_len = sizeof(struct ndpi_icmphdr); - } else if (TOKEN_VALUE_EQUALS_SZ(l4_proto, "icmp6") != 0) - { - flow_user->flow_l4_header_len = sizeof(struct ndpi_icmp6hdr); + flow_user->flow_l4_header_len = sizeof(struct icmphdr); } flow_user->flow_new_seen = 1; |