diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2011-01-05 15:18:59 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2011-01-05 15:18:59 +0300 |
commit | f28cb1b0a926f1ea98700b7871537ad1793511fd (patch) | |
tree | baf35570bc6b38b6fab5b6524e8f19f58f71e57f /accel-pppd/log.h | |
parent | 2fdf3586c13a72c36f9530084962e29d57dc0329 (diff) | |
download | accel-ppp-f28cb1b0a926f1ea98700b7871537ad1793511fd.tar.gz accel-ppp-f28cb1b0a926f1ea98700b7871537ad1793511fd.zip |
rename accel-pptp to accel-ppp
Diffstat (limited to 'accel-pppd/log.h')
-rw-r--r-- | accel-pppd/log.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/accel-pppd/log.h b/accel-pppd/log.h new file mode 100644 index 0000000..d87c42c --- /dev/null +++ b/accel-pppd/log.h @@ -0,0 +1,69 @@ +#ifndef __LOG_H +#define __LOG_H + +#include <stdarg.h> +#include <sys/time.h> +#include "list.h" + +#define LOG_MSG 0 +#define LOG_ERROR 1 +#define LOG_WARN 2 +#define LOG_INFO1 3 +#define LOG_INFO2 4 +#define LOG_DEBUG 5 + +#define LOG_CHUNK_SIZE 128 +#define LOG_MAX_SIZE 4096 + +struct ppp_t; +struct triton_context_t; + +struct log_msg_t +{ + struct list_head entry; + void *lpd; + void *tpd; + struct timeval timestamp; + int level; + struct log_chunk_t *hdr; + struct list_head *chunks; +}; + +struct log_chunk_t +{ + struct list_head entry; + int len; + char msg[0]; +}; + +struct log_target_t +{ + struct list_head entry; + + void (*log)(struct log_target_t *, struct log_msg_t *, struct ppp_t *ppp); + void (*reopen)(void); +}; + +void log_free_msg(struct log_msg_t *msg); + +void log_emerg(const char *fmt, ...); + +void log_error(const char *fmt,...); +void log_warn(const char *fmt,...); +void log_info1(const char *fmt,...); +void log_info2(const char *fmt,...); +void log_debug(const char *fmt,...); +void log_msg(const char *fmt,...); + +void log_ppp_error(const char *fmt,...); +void log_ppp_warn(const char *fmt,...); +void log_ppp_info1(const char *fmt,...); +void log_ppp_info2(const char *fmt,...); +void log_ppp_debug(const char *fmt,...); +void log_ppp_msg(const char *fmt,...); + +void log_switch(struct triton_context_t *ctx, void *arg); + +void log_register_target(struct log_target_t *t); + +#endif |