From 9939b5c30775993941a4b9afe01ddc36434afbf1 Mon Sep 17 00:00:00 2001 From: lns Date: Fri, 5 Aug 2022 21:26:54 +0200 Subject: Add TiVoConnect dissector. Fixes #1697. * added static assert if supported, to complain if the flow struct changes Signed-off-by: lns --- src/include/ndpi_typedefs.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/include/ndpi_typedefs.h') diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index e8b688aee..502c7fe12 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -1447,6 +1447,13 @@ struct ndpi_flow_struct { u_int8_t primitive; /* GET, SET... */ u_int8_t error_status; } snmp; + + struct { + char identity_uuid[36]; + char machine[48]; + char platform[32]; + char services[48]; + } tivoconnect; } protos; /*** ALL protocol specific 64 bit variables here ***/ @@ -1524,6 +1531,17 @@ struct ndpi_flow_struct { u_int8_t priv_data[16]; }; +#if !defined(NDPI_CFFI_PREPROCESSING) && defined(__linux__) +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +_Static_assert(sizeof(((struct ndpi_flow_struct *)0)->protos) <= 200, + "Size of the struct member protocols increased to more than 200 bytes, " + "please check if this change is necessary."); +_Static_assert(sizeof(struct ndpi_flow_struct) <= 904, + "Size of the flow struct increased to more than 904 bytes, " + "please check if this change is necessary."); +#endif +#endif + #define NDPI_PROTOCOL_DEFAULT_LEVEL 0 typedef struct { -- cgit v1.2.3