Plugin management support pm_session_dettach_me and pm_session_dettach_others
Add test cases for pm_session_dettach_me and pm_session_dettach_others
This commit is contained in:
@@ -2,4 +2,5 @@
|
||||
|
||||
#include "session.h"
|
||||
|
||||
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);
|
||||
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);
|
||||
void http_error_cb(const struct stellar_session *s, enum error_event_type event, void **pme);
|
||||
@@ -1,15 +1,25 @@
|
||||
#pragma once
|
||||
#ifndef _PLUGIN_H
|
||||
#define _PLUGIN_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "session.h"
|
||||
|
||||
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);
|
||||
|
||||
/******************************************************************************
|
||||
* Public API: between plugin and plugin_manager
|
||||
* Public API For Plugin
|
||||
******************************************************************************/
|
||||
|
||||
// TODO
|
||||
// TODO
|
||||
void pm_session_dettach_me(const struct stellar_session *session);
|
||||
void pm_session_dettach_others(const struct stellar_session *session);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,10 @@
|
||||
#pragma once
|
||||
#ifndef _SESSION_H
|
||||
#define _SESSION_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "packet.h"
|
||||
#include "event.h"
|
||||
@@ -34,9 +40,23 @@ enum session_event_type
|
||||
SESSION_EVENT_ALL = (0x01 << 1 | 0x01 << 2 | 0x01 << 3 | 0x01 << 4 | 0x01 << 5),
|
||||
};
|
||||
|
||||
enum error_event_type
|
||||
{
|
||||
ERROR_EVENT_DETTACH = (0x1 << 10),
|
||||
};
|
||||
|
||||
struct stellar_session_event_extras;
|
||||
|
||||
typedef void(fn_session_error_callback)(const struct stellar_session *s, enum error_event_type event, 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 *session_name);
|
||||
struct stellar_session *session_manager_session_derive(const struct stellar_session *this_session, const char *session_name);
|
||||
|
||||
const char *stellar_session_get_name(const struct stellar_session *session);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user