From ad117bfaabd3bc75dc70d0ddbc4ba18c86c40dbd Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Thu, 18 Apr 2024 23:21:40 +0200 Subject: Domain Classification Improvements (#2396) * Added size_t ndpi_compress_str(const char * in, size_t len, char * out, size_t bufsize); size_t ndpi_decompress_str(const char * in, size_t len, char * out, size_t bufsize); used to compress short strings such as domain names. This code is based on https://github.com/Ed-von-Schleck/shoco * Major code rewrite for ndpi_hash and ndpi_domain_classify * Improvements to make sure custom categories are loaded and enabled * Fixed string encoding * Extended SalesForce/Cloudflare domains list --- src/lib/third_party/include/shoco.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/lib/third_party/include/shoco.h (limited to 'src/lib/third_party/include/shoco.h') diff --git a/src/lib/third_party/include/shoco.h b/src/lib/third_party/include/shoco.h new file mode 100644 index 000000000..0772ac656 --- /dev/null +++ b/src/lib/third_party/include/shoco.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#if defined(_MSC_VER) +#define shoco_restrict __restrict +#elif __GNUC__ +#define shoco_restrict __restrict__ +#else +#define shoco_restrict restrict +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +size_t shoco_compress(const char * const shoco_restrict in, size_t len, char * const shoco_restrict out, size_t bufsize); +size_t shoco_decompress(const char * const shoco_restrict in, size_t len, char * const shoco_restrict out, size_t bufsize); + +#ifdef __cplusplus +} +#endif + + -- cgit v1.2.3