summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/quic_entry.cpp8
-rw-r--r--src/quic_process.cpp42
-rw-r--r--src/quic_process.h6
4 files changed, 29 insertions, 29 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5875ef9..b1b0477 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -12,4 +12,4 @@ set_target_properties(${lib_name} PROPERTIES PREFIX "")
target_link_libraries(${lib_name} ${DNS_DEPEND_DYN_LIB} pthread -Wl,--no-whole-archive openssl-crypto-static -Wl,--no-whole-archive openssl-ssl-static)
set_target_properties(${lib_name} PROPERTIES OUTPUT_NAME ${lib_name})
-install(TARGETS ${lib_name} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/protocol/quic COMPONENT LIBRARIES) \ No newline at end of file
+install(TARGETS ${lib_name} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/sapp/stellar_plugin/quic COMPONENT LIBRARIES)
diff --git a/src/quic_entry.cpp b/src/quic_entry.cpp
index f7f3bb4..52d3ccd 100644
--- a/src/quic_entry.cpp
+++ b/src/quic_entry.cpp
@@ -112,11 +112,11 @@ static int parse_quic_port(char *port_list, unsigned short *quic_port, int quic_
static void free_quicinfo(struct quic_info *quic_info)
{
- if(quic_info->sni.str)
- FREE(quic_info->sni.str);
+ if(quic_info->sni.iov_base)
+ FREE(quic_info->sni.iov_base);
- if(quic_info->user_agent.str)
- FREE(quic_info->user_agent.str);
+ if(quic_info->user_agent.iov_base)
+ FREE(quic_info->user_agent.iov_base);
return ;
}
diff --git a/src/quic_process.cpp b/src/quic_process.cpp
index 946a486..95778dc 100644
--- a/src/quic_process.cpp
+++ b/src/quic_process.cpp
@@ -122,18 +122,18 @@ static int gquic_pkn_bit2length(unsigned char bit_value)
return 1;
}
-static int copy_extension_tag(const char *tag_start_pos, int tag_len, struct qstring *out, int thread_seq)
+static int copy_extension_tag(const char *tag_start_pos, int tag_len, qstring *out, int thread_seq)
{
if(tag_start_pos!=NULL && tag_len>0)
{
- if(out->str!=NULL)
+ if(out->iov_base!=NULL)
{
- FREE(out->str);
+ FREE(out->iov_base);
}
- out->str=(char *)CALLOC(1, tag_len+1);
- memcpy((void *)out->str, tag_start_pos, tag_len);
- out->str_len = tag_len;
+ out->iov_base=CALLOC(1, tag_len+1);
+ memcpy((void *)out->iov_base, tag_start_pos, tag_len);
+ out->iov_len = tag_len;
return tag_len;
}
@@ -810,8 +810,8 @@ void quic_analyze_entry(struct session *sess, const struct quic_param *g_quic_pl
if(0 == qcontext->msg_state[QUIC_VERSION]
|| 0 == qcontext->msg_state[QUIC_SNI]
|| 0 == qcontext->msg_state[QUIC_USER_AGENT]){
- if(NULL == qcontext->quic_info.sni.str
- || NULL == qcontext->quic_info.user_agent.str){
+ if(NULL == qcontext->quic_info.sni.iov_base
+ || NULL == qcontext->quic_info.user_agent.iov_base){
parse_res = parse_quic_all_version(g_quic_plugin_env, &(qcontext->quic_info), payload, payload_len, thread_seq);
if(PARSE_RESULT_VERSION == parse_res){
push_payload = 1;
@@ -823,12 +823,12 @@ void quic_analyze_entry(struct session *sess, const struct quic_param *g_quic_pl
quic_session_mq_publish_message_safe(sess, g_quic_plugin_env->quic_topic_id, qmsg);
qcontext->msg_state[QUIC_VERSION] = 1;
}
- if((0 == qcontext->msg_state[QUIC_SNI]) && qcontext->quic_info.sni.str){
+ if((0 == qcontext->msg_state[QUIC_SNI]) && qcontext->quic_info.sni.iov_base){
qmsg = quic_create_message(QUIC_SNI, qcontext);
quic_session_mq_publish_message_safe(sess, g_quic_plugin_env->quic_topic_id, qmsg);
qcontext->msg_state[QUIC_SNI] = 1;
}
- if((0 == qcontext->msg_state[QUIC_USER_AGENT]) && qcontext->quic_info.user_agent.str){
+ if((0 == qcontext->msg_state[QUIC_USER_AGENT]) && qcontext->quic_info.user_agent.iov_base){
qmsg = quic_create_message(QUIC_USER_AGENT, qcontext);
quic_session_mq_publish_message_safe(sess, g_quic_plugin_env->quic_topic_id, qmsg);
qcontext->msg_state[QUIC_USER_AGENT] =1;
@@ -837,8 +837,8 @@ void quic_analyze_entry(struct session *sess, const struct quic_param *g_quic_pl
}
if(push_payload){
- qcontext->quic_info.payload.str = payload;
- qcontext->quic_info.payload.str_len = payload_len;
+ qcontext->quic_info.payload.iov_base = (void *)payload;
+ qcontext->quic_info.payload.iov_len = payload_len;
qmsg = quic_create_message(QUIC_PAYLOAD, qcontext);
quic_session_mq_publish_message_safe(sess, g_quic_plugin_env->quic_topic_id, qmsg);
}
@@ -883,29 +883,29 @@ void quic_message_get_version(const struct quic_message *msg, unsigned int *resu
*result = msg->qctx->quic_info.quic_version;
}
}
-void quic_message_get_sni(const struct quic_message *msg, struct qstring *result)
+void quic_message_get_sni(const struct quic_message *msg, qstring *result)
{
assert(QUIC_MSG_HDR_MAGIC == msg->magic);
if(result){
- result->str = msg->qctx->quic_info.sni.str;
- result->str_len = msg->qctx->quic_info.sni.str_len;
+ result->iov_base = msg->qctx->quic_info.sni.iov_base;
+ result->iov_len = msg->qctx->quic_info.sni.iov_len;
}
}
-void quic_message_get_user_agent(const struct quic_message *msg, struct qstring *result)
+void quic_message_get_user_agent(const struct quic_message *msg, qstring *result)
{
assert(QUIC_MSG_HDR_MAGIC == msg->magic);
if(result){
- result->str = msg->qctx->quic_info.user_agent.str;
- result->str_len = msg->qctx->quic_info.user_agent.str_len;
+ result->iov_base = msg->qctx->quic_info.user_agent.iov_base;
+ result->iov_len = msg->qctx->quic_info.user_agent.iov_len;
}
}
-void quic_message_get_payload(const struct quic_message *msg, struct qstring *result)
+void quic_message_get_payload(const struct quic_message *msg, qstring *result)
{
assert(QUIC_MSG_HDR_MAGIC == msg->magic);
if(result){
- result->str = msg->qctx->quic_info.payload.str;
- result->str_len = msg->qctx->quic_info.payload.str_len;
+ result->iov_base = msg->qctx->quic_info.payload.iov_base;
+ result->iov_len = msg->qctx->quic_info.payload.iov_len;
}
}
diff --git a/src/quic_process.h b/src/quic_process.h
index 26c7f8b..6bca878 100644
--- a/src/quic_process.h
+++ b/src/quic_process.h
@@ -288,9 +288,9 @@ enum QUIC_VERSION_T
struct quic_info
{
unsigned int quic_version;
- struct qstring sni;
- struct qstring user_agent;
- struct qstring payload;
+ qstring sni;
+ qstring user_agent;
+ qstring payload;
// struct quic_client_hello *client_hello;
};