session manager add packet_tag: (PKT_TAG_KEY_SESS, PKT_TAG_VAL_SESS_NEW/FREE/CTRL_MSG/TCP_STREAM)

This commit is contained in:
luwenpeng
2024-11-25 10:53:21 +08:00
parent efc6f46ca0
commit cce1155ae3
11 changed files with 286 additions and 203 deletions

View File

@@ -17,6 +17,7 @@ struct tcp_segment_internal
struct interval_tree_node node;
TAILQ_ENTRY(tcp_segment_internal) lru;
struct tcp_segment seg;
void *user_data;
void *data; // flexible array member
};
@@ -66,6 +67,18 @@ void tcp_segment_free(struct tcp_segment *seg)
}
}
void tcp_segment_set_user_data(struct tcp_segment *seg, void *user_data)
{
struct tcp_segment_internal *p = container_of(seg, struct tcp_segment_internal, seg);
p->user_data = user_data;
}
void *tcp_segment_get_user_data(const struct tcp_segment *seg)
{
struct tcp_segment_internal *p = container_of(seg, struct tcp_segment_internal, seg);
return p->user_data;
}
struct tcp_reassembly *tcp_reassembly_new(uint64_t max_timeout, uint64_t max_seg_num)
{
struct tcp_reassembly *tcp_reass = (struct tcp_reassembly *)malloc(sizeof(struct tcp_reassembly));