diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2022-12-18 09:10:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-18 08:10:57 +0000 |
commit | ad6bfbad4d0b8ae6c0c6b2d58c68eee542110e8a (patch) | |
tree | 999ca90928ef9c410807b1376ce7539beeec810c /src/lib/protocols/bittorrent.c | |
parent | fb0a73c0c7725fbeafda18b816d72f0d2fd6bd02 (diff) |
Add protocol disabling feature (#1808)
The application may enable only some protocols.
Disabling a protocol means:
*) don't register/use the protocol dissector code (if any)
*) disable classification by-port for such a protocol
*) disable string matchings for domains/certificates involving this protocol
*) disable subprotocol registration (if any)
This feature can be tested with `ndpiReader -B list_of_protocols_to_disable`.
Custom protocols are always enabled.
Technically speaking, this commit doesn't introduce any API/ABI
incompatibility. However, calling `ndpi_set_protocol_detection_bitmask2()`
is now mandatory, just after having called `ndpi_init_detection_module()`.
Most of the diffs (and all the diffs in `/src/lib/protocols/`) are due to
the removing of some function parameters.
Fix the low level macro `NDPI_LOG`. This issue hasn't been detected
sooner simply because almost all the code uses only the helpers `NDPI_LOG_*`
Diffstat (limited to 'src/lib/protocols/bittorrent.c')
-rw-r--r-- | src/lib/protocols/bittorrent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c index cac66b6be..c618ea905 100644 --- a/src/lib/protocols/bittorrent.c +++ b/src/lib/protocols/bittorrent.c @@ -575,9 +575,9 @@ static void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_str /* ************************************* */ void init_bittorrent_dissector(struct ndpi_detection_module_struct *ndpi_struct, - u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) + u_int32_t *id) { - ndpi_set_bitmask_protocol_detection("BitTorrent", ndpi_struct, detection_bitmask, *id, + ndpi_set_bitmask_protocol_detection("BitTorrent", ndpi_struct, *id, NDPI_PROTOCOL_BITTORRENT, ndpi_search_bittorrent, NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, |