Refactor Packet I/O
This commit is contained in:
@@ -1625,18 +1625,18 @@ int packet_get_route_ctx(const struct packet *pkt, char *buff, int size)
|
||||
return meta->route.len;
|
||||
}
|
||||
|
||||
void packet_set_user_data(struct packet *pkt, void *user_data)
|
||||
void packet_set_io_ctx(struct packet *pkt, void *ctx)
|
||||
{
|
||||
struct metadata *meta = &pkt->meta;
|
||||
|
||||
meta->user_data = user_data;
|
||||
meta->io_ctx = ctx;
|
||||
}
|
||||
|
||||
void *packet_get_user_data(const struct packet *pkt)
|
||||
void *packet_get_io_ctx(const struct packet *pkt)
|
||||
{
|
||||
const struct metadata *meta = &pkt->meta;
|
||||
|
||||
return meta->user_data;
|
||||
return meta->io_ctx;
|
||||
}
|
||||
|
||||
void packet_set_domain(struct packet *pkt, uint64_t domain)
|
||||
@@ -1749,7 +1749,7 @@ struct packet *packet_dup(const struct packet *pkt)
|
||||
dup_pkt->need_free = true;
|
||||
|
||||
struct metadata *meta = &dup_pkt->meta;
|
||||
meta->user_data = NULL;
|
||||
meta->io_ctx = NULL;
|
||||
|
||||
// update layers
|
||||
for (int8_t i = 0; i < pkt->layers_used; i++)
|
||||
|
||||
Reference in New Issue
Block a user