diff options
author | Luca Deri <lucaderi@users.noreply.github.com> | 2024-04-18 23:21:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-18 23:21:40 +0200 |
commit | ad117bfaabd3bc75dc70d0ddbc4ba18c86c40dbd (patch) | |
tree | 3b1fb6016da1e114bca190ed6a868421fd9c32f1 /src/lib/third_party/include/shoco.h | |
parent | 108b8331d5b345e110c9ef110a6aa95a2767a640 (diff) |
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
Diffstat (limited to 'src/lib/third_party/include/shoco.h')
-rw-r--r-- | src/lib/third_party/include/shoco.h | 24 |
1 files changed, 24 insertions, 0 deletions
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 <stddef.h> + +#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 + + |