Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
debug_lib.h File Reference
#include <stdint.h>
#include <stdio.h>
#include <sys/time.h>
#include <time.h>
#include "yubihsm.h"
#include "../common/debug.h"
Include dependency graph for debug_lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DUMPIF(var, len, lev)
 
#define DBG_INT(var, len, ...)
 
#define DBG_CRYPTO(var, len, ...)
 
#define DBG_NET(var, dump)
 
#define DBG_INFO(...)
 
#define DBG_DUMPINFO(var, len, ...)
 
#define DBG_ERR(...)
 
#define DBG_DUMPERR(var, len, ...)
 

Variables

uint8_t _yh_verbosity
 
FILE * _yh_output
 

Macro Definition Documentation

◆ DBG_CRYPTO

#define DBG_CRYPTO ( var,
len,
... )
Value:
do { \
__VA_ARGS__); \
DUMPIF(var, len, YH_VERB_CRYPTO); \
} while (0)
#define ANSI_GREEN
Definition debug.h:33
uint8_t _yh_verbosity
FILE * _yh_output
#define YH_VERB_CRYPTO
Debug level crypto. Crypto results printed out.
Definition yubihsm.h:137
size_t len

Definition at line 47 of file debug_lib.h.

47#define DBG_CRYPTO(var, len, ...) \
48 do { \
49 D(_yh_verbosity &YH_VERB_CRYPTO, _yh_output, ANSI_GREEN, "LIB", "CRY", \
50 __VA_ARGS__); \
51 DUMPIF(var, len, YH_VERB_CRYPTO); \
52 } while (0)

◆ DBG_DUMPERR

#define DBG_DUMPERR ( var,
len,
... )
Value:
do { \
__VA_ARGS__); \
DUMPIF(var, len, YH_VERB_ERR); \
} while (0)
#define ANSI_RED
Definition debug.h:32
#define YH_VERB_ERR
Debug level error. Error messages printed out.
Definition yubihsm.h:143

Definition at line 83 of file debug_lib.h.

83#define DBG_DUMPERR(var, len, ...) \
84 do { \
85 D(_yh_verbosity &YH_VERB_ERR, _yh_output, ANSI_RED, "LIB", "ERR", \
86 __VA_ARGS__); \
87 DUMPIF(var, len, YH_VERB_ERR); \
88 } while (0)

◆ DBG_DUMPINFO

#define DBG_DUMPINFO ( var,
len,
... )
Value:
do { \
__VA_ARGS__); \
DUMPIF(var, len, YH_VERB_INFO); \
} while (0)
#define ANSI_BLUE
Definition debug.h:35
#define YH_VERB_INFO
Debug level info. General information messages printed out.
Definition yubihsm.h:141

Definition at line 69 of file debug_lib.h.

69#define DBG_DUMPINFO(var, len, ...) \
70 do { \
71 D(_yh_verbosity &YH_VERB_INFO, _yh_output, ANSI_BLUE, "LIB", "INF", \
72 __VA_ARGS__); \
73 DUMPIF(var, len, YH_VERB_INFO); \
74 } while (0)

◆ DBG_ERR

#define DBG_ERR ( ...)
Value:
do { \
DLN(_yh_verbosity &YH_VERB_ERR, _yh_output, ANSI_RED, "LIB", "ERR", \
__VA_ARGS__); \
} while (0)

Definition at line 76 of file debug_lib.h.

76#define DBG_ERR(...) \
77 do { \
78 DLN(_yh_verbosity &YH_VERB_ERR, _yh_output, ANSI_RED, "LIB", "ERR", \
79 __VA_ARGS__); \
80 } while (0)

◆ DBG_INFO

#define DBG_INFO ( ...)
Value:
do { \
__VA_ARGS__); \
} while (0)

Definition at line 63 of file debug_lib.h.

63#define DBG_INFO(...) \
64 do { \
65 DLN(_yh_verbosity &YH_VERB_INFO, _yh_output, ANSI_BLUE, "LIB", "INF", \
66 __VA_ARGS__); \
67 } while (0)

◆ DBG_INT

#define DBG_INT ( var,
len,
... )
Value:
do { \
"INT", __VA_ARGS__); \
DUMPIF(var, len, YH_VERB_INTERMEDIATE); \
} while (0)
#define ANSI_YELLOW
Definition debug.h:34
#define YH_VERB_INTERMEDIATE
Debug level intermediate. Intermediate results printed out.
Definition yubihsm.h:135

Definition at line 40 of file debug_lib.h.

40#define DBG_INT(var, len, ...) \
41 do { \
42 D(_yh_verbosity &YH_VERB_INTERMEDIATE, _yh_output, ANSI_YELLOW, "LIB", \
43 "INT", __VA_ARGS__); \
44 DUMPIF(var, len, YH_VERB_INTERMEDIATE); \
45 } while (0)

◆ DBG_NET

#define DBG_NET ( var,
dump )
Value:
do { \
" "); \
dump(_yh_output, (var)); \
} \
} while (0)
#define ANSI_MAGENTA
Definition debug.h:36
#define YH_VERB_RAW
Debug level raw. Raw messages printed out.
Definition yubihsm.h:139

Definition at line 54 of file debug_lib.h.

54#define DBG_NET(var, dump) \
55 do { \
56 D(_yh_verbosity &YH_VERB_RAW, _yh_output, ANSI_MAGENTA, "LIB", "NET", \
57 " "); \
58 if (_yh_verbosity & YH_VERB_RAW) { \
59 dump(_yh_output, (var)); \
60 } \
61 } while (0)

◆ DUMPIF

#define DUMPIF ( var,
len,
lev )
Value:
do { \
if (_yh_verbosity & lev) { \
dump_hex(_yh_output, var, len); \
fprintf(_yh_output, "\n"); \
} \
} while (0)

Definition at line 32 of file debug_lib.h.

32#define DUMPIF(var, len, lev) \
33 do { \
34 if (_yh_verbosity & lev) { \
35 dump_hex(_yh_output, var, len); \
36 fprintf(_yh_output, "\n"); \
37 } \
38 } while (0)

Variable Documentation

◆ _yh_output

FILE* _yh_output
extern

Definition at line 28 of file test_usb_url.c.

◆ _yh_verbosity

uint8_t _yh_verbosity
extern

Definition at line 27 of file test_usb_url.c.