when packet be claimed, clean the packet exdata

This commit is contained in:
luwenpeng
2024-11-18 15:30:35 +08:00
parent a473c2922d
commit 746d7fca06
3 changed files with 100 additions and 99 deletions

View File

@@ -24,14 +24,10 @@ struct metadata
{
struct route_ctx route_ctx;
struct sids sids;
uint64_t session_id;
uint64_t domain;
uint16_t link_id;
bool is_claim;
enum packet_direction direction;
enum packet_action action;
struct timeval tv;
};
@@ -78,6 +74,7 @@ struct packet
int8_t layers_size;
int8_t need_free;
int8_t is_defraged;
int8_t is_claim;
const char *data_ptr;
uint16_t data_len;
@@ -90,6 +87,7 @@ struct packet
struct metadata meta;
enum packet_type type;
enum packet_action action;
struct packet_origin origin;
};
@@ -109,9 +107,6 @@ enum packet_load_balance_method
void packet_set_route_ctx(struct packet *pkt, const struct route_ctx *ctx);
const struct route_ctx *packet_get_route_ctx(const struct packet *pkt);
void packet_set_origin(struct packet *pkt, struct packet_origin *origin);
struct packet_origin *packet_get_origin(struct packet *pkt);
void packet_set_sids(struct packet *pkt, const struct sids *sids);
const struct sids *packet_get_sids(const struct packet *pkt);
@@ -124,14 +119,8 @@ uint64_t packet_get_domain(const struct packet *pkt);
void packet_set_link_id(struct packet *pkt, uint16_t id);
uint16_t packet_get_link_id(const struct packet *pkt);
void packet_set_claim(struct packet *pkt, bool claim);
bool packet_is_claim(const struct packet *pkt);
void packet_set_direction(struct packet *pkt, enum packet_direction dir);
void *packet_get_user_data(struct packet *pkt);
void packet_set_user_data(struct packet *pkt, void *data);
/******************************************************************************
* tuple uitls
******************************************************************************/
@@ -180,6 +169,15 @@ void packet_set_defraged(struct packet *pkt);
void packet_push_frag(struct packet *pkt, struct packet *frag);
struct packet *packet_pop_frag(struct packet *pkt);
void packet_set_claim(struct packet *pkt, bool claim);
bool packet_is_claim(const struct packet *pkt);
void *packet_get_user_data(struct packet *pkt);
void packet_set_user_data(struct packet *pkt, void *data);
void packet_set_origin(struct packet *pkt, struct packet_origin *origin);
struct packet_origin *packet_get_origin(struct packet *pkt);
#ifdef __cplusplus
}
#endif