diff options
| author | lijia <[email protected]> | 2024-07-17 14:27:15 +0800 |
|---|---|---|
| committer | lijia <[email protected]> | 2024-07-18 09:54:56 +0800 |
| commit | c4c7aa89bf01b321f5b582d84b684171e6dbcf66 (patch) | |
| tree | 37678010c572f18f5d439101a40cc1f832e0154a /test/http_stellar_mock.h | |
| parent | b1548c7c6dc2198a4df20b11ce8eb72e766f56b7 (diff) | |
Add BODY_START message; add http_url_decode(); disable CONNECT tunnel.HEADv2.0.4dev-on-stellar2.0
Diffstat (limited to 'test/http_stellar_mock.h')
| -rw-r--r-- | test/http_stellar_mock.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/test/http_stellar_mock.h b/test/http_stellar_mock.h new file mode 100644 index 0000000..d3c2dc5 --- /dev/null +++ b/test/http_stellar_mock.h @@ -0,0 +1,72 @@ +#pragma once +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <time.h> +#include </usr/include/bits/types/struct_iovec.h> +#ifdef __cplusplus +extern "C" +{ +#endif +#include <stellar/session.h> +#include <stellar/session_mq.h> +#include <stellar/session_exdata.h> +#include <stellar/stellar.h> +#ifdef __cplusplus +} +#endif + +struct packet{ + const char *payload; + size_t payload_len; + u_int8_t dir; //PACKET_DIRECTION_C2S PACKET_DIRECTION_S2C +}; +typedef struct packet stellar_message; +struct exdata_mgr{ + const char *name; + int exdata_id; + void *arg; + void *user_ptr; + session_exdata_free *free_func; + struct exdata_mgr *next, *prev; +}; +struct sub_topic_mgr{ + int topic_id; + int plugin_id; + void *plugin_env; +}; +struct topic_mgr{ + struct topic_mgr *next, *prev; + const char *topic_name; + int topic_id; + session_msg_free_cb_func *pub_free_cb; + void *pub_free_arg; + struct sub_topic_cb_list *sub_free_cb_list_head; +}; +struct stellar{ + struct topic_mgr *topic_mgr_head; + struct exdata_mgr *exdata_mgr_head; +}; +struct session{ + struct stellar *st; + enum session_state sess_state; + enum session_addr_type addr_type; + struct session_addr addr; + void *exdata; + struct packet pkt; + struct exdata_mgr *runtime_exdata_head; +}; +struct plugin_mgr{ + struct plugin_mgr *next, *prev; + int plugin_id; + void *plugin_env; + session_ctx_new_func *session_ctx_new; + session_ctx_free_func *session_ctx_free; +}; +struct sub_topic_cb_list{ + int plugin_id; + void *plugin_env; + on_session_msg_cb_func *sub_cb; + struct sub_topic_cb_list *next, *prev; +}; |
