summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2024-11-13 14:43:38 +0800
committerluwenpeng <[email protected]>2024-11-13 14:43:38 +0800
commit492a7fb8ead4d9a3f36a2e773041eb285dc34a95 (patch)
tree1aab9bbfcc69ae5a0fc18a3f2afd61da172cbe35 /test
parent8349a631e1a2542e3e7075b9c8f00e7d57337888 (diff)
add packet type raw and pseudo
Diffstat (limited to 'test')
-rw-r--r--test/session_debugger/session_debugger.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/session_debugger/session_debugger.c b/test/session_debugger/session_debugger.c
index e3a151e..5121a03 100644
--- a/test/session_debugger/session_debugger.c
+++ b/test/session_debugger/session_debugger.c
@@ -212,8 +212,7 @@ static void on_session_message(struct session *sess, enum session_state state, s
return;
}
- int is_ctrl = packet_is_ctrl(pkt);
-
+ int is_pseudo = (packet_get_type(pkt) == PACKET_TYPE_PSEUDO);
char buff[PATH_MAX];
enum flow_type flow = session_get_flow_type(sess);
assert(flow == FLOW_TYPE_C2S || flow == FLOW_TYPE_S2C);
@@ -226,7 +225,7 @@ static void on_session_message(struct session *sess, enum session_state state, s
if (flow == FLOW_TYPE_C2S)
{
- if (is_ctrl)
+ if (is_pseudo)
{
exdata->c2s_rx_ctrl_pkts++;
exdata->c2s_rx_ctrl_bytes += packet_get_raw_len(pkt);
@@ -239,7 +238,7 @@ static void on_session_message(struct session *sess, enum session_state state, s
}
else
{
- if (is_ctrl)
+ if (is_pseudo)
{
exdata->s2c_rx_ctrl_pkts++;
exdata->s2c_rx_ctrl_bytes += packet_get_raw_len(pkt);
@@ -253,11 +252,11 @@ static void on_session_message(struct session *sess, enum session_state state, s
memset(buff, 0, sizeof(buff));
session_to_str(sess, 1, buff, sizeof(buff) - 1);
- session_debugger_log(dbg->fd, "on %s %s packet: %s", session_type_to_str(session_get_type(sess)), (is_ctrl ? "ctrl" : "data"), buff);
+ session_debugger_log(dbg->fd, "on %s %s packet: %s", session_type_to_str(session_get_type(sess)), (is_pseudo ? "pseudo" : "data"), buff);
memset(buff, 0, sizeof(buff));
packet_dump_str(pkt, buff, sizeof(buff) - 1);
- session_debugger_log(dbg->fd, "rx %s %s packet\n%s", session_type_to_str(session_get_type(sess)), (is_ctrl ? "ctrl" : "data"), buff);
+ session_debugger_log(dbg->fd, "rx %s %s packet\n%s", session_type_to_str(session_get_type(sess)), (is_pseudo ? "pseudo" : "data"), buff);
pthread_spin_lock(&dbg->lock);
packet_dump_hex(pkt, dbg->fd);