From adcebcc31b7bf94160cd17cf836378c64d8ec3b7 Mon Sep 17 00:00:00 2001 From: jeka Date: Wed, 25 Mar 2026 20:35:45 +0300 Subject: [PATCH] 1 --- lib/debug_config.c | 1 + lib/debug_config.h | 3 ++- src/config_parser.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/debug_config.c b/lib/debug_config.c index 70d770e..20abe2c 100644 --- a/lib/debug_config.c +++ b/lib/debug_config.c @@ -82,6 +82,7 @@ static debug_category_t get_category_by_name(const char* name) { {"control", DEBUG_CATEGORY_CONTROL}, {"dump", DEBUG_CATEGORY_DUMP}, {"traffic", DEBUG_CATEGORY_TRAFFIC}, + {"debug", DEBUG_CATEGORY_DEBUG}, {"all", DEBUG_CATEGORY_ALL}, {NULL, 0} }; diff --git a/lib/debug_config.h b/lib/debug_config.h index 3d23c47..9f1643e 100644 --- a/lib/debug_config.h +++ b/lib/debug_config.h @@ -53,7 +53,8 @@ typedef uint64_t debug_category_t; #define DEBUG_CATEGORY_CONTROL ((debug_category_t)1 << 14) // Control/monitoring server #define DEBUG_CATEGORY_DUMP ((debug_category_t)1 << 15) // Packet dump/logging #define DEBUG_CATEGORY_TRAFFIC ((debug_category_t)1 << 16) // Traffic flow (src/dst node IDs) -#define DEBUG_CATEGORY_COUNT 17 // Total number of categories +#define DEBUG_CATEGORY_DEBUG ((debug_category_t)1 << 17) // Current debugging +#define DEBUG_CATEGORY_COUNT 18 // Total number of categories #define DEBUG_CATEGORY_ALL ((debug_category_t)0xFFFFFFFFUL) /* Debug configuration structure */ diff --git a/src/config_parser.c b/src/config_parser.c index a6330d5..fc5d2d3 100644 --- a/src/config_parser.c +++ b/src/config_parser.c @@ -68,6 +68,8 @@ static uint32_t parse_debug_categories(const char *value) { categories |= DEBUG_CATEGORY_TIMERS; } else if (strstr(token, "traffic")) { categories |= DEBUG_CATEGORY_TRAFFIC; + } else if (strstr(token, "debug")) { + categories |= DEBUG_CATEGORY_DEBUG; } else if (strstr(token, "all")) { categories |= DEBUG_CATEGORY_ALL; } else if (strstr(token, "none")) {