变更HTTP业务层回调函数定义,增加session系列操作方法定义及虚接口实现。
* 不提供业务层针对单个数据包(段)的处理函数(返回值),业务层只能对单个session定义操作; * 通过session的方法(函数)通知解析层对该session的处理方法。
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <tfe_stream.h>
|
||||
#include <tfe_http.h>
|
||||
|
||||
struct tfe_proxy;
|
||||
struct tfe_thread_ctx;
|
||||
@@ -30,16 +32,20 @@ struct tfe_plugin
|
||||
/* SYMBOL & PROTOCOL */
|
||||
const char * symbol;
|
||||
enum tfe_plugin_type type;
|
||||
enum tfe_app_proto proto;
|
||||
|
||||
/* PLUGIN INIT & DEINIT */
|
||||
plugin_init_cb_t * on_init;
|
||||
plugin_deinit_cb_t * on_deinit;
|
||||
|
||||
/* PLUGIN STREAM ENTRIES */
|
||||
/* STREAM */
|
||||
stream_open_cb_t * on_open;
|
||||
stream_data_cb_t * on_data;
|
||||
stream_close_cb_t * on_close;
|
||||
|
||||
/* HTTP */
|
||||
http_session_begin_cb * on_session_begin;
|
||||
http_session_data_cb * on_session_data;
|
||||
http_session_end_cb * on_session_end;
|
||||
};
|
||||
|
||||
/* Register plugin */
|
||||
@@ -58,3 +64,7 @@ static void __plugin_loader_##_symbol() \
|
||||
_plugin.symbol = #_symbol; \
|
||||
tfe_plugin_register(&_plugin); \
|
||||
}
|
||||
|
||||
#define TFE_PLUGIN_FOREACH(_p_info, _iterator) \
|
||||
for((_p_info) = tfe_plugin_iterate((_iterator)); (_p_info) != NULL; \
|
||||
(_p_info) = tfe_plugin_iterate((_iterator)))
|
||||
|
||||
Reference in New Issue
Block a user