diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2025-05-19 21:18:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-19 21:18:18 +0200 |
commit | fd89c81b83ac215ba838b66c57f5a6beee2dec6a (patch) | |
tree | 5621c3ee2b741db74846383d09ff35459c41e6a5 /src/include/ndpi_typedefs.h | |
parent | 31a8d4307e11e0ccd6ca11b03f7812183514751e (diff) |
Flow: keep track of "dissectors" (#2828)
In the flow, we should keep track of state of "dissectors", not
"protocols". This way, flow structure doesn't depend anymore on
the max number of protocols.
This is also the first step into fixing #2136
Diffstat (limited to 'src/include/ndpi_typedefs.h')
-rw-r--r-- | src/include/ndpi_typedefs.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 3d40a15a9..6abe3b713 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -272,6 +272,18 @@ typedef struct ndpi_protocol_bitmask_struct { ndpi_ndpi_mask fds_bits[NDPI_NUM_FDS_BITS]; } ndpi_protocol_bitmask_struct_t; + +#define NDPI_MAX_NUM_DISSECTORS 288 /* Multiple of 32, i.e. 8 * sizeof(ndpi_ndpi_mask) */ +#ifdef NDPI_CFFI_PREPROCESSING +#undef NDPI_NUM_FDS_BITS +#define NDPI_NUM_FDS_BITS_DISSECTORS 9 +#else +#define NDPI_NUM_FDS_BITS_DISSECTORS NDPI_MAX_NUM_DISSECTORS / (8 * sizeof(ndpi_ndpi_mask)) +#endif +typedef struct ndpi_dissector_bitmask_struct { + ndpi_ndpi_mask fds_bits[NDPI_NUM_FDS_BITS_DISSECTORS]; +} ndpi_dissector_bitmask_struct_t; + struct ndpi_detection_module_struct; /* NDPI_DEBUG_FUNCTION_PTR (cast) */ @@ -1191,7 +1203,7 @@ typedef struct ndpi_proto_defaults { u_int8_t isClearTextProto:1, isAppProtocol:1, _notused:6; u_int16_t *subprotocols; u_int32_t subprotocol_count; - u_int16_t protoId, protoIdx; + u_int16_t protoId, dissector_idx; u_int16_t tcp_default_ports[MAX_DEFAULT_PORTS], udp_default_ports[MAX_DEFAULT_PORTS]; ndpi_protocol_breed_t protoBreed; ndpi_protocol_qoe_category_t qoeCategory; @@ -1630,8 +1642,7 @@ struct ndpi_flow_struct { /* **Packet** metadata for flows where monitoring is enabled. It is reset after each packet! */ struct ndpi_metadata_monitoring *monit; - /* protocols which have marked a connection as this connection cannot be protocol XXX, multiple u_int64_t */ - NDPI_PROTOCOL_BITMASK excluded_protocol_bitmask; + NDPI_DISSECTOR_BITMASK excluded_dissectors_bitmask; /* NDPI_PROTOCOL_BITTORRENT */ u_int8_t bittorrent_stage; // can be 0 - 255 |