Rebase dev 2.0

This commit is contained in:
杨威
2024-10-11 06:08:50 +00:00
parent 2e35a79528
commit 70d21f28c3
671 changed files with 1490 additions and 1770 deletions

View File

@@ -1,16 +1,19 @@
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#include <stddef.h>
#include <stdint.h>
#define MESSAGE_MAGIC 0x12345678
#include "stellar/session.h"
#include "stellar/module_manager.h"
#define MAX_APP_ID_NUM 8
#define APP_ID_MESSAGE_TOPIC "TOPIC_APP_ID"
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];
};
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

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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
}