SCE支持动态更新sid list; SCE存储raw packet/decrypted packet共计4个方向的metadata
This commit is contained in:
@@ -28,6 +28,21 @@ int metadata_is_empty(struct metadata *meta)
|
||||
}
|
||||
}
|
||||
|
||||
void metadata_shallow_copy(struct metadata *dst, struct metadata *src)
|
||||
{
|
||||
dst->write_ref++;
|
||||
dst->session_id = src->session_id;
|
||||
dst->raw_data = NULL;
|
||||
dst->raw_len = 0;
|
||||
dst->l7offset = src->l7offset;
|
||||
dst->is_e2i_dir = src->is_e2i_dir;
|
||||
dst->is_ctrl_pkt = src->is_ctrl_pkt;
|
||||
dst->is_decrypted = src->is_decrypted;
|
||||
|
||||
sids_copy(&dst->sids, &src->sids);
|
||||
route_ctx_copy(&dst->route_ctx, &src->route_ctx);
|
||||
}
|
||||
|
||||
void metadata_deep_copy(struct metadata *dst, struct metadata *src)
|
||||
{
|
||||
dst->write_ref++;
|
||||
@@ -70,6 +85,8 @@ struct session_ctx *session_ctx_new()
|
||||
|
||||
fixed_num_array_init(&session_ctx->rule_ids);
|
||||
|
||||
session_ctx->decrypted_meta_i2e = metadata_new();
|
||||
session_ctx->decrypted_meta_e2i = metadata_new();
|
||||
session_ctx->raw_meta_i2e = metadata_new();
|
||||
session_ctx->raw_meta_e2i = metadata_new();
|
||||
session_ctx->ctrl_meta = metadata_new();
|
||||
@@ -81,6 +98,18 @@ void session_ctx_free(struct session_ctx *session_ctx)
|
||||
{
|
||||
if (session_ctx)
|
||||
{
|
||||
if (session_ctx->decrypted_meta_i2e)
|
||||
{
|
||||
metadata_free(session_ctx->decrypted_meta_i2e);
|
||||
session_ctx->decrypted_meta_i2e = NULL;
|
||||
}
|
||||
|
||||
if (session_ctx->decrypted_meta_e2i)
|
||||
{
|
||||
metadata_free(session_ctx->decrypted_meta_e2i);
|
||||
session_ctx->decrypted_meta_e2i = NULL;
|
||||
}
|
||||
|
||||
if (session_ctx->raw_meta_i2e)
|
||||
{
|
||||
metadata_free(session_ctx->raw_meta_i2e);
|
||||
|
||||
Reference in New Issue
Block a user