perf: 删除无效代码;修改变量命名;减少内存分配
This commit is contained in:
@@ -49,11 +49,11 @@ struct metadata
|
||||
uint64_t session_id;
|
||||
uint32_t rehash_index;
|
||||
|
||||
char *raw_data;
|
||||
char *raw_data; // refer to current packet data
|
||||
int raw_len;
|
||||
uint16_t l7offset;
|
||||
|
||||
int is_e2i_dir;
|
||||
int direction; // 1: E2I; 0: I2E
|
||||
int is_ctrl_pkt;
|
||||
int is_decrypted;
|
||||
|
||||
@@ -61,11 +61,10 @@ struct metadata
|
||||
struct route_ctx route_ctx;
|
||||
};
|
||||
|
||||
struct metadata *metadata_new();
|
||||
int metadata_is_empty(struct metadata *meta);
|
||||
void metadata_shallow_copy(struct metadata *dst, struct metadata *src);
|
||||
void metadata_deep_copy(struct metadata *dst, struct metadata *src);
|
||||
void metadata_free(struct metadata *meta);
|
||||
int metadata_isempty(struct metadata *meta);
|
||||
void metadata_copy(struct metadata *dst, struct metadata *src);
|
||||
|
||||
char *memdup(const char *src, int len);
|
||||
|
||||
/******************************************************************************
|
||||
* Struct Session Ctx
|
||||
@@ -75,18 +74,24 @@ struct session_ctx
|
||||
{
|
||||
uint64_t session_id;
|
||||
char *session_addr;
|
||||
|
||||
// dup from received control packet, for sending control packet
|
||||
char *ctrl_packet_header_data;
|
||||
uint16_t ctrl_packet_header_len;
|
||||
|
||||
uint16_t vxlan_src_port;
|
||||
|
||||
struct four_tuple inner_tuple4;
|
||||
struct mutable_array rule_ids;
|
||||
|
||||
struct metadata *decrypted_meta_i2e;
|
||||
struct metadata *decrypted_meta_e2i;
|
||||
struct metadata *raw_meta_i2e;
|
||||
struct metadata *raw_meta_e2i;
|
||||
struct metadata *ctrl_meta;
|
||||
struct metadata decrypted_meta_i2e;
|
||||
struct metadata decrypted_meta_e2i;
|
||||
struct metadata raw_meta_i2e;
|
||||
struct metadata raw_meta_e2i;
|
||||
struct metadata ctrl_meta;
|
||||
|
||||
struct selected_chainings chainings;
|
||||
struct selected_chaining *chaining_raw;
|
||||
struct selected_chaining *chaining_decrypted;
|
||||
|
||||
struct thread_ctx *ref_thread_ctx;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user