summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2024-10-25 14:38:51 +0800
committerluwenpeng <[email protected]>2024-10-25 14:38:51 +0800
commit4061d5a942392c4716586ded8c586440d2e920ca (patch)
tree07d44e4b4fc7bbac77bbb4f3bb7df7c17404e35c
parente2c212fb71769f1a4cd9f66c984bf82e6b6bdb42 (diff)
move stellar/session_manager.h into stellar/session.h
-rw-r--r--decoders/lpi_plus/lpip_module.c2
-rw-r--r--include/stellar/session.h15
-rw-r--r--include/stellar/session_manager.h33
-rw-r--r--infra/session_manager/session_manager.c2
-rw-r--r--test/lpi_plus/gtest_lpip_module.c1
-rw-r--r--test/session_debugger/session_debugger.c2
6 files changed, 18 insertions, 37 deletions
diff --git a/decoders/lpi_plus/lpip_module.c b/decoders/lpi_plus/lpip_module.c
index d68190b..2b801c5 100644
--- a/decoders/lpi_plus/lpip_module.c
+++ b/decoders/lpi_plus/lpip_module.c
@@ -15,7 +15,7 @@
#include "stellar/utils.h"
#include "stellar/packet.h"
-#include "stellar/session_manager.h"
+#include "stellar/session.h"
#include "appid/appid_internal.h"
diff --git a/include/stellar/session.h b/include/stellar/session.h
index 6e65a8e..aff1974 100644
--- a/include/stellar/session.h
+++ b/include/stellar/session.h
@@ -6,6 +6,7 @@ extern "C"
#endif
#include "stellar/packet.h"
+#include "stellar/module_manager.h"
enum session_state
{
@@ -146,6 +147,20 @@ void session_set_discard(struct session *sess);
void session_set_exdata(struct session *sess, int idx, void *ex_ptr);
void *session_get_exdata(const struct session *sess, int idx);
+struct session_manager;
+struct session_manager *stellar_module_get_session_manager(struct stellar_module_manager *mod_mgr);
+int session_manager_new_session_exdata_index(struct session_manager *sess_mgr, const char *name, exdata_free *func, void *arg);
+
+typedef void on_session_free_callback(struct session *sess, void *args);
+typedef void on_session_packet_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_free(struct session_manager *sess_mgr, on_session_free_callback *cb, void *args);
+int session_manager_subscribe_tcp(struct session_manager *sess_mgr, on_session_packet_callback *cb, void *args);
+int session_manager_subscribe_udp(struct session_manager *sess_mgr, on_session_packet_callback *cb, void *args);
+int session_manager_subscribe_control_packet(struct session_manager *sess_mgr, on_session_packet_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
diff --git a/include/stellar/session_manager.h b/include/stellar/session_manager.h
deleted file mode 100644
index 1ff6428..0000000
--- a/include/stellar/session_manager.h
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-#pragma once
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#include "stellar/exdata.h"
-#include "stellar/session.h"
-
-#include "stellar/module_manager.h"
-
-struct session_manager;
-
-struct session_manager *stellar_module_get_session_manager(struct stellar_module_manager *mod_mgr);
-
-int session_manager_new_session_exdata_index(struct session_manager *sess_mgr, const char *name, exdata_free *func, void *arg);
-
-typedef void on_session_free_callback(struct session *sess, void *args);
-typedef void on_session_packet_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_free(struct session_manager *sess_mgr, on_session_free_callback *cb, void *args);
-int session_manager_subscribe_tcp(struct session_manager *sess_mgr, on_session_packet_callback *cb, void *args);
-int session_manager_subscribe_udp(struct session_manager *sess_mgr, on_session_packet_callback *cb, void *args);
-int session_manager_subscribe_control_packet(struct session_manager *sess_mgr, on_session_packet_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
diff --git a/infra/session_manager/session_manager.c b/infra/session_manager/session_manager.c
index 7a6aabe..3aa9af4 100644
--- a/infra/session_manager/session_manager.c
+++ b/infra/session_manager/session_manager.c
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include "stellar/packet.h"
-#include "stellar/session_manager.h"
+#include "stellar/session.h"
#include "utils_internal.h"
#include "session_internal.h"
diff --git a/test/lpi_plus/gtest_lpip_module.c b/test/lpi_plus/gtest_lpip_module.c
index 31aabe3..abcbe61 100644
--- a/test/lpi_plus/gtest_lpip_module.c
+++ b/test/lpi_plus/gtest_lpip_module.c
@@ -8,7 +8,6 @@
#include "stellar/appid.h"
#include "stellar/module_manager.h"
-#include "stellar/session_manager.h"
#include "stellar/session.h"
#include "stellar/utils.h"
diff --git a/test/session_debugger/session_debugger.c b/test/session_debugger/session_debugger.c
index 4a6a267..d75aede 100644
--- a/test/session_debugger/session_debugger.c
+++ b/test/session_debugger/session_debugger.c
@@ -12,7 +12,7 @@
#include "stellar/log.h"
#include "stellar/module_manager.h"
-#include "stellar/session_manager.h"
+#include "stellar/session.h"
#pragma GCC diagnostic ignored "-Wunused-parameter"