Update session.h: support get tuple6 by session

This commit is contained in:
luwenpeng
2024-05-15 16:29:33 +08:00
parent 5e10870833
commit 7b20747c8f
17 changed files with 138 additions and 138 deletions

View File

@@ -270,7 +270,7 @@ static int tcp_init(struct session_manager *mgr, struct session *sess)
}
SESSION_LOG_DEBUG("session %lu %s new c2s tcp assembler %p, s2c tcp assembler %p",
session_get_id(sess), session_get_tuple_str(sess),
session_get_id(sess), session_get_tuple6_str(sess),
sess->tcp_halfs[FLOW_DIRECTION_C2S].assembler,
sess->tcp_halfs[FLOW_DIRECTION_S2C].assembler);
@@ -422,13 +422,13 @@ static enum flow_direction identify_direction_by_port(uint16_t src_port, uint16_
static enum flow_direction identify_direction_by_history(const struct session *sess, const struct tuple6 *key)
{
if (tuple6_cmp(session_get_tuple(sess), key) == 0)
if (tuple6_cmp(session_get_tuple6(sess), key) == 0)
{
return session_get_tuple_direction(sess);
return session_get_tuple6_direction(sess);
}
else
{
return (session_get_tuple_direction(sess) == FLOW_DIRECTION_C2S ? FLOW_DIRECTION_S2C : FLOW_DIRECTION_C2S);
return (session_get_tuple6_direction(sess) == FLOW_DIRECTION_C2S ? FLOW_DIRECTION_S2C : FLOW_DIRECTION_C2S);
}
}
@@ -614,7 +614,7 @@ static void session_manager_evicte_session(struct session_manager *mgr, struct s
session_table_del(mgr->udp_sess_table, sess);
if (mgr->opts.evicted_session_filter_enable)
{
evicted_session_filter_add(mgr->evicte_sess_filter, session_get_tuple(sess), now);
evicted_session_filter_add(mgr->evicte_sess_filter, session_get_tuple6(sess), now);
}
SESS_MGR_STAT_UPDATE(&mgr->stat, curr_state, next_state, udp);
mgr->stat.nr_udp_sess_evicted++;