tinydtls
0.8.6
|
#include "tinydtls.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <time.h>
#include "global.h"
#include "dtls_debug.h"
Go to the source code of this file.
Macros | |
#define | min(a, b) ((a) < (b) ? (a) : (b)) |
Functions | |
const char * | dtls_package_name () |
const char * | dtls_package_version () |
log_t | dtls_get_log_level () |
void | dtls_set_log_level (log_t level) |
static size_t | print_timestamp (char *s, size_t len, time_t t) |
static size_t | dtls_strnlen (const char *s, size_t maxlen) |
static size_t | dsrv_print_addr (const session_t *addr, char *buf, size_t len) |
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_log_addr (log_t level, const char *name, const session_t *addr) |
void | dtls_dsrv_hexdump_log (log_t level, const char *name, const unsigned char *buf, size_t length, int extend) |
Variables | |
static int | maxlog = DTLS_LOG_WARN |
static char * | loglevels [] |
#define min | ( | a, | |
b | |||
) | ((a) < (b) ? (a) : (b)) |
Definition at line 39 of file dtls_debug.c.
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 209 of file dtls_debug.c.
|
static |
Definition at line 115 of file dtls_debug.c.
void dtls_dsrv_hexdump_log | ( | log_t | level, |
const char * | name, | ||
const unsigned char * | buf, | ||
size_t | length, | ||
int | extend | ||
) |
Definition at line 291 of file dtls_debug.c.
Definition at line 278 of file dtls_debug.c.
log_t dtls_get_log_level | ( | void | ) |
Returns the current log level.
Definition at line 53 of file dtls_debug.c.
const char* dtls_package_name | ( | void | ) |
Returns a zero-terminated string with the name of this library.
Definition at line 44 of file dtls_debug.c.
const char* dtls_package_version | ( | void | ) |
Returns a zero-terminated string with the library version.
Definition at line 48 of file dtls_debug.c.
void dtls_set_log_level | ( | log_t | level | ) |
Sets the log level to the specified value.
Definition at line 58 of file dtls_debug.c.
|
inlinestatic |
A length-safe strlen() fake.
s | The string to count characters != 0. |
maxlen | The maximum length of s . |
s
. Definition at line 107 of file dtls_debug.c.
void dump | ( | unsigned char * | buf, |
size_t | len | ||
) |
dump as narrow string of hex digits
Definition at line 273 of file dtls_debug.c.
void hexdump | ( | const unsigned char * | packet, |
int | length | ||
) |
dumps packets in usual hexdump format
Definition at line 253 of file dtls_debug.c.
|
inlinestatic |
Definition at line 74 of file dtls_debug.c.
|
static |
Definition at line 67 of file dtls_debug.c.
|
static |
Definition at line 42 of file dtls_debug.c.