diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ndpi_api.h | 26 | ||||
-rw-r--r-- | src/include/ndpi_define.h.in | 1 | ||||
-rw-r--r-- | src/include/ndpi_private.h | 1 | ||||
-rw-r--r-- | src/include/ndpi_protocol_ids.h | 1 | ||||
-rw-r--r-- | src/include/ndpi_replace_printf.h | 56 | ||||
-rw-r--r-- | src/include/ndpi_typedefs.h | 6 |
6 files changed, 76 insertions, 15 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index 7939abfe2..38fac3add 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -1991,18 +1991,16 @@ extern "C" { */ ndpi_bitmap* ndpi_bitmap_alloc(void); - ndpi_bitmap* ndpi_bitmap_alloc_size(u_int32_t size); void ndpi_bitmap_free(ndpi_bitmap* b); ndpi_bitmap* ndpi_bitmap_copy(ndpi_bitmap* b); u_int64_t ndpi_bitmap_cardinality(ndpi_bitmap* b); bool ndpi_bitmap_is_empty(ndpi_bitmap* b); - void ndpi_bitmap_set(ndpi_bitmap* b, u_int32_t value); - void ndpi_bitmap_unset(ndpi_bitmap* b, u_int32_t value); - bool ndpi_bitmap_isset(ndpi_bitmap* b, u_int32_t value); - void ndpi_bitmap_clear(ndpi_bitmap* b); + void ndpi_bitmap_set(ndpi_bitmap* b, u_int64_t value); + void ndpi_bitmap_unset(ndpi_bitmap* b, u_int64_t value); + bool ndpi_bitmap_isset(ndpi_bitmap* b, u_int64_t value); size_t ndpi_bitmap_serialize(ndpi_bitmap* b, char **buf); - ndpi_bitmap* ndpi_bitmap_deserialize(char *buf); + ndpi_bitmap* ndpi_bitmap_deserialize(char *buf, size_t buf_len); void ndpi_bitmap_and(ndpi_bitmap* a, ndpi_bitmap* b_and); ndpi_bitmap* ndpi_bitmap_and_alloc(ndpi_bitmap* a, ndpi_bitmap* b_and); @@ -2014,7 +2012,7 @@ extern "C" { ndpi_bitmap_iterator* ndpi_bitmap_iterator_alloc(ndpi_bitmap* b); void ndpi_bitmap_iterator_free(ndpi_bitmap* b); - bool ndpi_bitmap_iterator_next(ndpi_bitmap_iterator* i, u_int32_t *value); + bool ndpi_bitmap_iterator_next(ndpi_bitmap_iterator* i, u_int64_t *value); /* ******************************* */ @@ -2024,16 +2022,16 @@ extern "C" { This is - a probabilistic datastructure !!! (i.e. be prepared to false positives) - - immutable (i.e. adding keys after a search (i.e. ndpi_bitmap64_isset) + - immutable (i.e. adding keys after a search (i.e. ndpi_bitmap64_fuse_isset) is not allowed */ - ndpi_bitmap64* ndpi_bitmap64_alloc(void); - bool ndpi_bitmap64_set(ndpi_bitmap64 *b, u_int64_t value); - bool ndpi_bitmap64_compress(ndpi_bitmap64 *b); - bool ndpi_bitmap64_isset(ndpi_bitmap64 *b, u_int64_t value); - void ndpi_bitmap64_free(ndpi_bitmap64 *b); - u_int32_t ndpi_bitmap64_size(ndpi_bitmap64 *b); + ndpi_bitmap64_fuse* ndpi_bitmap64_fuse_alloc(void); + bool ndpi_bitmap64_fuse_set(ndpi_bitmap64_fuse *b, u_int64_t value); + bool ndpi_bitmap64_fuse_compress(ndpi_bitmap64_fuse *b); + bool ndpi_bitmap64_fuse_isset(ndpi_bitmap64_fuse *b, u_int64_t value); + void ndpi_bitmap64_fuse_free(ndpi_bitmap64_fuse *b); + u_int32_t ndpi_bitmap64_fuse_size(ndpi_bitmap64_fuse *b); /* ******************************* */ diff --git a/src/include/ndpi_define.h.in b/src/include/ndpi_define.h.in index f23335974..02ffe057b 100644 --- a/src/include/ndpi_define.h.in +++ b/src/include/ndpi_define.h.in @@ -176,6 +176,7 @@ #define get_u_int32_t(X,O) (*(u_int32_t *)((&(((u_int8_t *)X)[O])))) #if defined(__arm__) #include <stdint.h> +#include <string.h> static inline uint64_t get_u_int64_t(const uint8_t* X, int O) { uint64_t tmp; diff --git a/src/include/ndpi_private.h b/src/include/ndpi_private.h index e7eae9641..b26803a3c 100644 --- a/src/include/ndpi_private.h +++ b/src/include/ndpi_private.h @@ -910,6 +910,7 @@ void init_netease_games_dissector(struct ndpi_detection_module_struct *ndpi_stru void init_pathofexile_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id); void init_pfcp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id); void init_flute_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id); +void init_lolwildrift_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id); #endif diff --git a/src/include/ndpi_protocol_ids.h b/src/include/ndpi_protocol_ids.h index 95ccd9f37..a84bda3f1 100644 --- a/src/include/ndpi_protocol_ids.h +++ b/src/include/ndpi_protocol_ids.h @@ -435,6 +435,7 @@ typedef enum { NDPI_PROTOCOL_GOOGLE_CALL = 404, /* Voip/audio/video calls from Google Chat/Meet/... */ NDPI_PROTOCOL_PFCP = 405, NDPI_PROTOCOL_FLUTE = 406, + NDPI_PROTOCOL_LOLWILDRIFT = 407, #ifdef CUSTOM_NDPI_PROTOCOLS #include "../../../nDPI-custom/custom_ndpi_protocol_ids.h" diff --git a/src/include/ndpi_replace_printf.h b/src/include/ndpi_replace_printf.h new file mode 100644 index 000000000..73313386c --- /dev/null +++ b/src/include/ndpi_replace_printf.h @@ -0,0 +1,56 @@ +/* + * ndpi_replace_printf.h + * + * Copyright (C) 2023 - ntop.org and contributors + * + * This file is part of nDPI, an open source deep packet inspection + * library based on the OpenDPI and PACE technology by ipoque GmbH + * + * nDPI is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * nDPI is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with nDPI. If not, see <http://www.gnu.org/licenses/>. + * + */ + +// This file may be included in every *.c file that uses printf(...) except for ndpi_main.c ! + +#include "ndpi_config.h" + +#ifndef NDPI_CFFI_PREPROCESSING + +#undef printf +#undef fprintf + +#include "ndpi_typedefs.h" + +#ifdef NDPI_ENABLE_DEBUG_MESSAGES + +#define printf(...) ndpi_debug_printf(0, NULL, NDPI_LOG_DEBUG_EXTRA, __FILE__, __func__, __LINE__, __VA_ARGS__) + +#ifdef NDPI_REPLACE_FPRINTF +#define fprintf(stream, ...) ndpi_debug_printf(0, NULL, NDPI_LOG_ERROR, __FILE__, __func__, __LINE__, __VA_ARGS__) +#endif + +#else + +#define printf(...) do {} while(0); + +#ifdef NDPI_REPLACE_FPRINTF +#define fprintf(stream, ...) do {} while(0); +#endif + +#endif + +void ndpi_debug_printf(unsigned int proto, struct ndpi_detection_module_struct *ndpi_str, ndpi_log_level_t log_level, + const char *file_name, const char *func_name, int line_number, const char *format, ...); + +#endif diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 8ac1516a9..f8ac2383a 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -911,6 +911,9 @@ struct ndpi_flow_udp_struct { u_int32_t quic_0rtt_found:1; u_int32_t quic_vn_pair:1; + /* NDPI_PROTOCOL_LOLWILDRIFT */ + u_int32_t lolwildrift_stage:1; + /* NDPI_PROTOCOL_EPICGAMES */ u_int32_t epicgames_stage:1; u_int32_t epicgames_word; @@ -1141,6 +1144,7 @@ typedef struct ndpi_proto { typedef void ndpi_bitmap; typedef void ndpi_bitmap64; +typedef void ndpi_bitmap64_fuse; /* probabilistic */ typedef void ndpi_bitmap_iterator; typedef void ndpi_filter; @@ -1155,7 +1159,7 @@ typedef struct { typedef struct { struct { u_int16_t class_id; - ndpi_bitmap64 *domains; + ndpi_bitmap64_fuse *domains; } classes[MAX_NUM_NDPI_DOMAIN_CLASSIFICATIONS]; } ndpi_domain_classify; |