From f28cb1b0a926f1ea98700b7871537ad1793511fd Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Wed, 5 Jan 2011 15:18:59 +0300 Subject: rename accel-pptp to accel-ppp --- accel-pppd/triton/triton_p.h | 103 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 accel-pppd/triton/triton_p.h (limited to 'accel-pppd/triton/triton_p.h') diff --git a/accel-pppd/triton/triton_p.h b/accel-pppd/triton/triton_p.h new file mode 100644 index 00000000..235eb701 --- /dev/null +++ b/accel-pppd/triton/triton_p.h @@ -0,0 +1,103 @@ +#ifndef TRITON_P_H +#define TRITON_P_H + +#include +#include + +#include "triton.h" +#include "list.h" +#include "spinlock.h" +#include "mempool.h" + +struct _triton_thread_t +{ + struct list_head entry; + struct list_head entry2; + pthread_t thread; + int terminate; + struct _triton_context_t *ctx; + pthread_mutex_t sleep_lock; + pthread_cond_t sleep_cond; +}; + +struct _triton_context_t +{ + struct list_head entry; + struct list_head entry2; + + spinlock_t lock; + struct _triton_thread_t *thread; + + struct list_head handlers; + struct list_head timers; + struct list_head pending_handlers; + struct list_head pending_timers; + struct list_head pending_calls; + + int init; + int queued; + int wakeup; + int need_close; + int need_free; + int pending; + int priority; + + struct triton_context_t *ud; + void *bf_arg; +}; + +struct _triton_md_handler_t +{ + struct list_head entry; + struct list_head entry2; + struct _triton_context_t *ctx; + struct epoll_event epoll_event; + uint32_t trig_epoll_events; + int pending:1; + int trig_level:1; + struct triton_md_handler_t *ud; +}; + +struct _triton_timer_t +{ + struct list_head entry; + struct list_head entry2; + struct epoll_event epoll_event; + struct _triton_context_t *ctx; + int fd; + int pending:1; + struct triton_timer_t *ud; +}; + +struct _triton_event_t +{ + struct list_head handlers; +}; + +struct _triton_ctx_call_t +{ + struct list_head entry; + + void *arg; + void (*func)(void *); +}; + +int log_init(void); +int md_init(); +int timer_init(); +int event_init(); + +void md_run(); +void md_terminate(); +void timer_run(); +void timer_terminate(); +extern struct triton_context_t default_ctx; +int triton_queue_ctx(struct _triton_context_t*); +void triton_thread_wakeup(struct _triton_thread_t*); +int conf_load(const char *fname); +int conf_reload(const char *fname); +void triton_log_error(const char *fmt,...); +void triton_log_debug(const char *fmt,...); +int load_modules(const char *name); + +#endif -- cgit v1.2.3