add packet type raw and pseudo
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user