Plugin Management support C plugin

This commit is contained in:
luwenpeng
2022-07-27 18:32:22 +08:00
parent 649d29e538
commit 50111e7cd0
35 changed files with 4220 additions and 193 deletions

View File

@@ -1,6 +1,5 @@
#pragma once
#include "packet.h"
#include "session.h"
void http_decoder(const struct stellar_session *s, int what, struct stellar_packet *p, const char *payload, uint16_t len, void **pme);
void http_decoder(const struct stellar_session *s, enum session_event_type event, struct stellar_packet *p, const char *payload, uint16_t len, void **pme);

View File

@@ -2,8 +2,14 @@
#include "session.h"
typedef int plugin_init_callback(void **pme);
typedef void plugin_exit_callback(void *pme);
typedef int plugin_init_callback(void);
typedef void plugin_exit_callback(void);
void plugin_remove_from_session_event(struct stellar_event *ev,
struct stellar_session *s);
void plugin_remove_from_session_event(struct stellar_event *ev, struct stellar_session *s);
/******************************************************************************
* Public API: between plugin and plugin_manager
******************************************************************************/
// TODO
// TODO

View File

@@ -25,6 +25,7 @@ enum stellar_session_type
enum session_event_type
{
SESSION_EVENT_UNKNOWN = (0x00),
SESSION_EVENT_OPENING = (0x01 << 1),
SESSION_EVENT_RAWPKT = (0x01 << 2),
SESSION_EVENT_ORDPKT = (0x01 << 3),
@@ -35,11 +36,7 @@ enum session_event_type
struct stellar_session_event_extras;
typedef void (fn_session_event_callback)(const struct stellar_session *s, int what, struct stellar_packet *p, const char *payload, uint16_t len, void **pme);
typedef void(fn_session_event_callback)(const struct stellar_session *s, enum session_event_type event, struct stellar_packet *p, const char *payload, uint16_t len, void **pme);
void session_manager_trigger_event(struct stellar_session *s,
enum session_event_type type,
struct stellar_session_event_extras *info);
struct stellar_session *session_manager_session_derive(const struct stellar_session *this_session,
const char *new_session_type_name);
void session_manager_trigger_event(struct stellar_session *s, enum session_event_type type, struct stellar_session_event_extras *info);
struct stellar_session *session_manager_session_derive(const struct stellar_session *this_session, const char *session_name);