aboutsummaryrefslogtreecommitdiff
path: root/src/include/ndpi_win32.h
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2023-07-26 09:09:12 +0200
committerGitHub <noreply@github.com>2023-07-26 09:09:12 +0200
commit3326fa258ec92e553e39fc8a1bfa3921dc81f15c (patch)
treefcd0e725b7b5a8d13db1654a9b0864651c642f00 /src/include/ndpi_win32.h
parent2b230e28e0612e8654ad617534deb9aaaabd51b7 (diff)
Add an heuristic to detect fully encrypted flows (#2058)
A fully encrypted session is a flow where every bytes of the payload is encrypted in an attempt to “look like nothing”. The heuristic needs only the very first packet of the flow. See: https://www.usenix.org/system/files/sec23fall-prepub-234-wu-mingshi.pdf A basic, but generic, inplementation of the popcpunt alg has been added
Diffstat (limited to 'src/include/ndpi_win32.h')
-rw-r--r--src/include/ndpi_win32.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/ndpi_win32.h b/src/include/ndpi_win32.h
index 721ba48a4..2ad8602aa 100644
--- a/src/include/ndpi_win32.h
+++ b/src/include/ndpi_win32.h
@@ -78,4 +78,9 @@ typedef unsigned __int64 u_int64_t;
/* https://stackoverflow.com/questions/7993050/multiplatform-atomic-increment */
#define __sync_fetch_and_add(a,b) InterlockedExchangeAdd ((a), b)
+#if defined(WIN32) || defined(WIN64)
+#include <intrin.h>
+#define __builtin_popcount __popcnt
+#endif
+
#endif /* __NDPI_WIN32_H__ */