🎈 perf(packet utils): inline packet set route ctx
This commit is contained in:
@@ -57,6 +57,26 @@ struct packet
|
|||||||
struct metadata meta;
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -15,16 +15,6 @@
|
|||||||
* metadata utils
|
* metadata utils
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
void packet_set_route_ctx(struct packet *pkt, const struct route_ctx *ctx)
|
|
||||||
{
|
|
||||||
pkt->meta.route_ctx = *ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
const struct route_ctx *packet_get_route_ctx(const struct packet *pkt)
|
|
||||||
{
|
|
||||||
return &pkt->meta.route_ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
void packet_set_sids(struct packet *pkt, const struct sids *sids)
|
void packet_set_sids(struct packet *pkt, const struct sids *sids)
|
||||||
{
|
{
|
||||||
pkt->meta.sids = *sids;
|
pkt->meta.sids = *sids;
|
||||||
@@ -116,15 +106,6 @@ enum packet_action packet_get_action(const struct packet *pkt)
|
|||||||
return pkt->meta.action;
|
return pkt->meta.action;
|
||||||
}
|
}
|
||||||
|
|
||||||
void packet_set_origin_ctx(struct packet *pkt, void *ctx)
|
|
||||||
{
|
|
||||||
pkt->meta.origin_ctx = ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
const void *packet_get_origin_ctx(const struct packet *pkt)
|
|
||||||
{
|
|
||||||
return pkt->meta.origin_ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* tuple uitls
|
* tuple uitls
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ extern "C"
|
|||||||
* metadata utils
|
* metadata utils
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
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_sids(struct packet *pkt, const struct sids *sids);
|
void packet_set_sids(struct packet *pkt, const struct sids *sids);
|
||||||
const struct sids *packet_get_sids(const struct packet *pkt);
|
const struct sids *packet_get_sids(const struct packet *pkt);
|
||||||
@@ -37,8 +35,6 @@ enum packet_direction packet_get_direction(const struct packet *pkt);
|
|||||||
void packet_set_action(struct packet *pkt, enum packet_action action);
|
void packet_set_action(struct packet *pkt, enum packet_action action);
|
||||||
enum packet_action packet_get_action(const struct packet *pkt);
|
enum packet_action packet_get_action(const struct packet *pkt);
|
||||||
|
|
||||||
void packet_set_origin_ctx(struct packet *pkt, void *ctx);
|
|
||||||
const void *packet_get_origin_ctx(const struct packet *pkt);
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* tuple uitls
|
* tuple uitls
|
||||||
|
|||||||
Reference in New Issue
Block a user