refactor(session manager): turning the session manager into a stellar module

This commit is contained in:
luwenpeng
2024-09-20 16:56:05 +08:00
parent 620019cf8e
commit 94f1913e3e
20 changed files with 1944 additions and 1507 deletions

View File

@@ -0,0 +1,27 @@
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#include "stellar/exdata.h"
#include "stellar/session.h"
struct session_manager;
int session_manager_new_packet_exdata_index(struct session_manager *sess_mgr, const char *name, exdata_free *func, void *arg);
typedef void on_session_callback(struct session *sess, struct packet *pkt, void *args);
typedef void on_tcp_stream_callback(struct session *sess, const char *tcp_payload, uint32_t tcp_payload_len, void *args);
int session_manager_subscribe_tcp(struct session_manager *sess_mgr, on_session_callback *cb, void *args);
int session_manager_subscribe_udp(struct session_manager *sess_mgr, on_session_callback *cb, void *args);
int session_manager_subscribe_control_packet(struct session_manager *sess_mgr, on_session_callback *cb, void *args);
int session_manager_subscribe_tcp_stream(struct session_manager *sess_mgr, on_tcp_stream_callback *cb, void *args);
#ifdef __cplusplus
}
#endif