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

Go to the source code of this file.

Macros

#define DBG_INFO(...)
 
#define DBG_WARN(...)
 
#define DBG_ERR(...)
 
#define DIN
 
#define DOUT
 

Functions

void yh_dbg_init (int dbg, int dinout, int libdbg, const char *debug_file)
 

Variables

int _YHP11_DBG
 
int _YHP11_DINOUT
 
FILE * _YHP11_OUTPUT
 

Macro Definition Documentation

◆ DBG_ERR

#define DBG_ERR ( ...)
Value:
do { \
DLN(_YHP11_DBG, _YHP11_OUTPUT, ANSI_RED, "P11", "ERR", __VA_ARGS__); \
} while (0)
#define ANSI_RED
Definition debug.h:32
FILE * _YHP11_OUTPUT
Definition debug_p11.c:25
int _YHP11_DBG
Definition debug_p11.c:23

Definition at line 41 of file debug_p11.h.

41#define DBG_ERR(...) \
42 do { \
43 DLN(_YHP11_DBG, _YHP11_OUTPUT, ANSI_RED, "P11", "ERR", __VA_ARGS__); \
44 } while (0)

◆ DBG_INFO

#define DBG_INFO ( ...)
Value:
do { \
DLN(_YHP11_DBG, _YHP11_OUTPUT, ANSI_BLUE, "P11", "INF", __VA_ARGS__); \
} while (0)
#define ANSI_BLUE
Definition debug.h:35

Definition at line 31 of file debug_p11.h.

31#define DBG_INFO(...) \
32 do { \
33 DLN(_YHP11_DBG, _YHP11_OUTPUT, ANSI_BLUE, "P11", "INF", __VA_ARGS__); \
34 } while (0)

◆ DBG_WARN

#define DBG_WARN ( ...)
Value:
do { \
DLN(_YHP11_DBG, _YHP11_OUTPUT, ANSI_YELLOW, "P11", "WRN", __VA_ARGS__); \
} while (0)
#define ANSI_YELLOW
Definition debug.h:34

Definition at line 36 of file debug_p11.h.

36#define DBG_WARN(...) \
37 do { \
38 DLN(_YHP11_DBG, _YHP11_OUTPUT, ANSI_YELLOW, "P11", "WRN", __VA_ARGS__); \
39 } while (0)

◆ DIN

#define DIN
Value:
do { \
DLN(_YHP11_DINOUT, _YHP11_OUTPUT, ANSI_BLUE, "P11", "INF", ("In")); \
} while (0)
int _YHP11_DINOUT
Definition debug_p11.c:24

Definition at line 46 of file debug_p11.h.

46#define DIN \
47 do { \
48 DLN(_YHP11_DINOUT, _YHP11_OUTPUT, ANSI_BLUE, "P11", "INF", ("In")); \
49 } while (0)

◆ DOUT

#define DOUT
Value:
do { \
DLN(_YHP11_DINOUT, _YHP11_OUTPUT, ANSI_BLUE, "P11", "INF", ("Out")); \
} while (0)

Definition at line 51 of file debug_p11.h.

51#define DOUT \
52 do { \
53 DLN(_YHP11_DINOUT, _YHP11_OUTPUT, ANSI_BLUE, "P11", "INF", ("Out")); \
54 } while (0)

Function Documentation

◆ yh_dbg_init()

void yh_dbg_init ( int dbg,
int dinout,
int libdbg,
const char * debug_file )

Definition at line 27 of file debug_p11.c.

27 {
28 if (_YHP11_OUTPUT != stderr && _YHP11_OUTPUT != stdout &&
29 _YHP11_OUTPUT != NULL) {
30 fclose(_YHP11_OUTPUT);
31 _YHP11_OUTPUT = stderr;
32 }
33 if (strcmp(debug_file, "stderr") == 0) {
34 _YHP11_OUTPUT = stderr;
35 } else if (strcmp(debug_file, "stdout") == 0) {
36 _YHP11_OUTPUT = stdout;
37 } else {
38 FILE *file = fopen(debug_file, "ab");
39 if (file) {
40 _YHP11_OUTPUT = file;
41 } else {
42 _YHP11_OUTPUT = stderr;
43 }
44 }
46 if (dbg || getenv("YUBIHSM_PKCS11_DBG")) {
47 _YHP11_DBG = 1;
48 }
49 if (dinout || getenv("YUBIHSM_PKCS11_DINOUT")) {
50 _YHP11_DINOUT = 1;
51 }
52 if (libdbg || getenv("YUBIHSM_LIB_DBG")) {
54 }
55}
FILE * _YHP11_OUTPUT
Definition debug_p11.c:25
int _YHP11_DBG
Definition debug_p11.c:23
int _YHP11_DINOUT
Definition debug_p11.c:24
yh_rc yh_set_verbosity(yh_connector *connector, uint8_t verbosity)
Definition yubihsm.c:3825
void yh_set_debug_output(yh_connector *connector, FILE *output)
Definition yubihsm.c:3848
#define YH_VERB_ALL
Debug level all. All previous options enabled.
Definition yubihsm.h:145
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ _YHP11_DBG

int _YHP11_DBG
extern

Definition at line 23 of file debug_p11.c.

◆ _YHP11_DINOUT

int _YHP11_DINOUT
extern

Definition at line 24 of file debug_p11.c.

◆ _YHP11_OUTPUT

FILE* _YHP11_OUTPUT
extern

Definition at line 25 of file debug_p11.c.