From db6637d210b1e018bccacf350a668bf928d89064 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Sat, 3 May 2025 10:04:08 +0200 Subject: [PATCH] wip --- core.c | 2 +- cryptomod.c | 16 ++++++++-------- morep_simulator.c | 7 +++---- verbose.h | 16 ++++++++++++---- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/core.c b/core.c index 0d0c7a6..faf3da5 100644 --- a/core.c +++ b/core.c @@ -24,7 +24,7 @@ #include "core.h" -DECLARE_VERBOSE_LEVEL (coretools, 0); +DECLARE_VERBOSE_LEVEL (coretools, INFO); int get_cpu_number (void) { diff --git a/cryptomod.c b/cryptomod.c index afeb71f..ba1b419 100644 --- a/cryptomod.c +++ b/cryptomod.c @@ -14,7 +14,7 @@ /* depend: */ /* cflags: */ -/* linker: core.o morep.o parse.o pdu_channel.o pdu_encrypted_data.o pdu_prng_param.o pdu_status.o pdu_clear_data.o pdu_key.o pdu_raw_data.o task.o */ +/* linker: core.o function.o morep.o parse.o pdu_channel.o pdu_encrypted_data.o pdu_prng_param.o pdu_status.o pdu_clear_data.o pdu_key.o pdu_raw_data.o task.o */ #include #include @@ -26,27 +26,27 @@ #include "def.h" #include "cryptomod.h" +#include "function.h" #include "morep.h" #include "pdu_channel.h" -#include "pdu_encrypted_data.h" -#include "pdu_prng_param.h" -#include "pdu_status.h" #include "pdu_clear_data.h" +#include "pdu_encrypted_data.h" #include "pdu_key.h" +#include "pdu_prng_param.h" #include "pdu_raw_data.h" -#include "pdu_raw_data.h" +#include "pdu_status.h" #include "task.h" #include "verbose.h" char *progname = NULL; -int state = shutdowning_e; - DECLARE_VERBOSE_LEVEL (morep, INFO); DECLARE_VERBOSE_LEVEL (crypto, INFO); #define BUFMAX 4096 +extern state_t state; + #define NBSERVICES 10 char *services[NBSERVICES] = { "CROSS_CRYPTO_R2B", @@ -272,7 +272,7 @@ int main_thread (sub_task_t *s, int id) rc = random_func (&pdu_prng_param, &pdu_raw_data); break; case status_func_e: - rc = random_func (NULL, &pdu_status); + rc = status_func (NULL, &pdu_status); break; case authentification_func_e: rc = authentification_func (&pdu_raw_data, &pdu_raw_data); diff --git a/morep_simulator.c b/morep_simulator.c index 19aff59..d6c4343 100644 --- a/morep_simulator.c +++ b/morep_simulator.c @@ -28,13 +28,12 @@ #include "morep.h" #include "parse.h" #include "pdu_channel.h" -#include "pdu_encrypted_data.h" -#include "pdu_prng_param.h" -#include "pdu_status.h" #include "pdu_clear_data.h" +#include "pdu_encrypted_data.h" #include "pdu_key.h" +#include "pdu_prng_param.h" #include "pdu_raw_data.h" -#include "pdu_raw_data.h" +#include "pdu_status.h" #include "simulator.h" #include "verbose.h" diff --git a/verbose.h b/verbose.h index 0f91e24..b69fa30 100644 --- a/verbose.h +++ b/verbose.h @@ -126,15 +126,23 @@ __BEGIN_DECLS fflush (stream); \ } while (0) -__END_DECLS - /** Get error and waring call number. @param module module name - @return level verbose level + @return verbose errors */ -#define GET_VERBOSE_LEVEL(module) verbose_errors_##module +#define GET_VERBOSE_ERRORS(module) verbose_errors_##module + +/** + Get verbose level. + + @param module module name + @return verbose level +*/ +#define GET_VERBOSE_LEVEL(module) verbose_##module + +__END_DECLS #endif /* __VERBOSE_H__ */ -- 2.30.2