Refactor main loop

This commit is contained in:
luwenpeng
2024-04-11 16:30:21 +08:00
parent cfbad63021
commit 84541c40e2
11 changed files with 240 additions and 216 deletions

View File

@@ -0,0 +1,29 @@
#ifndef _PLUGIN_MANAGER_H
#define _PLUGIN_MANAGER_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include "session.h"
#define PLUGIN_MANAGER_LOG_ERROR(format, ...) LOG_ERROR("plugin manager", format, ##__VA_ARGS__)
#define PLUGIN_MANAGER_LOG_DEBUG(format, ...) LOG_DEBUG("plugin manager", format, ##__VA_ARGS__)
// per session context
void *plugin_manager_new_ctx(struct session *sess);
void plugin_manager_free_ctx(void *ctx);
struct plugin_manager;
struct plugin_manager *plugin_manager_new(void);
void plugin_manager_free(struct plugin_manager *mgr);
void plugin_manager_dispatch_session(struct plugin_manager *mgr, struct session *sess, struct packet *pkt);
void plugin_manager_dispatch_packet(struct plugin_manager *mgr, struct packet *pkt);
#ifdef __cpluscplus
}
#endif
#endif