#include <stdlib.h>
#include "dtls_config.h"
#include "global.h"
#include "session.h"
Go to the source code of this file.
|
#define | PRINTF(...) |
|
#define | dtls_emerg(...) dsrv_log(DTLS_LOG_EMERG, __VA_ARGS__) |
|
#define | dtls_alert(...) dsrv_log(DTLS_LOG_ALERT, __VA_ARGS__) |
|
#define | dtls_crit(...) dsrv_log(DTLS_LOG_CRIT, __VA_ARGS__) |
|
#define | dtls_warn(...) dsrv_log(DTLS_LOG_WARN, __VA_ARGS__) |
|
#define | dtls_notice(...) dsrv_log(DTLS_LOG_NOTICE, __VA_ARGS__) |
|
#define | dtls_info(...) dsrv_log(DTLS_LOG_INFO, __VA_ARGS__) |
|
#define | dtls_debug(...) dsrv_log(DTLS_LOG_DEBUG, __VA_ARGS__) |
|
#define | dtls_debug_hexdump(name, buf, length) dtls_dsrv_hexdump_log(DTLS_LOG_DEBUG, name, buf, length, 1) |
|
#define | dtls_debug_dump(name, buf, length) dtls_dsrv_hexdump_log(DTLS_LOG_DEBUG, name, buf, length, 0) |
|
|
static void | check_stack () |
|
const char * | dtls_package_name () |
|
const char * | dtls_package_version () |
|
log_t | dtls_get_log_level () |
|
void | dtls_set_log_level (log_t level) |
|
void | dsrv_log (log_t level, char *format,...) |
|
void | hexdump (const unsigned char *packet, int length) |
|
void | dump (unsigned char *buf, size_t len) |
|
void | dtls_dsrv_hexdump_log (log_t level, const char *name, const unsigned char *buf, size_t length, int extend) |
|
void | dtls_dsrv_log_addr (log_t level, const char *name, const session_t *addr) |
|
Pre-defined log levels akin to what is used in syslog.
Enumerator |
---|
DTLS_LOG_EMERG |
|
DTLS_LOG_ALERT |
|
DTLS_LOG_CRIT |
|
DTLS_LOG_WARN |
|
DTLS_LOG_NOTICE |
|
DTLS_LOG_INFO |
|
DTLS_LOG_DEBUG |
|
Definition at line 66 of file debug.h.
static void check_stack |
( |
| ) |
|
|
inlinestatic |
void dsrv_log |
( |
log_t |
level, |
|
|
char * |
format, |
|
|
|
... |
|
) |
| |
Writes the given text to stdout
. The text is output only when level
is below or equal to the log level that set by set_log_level().
Definition at line 208 of file debug.c.
void dtls_dsrv_hexdump_log |
( |
log_t |
level, |
|
|
const char * |
name, |
|
|
const unsigned char * |
buf, |
|
|
size_t |
length, |
|
|
int |
extend |
|
) |
| |
void dtls_dsrv_log_addr |
( |
log_t |
level, |
|
|
const char * |
name, |
|
|
const session_t * |
addr |
|
) |
| |
log_t dtls_get_log_level |
( |
| ) |
|
Returns the current log level.
Definition at line 58 of file debug.c.
const char* dtls_package_name |
( |
| ) |
|
Returns a zero-terminated string with the name of this library.
Definition at line 49 of file debug.c.
const char* dtls_package_version |
( |
| ) |
|
Returns a zero-terminated string with the library version.
Definition at line 53 of file debug.c.
void dtls_set_log_level |
( |
log_t |
level | ) |
|
Sets the log level to the specified value.
Definition at line 63 of file debug.c.
void dump |
( |
unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
dump as narrow string of hex digits
Definition at line 272 of file debug.c.
void hexdump |
( |
const unsigned char * |
packet, |
|
|
int |
length |
|
) |
| |
dumps packets in usual hexdump format
Definition at line 252 of file debug.c.