✨ feat(plugin manager): integrated plugin manager, build success
This commit is contained in:
@@ -51,7 +51,7 @@ static inline void free_evicted_sessions(struct session_manager *sess_mgr, uint6
|
||||
if (sess)
|
||||
{
|
||||
plugin_ctx = session_get_user_data(sess);
|
||||
plugin_manager_free_ctx(plugin_ctx);
|
||||
plugin_manager_session_runtime_free((struct plugin_manager_runtime*)plugin_ctx);
|
||||
session_manager_free_session(sess_mgr, sess);
|
||||
}
|
||||
else
|
||||
@@ -71,7 +71,7 @@ static inline void free_expired_sessions(struct session_manager *sess_mgr, uint6
|
||||
if (sess)
|
||||
{
|
||||
plugin_ctx = session_get_user_data(sess);
|
||||
plugin_manager_free_ctx(plugin_ctx);
|
||||
plugin_manager_session_runtime_free((struct plugin_manager_runtime*)plugin_ctx);
|
||||
session_manager_free_session(sess_mgr, sess);
|
||||
}
|
||||
else
|
||||
@@ -102,7 +102,7 @@ static void *work_thread(void *arg)
|
||||
struct packet packets[RX_BURST_MAX];
|
||||
struct session *sess = NULL;
|
||||
struct packet_io *packet_io = runtime->packet_io;
|
||||
struct plugin_manager *plug_mgr = runtime->plug_mgr;
|
||||
struct plugin_manager_schema *plug_mgr = runtime->plug_mgr;
|
||||
struct stellar_thread *thread = (struct stellar_thread *)arg;
|
||||
struct ip_reassembly *ip_reass = thread->ip_mgr;
|
||||
struct session_manager *sess_mgr = thread->sess_mgr;
|
||||
@@ -137,7 +137,7 @@ static void *work_thread(void *arg)
|
||||
defraged_pkt = NULL;
|
||||
pkt = &packets[i];
|
||||
|
||||
plugin_manager_dispatch_packet(plug_mgr, pkt);
|
||||
plugin_manager_on_packet(plug_mgr, pkt);
|
||||
if (packet_is_fragment(pkt))
|
||||
{
|
||||
defraged_pkt = ip_reassembly_packet(ip_reass, pkt, now);
|
||||
@@ -148,7 +148,7 @@ static void *work_thread(void *arg)
|
||||
else
|
||||
{
|
||||
pkt = defraged_pkt;
|
||||
plugin_manager_dispatch_packet(plug_mgr, pkt);
|
||||
plugin_manager_on_packet(plug_mgr, pkt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ static void *work_thread(void *arg)
|
||||
{
|
||||
goto fast_path;
|
||||
}
|
||||
plugin_ctx = plugin_manager_new_ctx(sess);
|
||||
plugin_ctx = plugin_manager_session_runtime_new(runtime->plug_mgr, sess);
|
||||
session_set_user_data(sess, plugin_ctx);
|
||||
}
|
||||
else
|
||||
@@ -174,9 +174,10 @@ static void *work_thread(void *arg)
|
||||
{
|
||||
packet_set_session_id(pkt, session_get_id(sess));
|
||||
}
|
||||
plugin_manager_dispatch_session(plug_mgr, sess, pkt);
|
||||
plugin_manager_on_session_ingress(sess, pkt);
|
||||
|
||||
fast_path:
|
||||
plugin_manager_on_session_egress(sess, pkt);
|
||||
update_session_stat(sess, pkt);
|
||||
if (packet_get_action(pkt) == PACKET_ACTION_DROP)
|
||||
{
|
||||
@@ -219,7 +220,8 @@ static void *work_thread(void *arg)
|
||||
ip_reassembly_expire(ip_reass, now);
|
||||
|
||||
// TODO
|
||||
// plugin_manager_cron();
|
||||
plugin_manager_on_polling(runtime->plug_mgr);
|
||||
// session_manager_cron();
|
||||
// poll_non_packet_events();
|
||||
|
||||
if (nr_recv == 0)
|
||||
|
||||
Reference in New Issue
Block a user