#ifndef _STELLAR_PRIV_H #define _STELLAR_PRIV_H #ifdef __cplusplus extern "C" { #endif #include "stat.h" #include "plugin_manager.h" #include "stellar/stellar.h" #define STELLAR_LOG_STATE(format, ...) LOG_STATE("stellar", format, ##__VA_ARGS__) #define STELLAR_LOG_ERROR(format, ...) LOG_ERROR("stellar", format, ##__VA_ARGS__) #define STELLAR_LOG_DEBUG(format, ...) LOG_DEBUG("stellar", format, ##__VA_ARGS__) struct stellar_thread { pthread_t tid; uint16_t idx; uint64_t is_runing; uint64_t timing_wheel_last_update_ts; struct ip_reassembly *ip_mgr; struct session_manager *sess_mgr; }; struct stellar_runtime { uint64_t need_exit; uint64_t stat_last_output_ts; struct stellar_stat *stat; struct packet_io *packet_io; struct plugin_manager_schema *plug_mgr; struct stellar_thread threads[MAX_THREAD_NUM]; }; //FIXME rename stellar_runtime to stellar struct stellar { struct stellar_runtime *st_rt; }; extern struct stellar_runtime *runtime; extern struct stellar_config *config; void stellar_set_current_thread_index(uint16_t idx); int stellar_thread_init(struct stellar_runtime *runtime, struct stellar_config *config); void stellar_thread_clean(struct stellar_runtime *runtime, struct stellar_config *config); int stellar_thread_run(struct stellar_runtime *runtime, struct stellar_config *config); void stellar_thread_join(struct stellar_runtime *runtime, struct stellar_config *config); #ifdef __cplusplus } #endif #endif