wip
authorLaurent Mazet <mazet@softndesign.org>
Sat, 3 May 2025 08:04:08 +0000 (10:04 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Sat, 3 May 2025 08:04:08 +0000 (10:04 +0200)
core.c
cryptomod.c
morep_simulator.c
verbose.h

diff --git a/core.c b/core.c
index 0d0c7a68db7312dcabc034cedc78836b6dc21e4a..faf3da5ccfc68b79169dec134bab7e804a5e8aa4 100644 (file)
--- 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)
 {
index afeb71f6e68fa2316a38338332a253f64620dfa4..ba1b419fce5a7f95f38f9109dfe0f3c880a357c7 100644 (file)
@@ -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 <errno.h>
 #include <signal.h>
 
 #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);
index 19aff5967051cbe46b57cc64e435da8320b6f78a..d6c43437b6812771e182e22990be6555b6fa14de 100644 (file)
 #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"
 
index 0f91e2456c4470cc14101209d5ed0233f7d56053..b69fa306b34153c326f871fe7b5be9c1c4f3794a 100644 (file)
--- 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__ */