Optimize integration testing

- Add injection package plug-in
- Add libstellar_dynamic.so to facilitate unit testing of upper-level plug-ins
This commit is contained in:
luwenpeng
2024-05-28 10:26:29 +08:00
parent 54385ed08b
commit f82b85c979
86 changed files with 831 additions and 831 deletions

View File

@@ -6,49 +6,16 @@ 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);
struct packet_io *stellar_get_packet_io(const struct stellar *st);
struct session_manager *stellar_get_session_manager(const struct stellar *st);
struct plugin_manager_schema *stellar_get_plugin_manager(const struct stellar *st);
void stellar_set_plugin_manger(struct stellar *st, struct plugin_manager_schema *plug_mgr);
#ifdef __cplusplus
}