🎈 perf(packet utils): inline packet set route ctx
This commit is contained in:
@@ -57,6 +57,26 @@ struct packet
|
||||
struct metadata meta;
|
||||
};
|
||||
|
||||
inline void packet_set_route_ctx(struct packet *pkt, const struct route_ctx *ctx)
|
||||
{
|
||||
pkt->meta.route_ctx = *ctx;
|
||||
}
|
||||
|
||||
inline const struct route_ctx *packet_get_route_ctx(const struct packet *pkt)
|
||||
{
|
||||
return &pkt->meta.route_ctx;
|
||||
}
|
||||
|
||||
inline void packet_set_origin_ctx(struct packet *pkt, void *ctx)
|
||||
{
|
||||
pkt->meta.origin_ctx = ctx;
|
||||
}
|
||||
|
||||
inline const void *packet_get_origin_ctx(const struct packet *pkt)
|
||||
{
|
||||
return pkt->meta.origin_ctx;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user