变更tfe_stream.h中的部分公用结构体定义。

This commit is contained in:
Lu Qiuwen
2018-09-03 10:30:47 +08:00
parent a473aa3c3c
commit 8ddb847224
6 changed files with 24 additions and 24 deletions

View File

@@ -5,12 +5,12 @@
#include <tfe_types.h>
#include <tfe_utils.h>
enum tfe_session_proto
enum tfe_stream_proto
{
SESSION_PROTO_PLAIN = 0,
SESSION_PROTO_SSL,
SESSION_PROTO_QUIC,
SESSION_PROTO_SPDY
STREAM_PROTO_PLAIN = 0,
STREAM_PROTO_SSL,
STREAM_PROTO_QUIC,
STREAM_PROTO_SPDY
};
enum tfe_app_proto
@@ -18,7 +18,7 @@ enum tfe_app_proto
APP_PROTO_HTTP1,
APP_PROTO_HTTP2,
APP_PROTO_WS, //websocket
APP_PROTO_QUIC //QUIC is a protocol that cross session layer and application layer.
APP_PROTO_QUIC //QUIC is a protocol that cross session layer and application layer.
};
enum tfe_conn_dir
@@ -37,13 +37,13 @@ enum tfe_conn_status
/* single dst or src socket bufferevent descriptor */
struct tfe_conn
{
struct layer_addr addr;
enum tfe_conn_status status;
struct bufferevent * bev;
};
struct tfe_stream
{
struct layer_addr addr;
enum tfe_stream_proto proto;
struct tfe_conn upstream;
struct tfe_conn downstream;
};
@@ -88,10 +88,10 @@ void tfe_stream_write_frag_end(struct tfe_stream_write_ctx * w_ctx);
//Return 1 for identify as its traffic;
//Return 0 for unknown traffic;
typedef tfe_stream_action stream_open_cb_t(const struct tfe_stream * stream, unsigned int thread_id,
typedef enum tfe_stream_action stream_open_cb_t(const struct tfe_stream * stream, unsigned int thread_id,
enum tfe_conn_dir dir, const unsigned char * data, size_t len, void ** pme);
typedef tfe_stream_action stream_data_cb_t(const struct tfe_stream * stream, unsigned int thread_id,
typedef enum tfe_stream_action stream_data_cb_t(const struct tfe_stream * stream, unsigned int thread_id,
enum tfe_conn_dir dir, const unsigned char * data, size_t len, void ** pme);
typedef void stream_close_cb_t(const struct tfe_stream * stream, unsigned int thread_id,
@@ -100,11 +100,11 @@ typedef void stream_close_cb_t(const struct tfe_stream * stream, unsigned int th
void tfe_stream_detach(const struct tfe_stream * stream);
int tfe_stream_preempt(const struct tfe_stream * stream);
struct promise * tfe_stream_suspend(const struct tfe_stream * stream);
void tfe_stream_resume(struct promisc * promisc);
void tfe_stream_resume(struct promise * promise);
//close both sides of the stream.
int stream_shutdown(const struct tfe_stream * stream);
int stream_shutdown_dir(const struct tfe_stream * stream, enum tfe_conn_dir dir);
int tfe_stream_shutdown(const struct tfe_stream * stream);
int tfe_stream_shutdown_dir(const struct tfe_stream * stream, enum tfe_conn_dir dir);
struct tfe_plugin
{