API Documentation (Doxygen generated)

These pages are generated with doxygen directly from the source code!

debug.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_DEBUG_H
28 #define POLARSSL_DEBUG_H
29 
30 #include "config.h"
31 #include "ssl.h"
32 #if defined(POLARSSL_ECP_C)
33 #include "ecp.h"
34 #endif
35 
36 #if defined(POLARSSL_DEBUG_C)
37 
38 #define SSL_DEBUG_MSG( level, args ) \
39  debug_print_msg( ssl, level, __FILE__, __LINE__, debug_fmt args );
40 
41 #define SSL_DEBUG_RET( level, text, ret ) \
42  debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret );
43 
44 #define SSL_DEBUG_BUF( level, text, buf, len ) \
45  debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len );
46 
47 #if defined(POLARSSL_BIGNUM_C)
48 #define SSL_DEBUG_MPI( level, text, X ) \
49  debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X );
50 #endif
51 
52 #if defined(POLARSSL_ECP_C)
53 #define SSL_DEBUG_ECP( level, text, X ) \
54  debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X );
55 #endif
56 
57 #if defined(POLARSSL_X509_CRT_PARSE_C)
58 #define SSL_DEBUG_CRT( level, text, crt ) \
59  debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt );
60 #endif
61 
62 #else
63 
64 #define SSL_DEBUG_MSG( level, args ) do { } while( 0 )
65 #define SSL_DEBUG_RET( level, text, ret ) do { } while( 0 )
66 #define SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 )
67 #define SSL_DEBUG_MPI( level, text, X ) do { } while( 0 )
68 #define SSL_DEBUG_ECP( level, text, X ) do { } while( 0 )
69 #define SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 )
70 
71 #endif
72 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
77 char *debug_fmt( const char *format, ... );
78 
79 void debug_print_msg( const ssl_context *ssl, int level,
80  const char *file, int line, const char *text );
81 
82 void debug_print_ret( const ssl_context *ssl, int level,
83  const char *file, int line,
84  const char *text, int ret );
85 
86 void debug_print_buf( const ssl_context *ssl, int level,
87  const char *file, int line, const char *text,
88  unsigned char *buf, size_t len );
89 
90 #if defined(POLARSSL_BIGNUM_C)
91 void debug_print_mpi( const ssl_context *ssl, int level,
92  const char *file, int line,
93  const char *text, const mpi *X );
94 #endif
95 
96 #if defined(POLARSSL_ECP_C)
97 void debug_print_ecp( const ssl_context *ssl, int level,
98  const char *file, int line,
99  const char *text, const ecp_point *X );
100 #endif
101 
102 #if defined(POLARSSL_X509_CRT_PARSE_C)
103 void debug_print_crt( const ssl_context *ssl, int level,
104  const char *file, int line,
105  const char *text, const x509_crt *crt );
106 #endif
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif /* debug.h */