summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author杨威 <[email protected]>2024-10-11 06:08:50 +0000
committer杨威 <[email protected]>2024-10-11 06:08:50 +0000
commit70d21f28c36fc93280352c9284de6529afcbe5be (patch)
tree4bfc3669ca0da512ceb897167feda65dcaefa1af /include
parent2e35a795285499e064b91435ad90777f90419f68 (diff)
Rebase dev 2.0
Diffstat (limited to 'include')
-rw-r--r--include/stellar/appid.h31
-rw-r--r--include/stellar/module_manager.h3
-rw-r--r--include/stellar/packet_manager.h4
-rw-r--r--include/stellar/session_manager.h4
-rw-r--r--include/stellar/stellar.h2
5 files changed, 26 insertions, 18 deletions
diff --git a/include/stellar/appid.h b/include/stellar/appid.h
index 6d82d71..df30a8f 100644
--- a/include/stellar/appid.h
+++ b/include/stellar/appid.h
@@ -1,16 +1,19 @@
#pragma once
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#include <stddef.h>
#include <stdint.h>
-#define MESSAGE_MAGIC 0x12345678
-
-#define MAX_APP_ID_NUM 8
-#define APP_ID_MESSAGE_TOPIC "TOPIC_APP_ID"
+#include "stellar/session.h"
+#include "stellar/module_manager.h"
-enum APP_IDENTIFY_ORIGIN
+enum APPID_ORIGIN
{
- ORIGIN_PROTO_IDENTIFY=0,
+ ORIGIN_LPI_PLUS=0,
ORIGIN_APP_SKETCH_USER_DEFINE,
ORIGIN_PROTO_ENGINE,
ORIGIN_APP_SKETCH_BUILT_IN,
@@ -20,12 +23,10 @@ enum APP_IDENTIFY_ORIGIN
ORIGIN_MAX
};
-struct app_id_message
-{
- int magic;
- enum APP_IDENTIFY_ORIGIN origin;
- uint32_t app_id_num;
- int32_t app_id[MAX_APP_ID_NUM];
- uint32_t surrogate_id[MAX_APP_ID_NUM];
- uint32_t packet_sequence[MAX_APP_ID_NUM];
-}; \ No newline at end of file
+typedef void on_appid_callback(struct session *sess, enum APPID_ORIGIN origin, int appid[], size_t appid_num, void *args);
+int stellar_appid_create_topic(struct stellar_module_manager *mod_mgr);
+int stellar_appid_subscribe(struct stellar_module_manager *mod_mgr, on_appid_callback *cb, void *args);
+
+#ifdef __cplusplus
+}
+#endif \ No newline at end of file
diff --git a/include/stellar/module_manager.h b/include/stellar/module_manager.h
index a944186..70ee5a5 100644
--- a/include/stellar/module_manager.h
+++ b/include/stellar/module_manager.h
@@ -8,9 +8,6 @@ extern "C"
#include "stellar/mq.h"
#include "stellar/log.h"
-#define PACKET_MANAGER_MODULE_NAME "packet_manager_module"
-#define SESSION_MANAGER_MODULE_NAME "session_manager_module"
-
struct stellar_module;
struct stellar_module *stellar_module_new(const char *name, void *ctx);
void stellar_module_free(struct stellar_module *mod);
diff --git a/include/stellar/packet_manager.h b/include/stellar/packet_manager.h
index 8270c7b..dd90074 100644
--- a/include/stellar/packet_manager.h
+++ b/include/stellar/packet_manager.h
@@ -8,6 +8,8 @@ extern "C"
#include "stellar/exdata.h"
#include "stellar/packet.h"
+#include "stellar/module_manager.h"
+
enum packet_stage
{
PACKET_STAGE_PREROUTING,
@@ -20,6 +22,8 @@ enum packet_stage
struct packet_manager;
+struct packet_manager *stellar_module_get_packet_manager(struct stellar_module_manager *mod_mgr);
+
int packet_manager_new_packet_exdata_index(struct packet_manager *pkt_mgr, const char *name, exdata_free *func, void *arg);
typedef void on_packet_stage_callback(enum packet_stage stage, struct packet *pkt, void *args);
diff --git a/include/stellar/session_manager.h b/include/stellar/session_manager.h
index 749ccbb..87d4b18 100644
--- a/include/stellar/session_manager.h
+++ b/include/stellar/session_manager.h
@@ -10,8 +10,12 @@ extern "C"
#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_callback(struct session *sess, struct packet *pkt, void *args);
diff --git a/include/stellar/stellar.h b/include/stellar/stellar.h
index 9dfd711..0be4c6e 100644
--- a/include/stellar/stellar.h
+++ b/include/stellar/stellar.h
@@ -9,6 +9,7 @@ extern "C"
#include "stellar/log.h"
#include "stellar/packet.h"
+#include "stellar/module_manager.h"
struct stellar;
@@ -26,6 +27,7 @@ void stellar_free(struct stellar *st);
void stellar_loopbreak(struct stellar *st);
void stellar_reload_log_level(struct stellar *st);
struct logger *stellar_get_logger(struct stellar *st);
+struct stellar_module_manager *stellar_get_module_manager(struct stellar *st);
#ifdef __cplusplus
}