summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-09-04 14:44:30 +0800
committeryangwei <[email protected]>2024-09-04 14:44:30 +0800
commit1bdfc4506ccf242a2d89508f91c75308d4d218a8 (patch)
tree29d7f20455d47cba18f759a086aedfc6e8c63499 /include
parentc494bf831e5260849ab59653219f3eb47a42ccb3 (diff)
✨ feat(plugin_manager): add session plugin with hook
Diffstat (limited to 'include')
-rw-r--r--include/stellar/stellar.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/stellar/stellar.h b/include/stellar/stellar.h
index 7929f25..66a09f1 100644
--- a/include/stellar/stellar.h
+++ b/include/stellar/stellar.h
@@ -18,6 +18,9 @@ typedef void plugin_on_unload_func(void *plugin_env);
typedef void *session_ctx_new_func(struct session *sess, void *plugin_env);
typedef void session_ctx_free_func(struct session *sess, void *session_ctx, void *plugin_env);
+typedef void session_on_new_func(struct session *sess, void *session_ctx, void *plugin_env);
+typedef void session_on_free_func(struct session *sess, void *session_ctx, void *plugin_env);
+
// INTRINSIC TOPIC
// TOPIC_TCP_STREAM on_msg need convert msg to (const struct tcp_segment *)
// TOPIC_UDP_INPUT/TOPIC_TCP_INPUT/TOPIC_UDP_OUTPUT/TOPIC_TCP_OUTPUT/TOPIC_CONTROL_PACKET on_msg need convert msg to (const struct packet *)
@@ -37,6 +40,13 @@ int stellar_session_plugin_register(struct stellar *st,
session_ctx_free_func session_ctx_free,
void *plugin_env);
+int stellar_session_plugin_register_with_hook(struct stellar *st,
+ session_ctx_new_func session_ctx_new,
+ session_ctx_free_func session_ctx_free,
+ session_on_new_func session_on_new,
+ session_on_free_func session_on_free,
+ void *plugin_env);
+
void stellar_session_plugin_dettach_current_session(struct session *sess);
struct tcp_segment;