add support for retrieving pcap packet timestamps

This commit is contained in:
luwenpeng
2024-08-23 16:04:07 +08:00
parent 6808e6ba29
commit 2634d70108
6 changed files with 31 additions and 8 deletions

View File

@@ -121,6 +121,16 @@ enum packet_action packet_get_action(const struct packet *pkt)
return pkt->meta.action;
}
void packet_set_timeval(struct packet *pkt, const struct timeval *tv)
{
pkt->meta.tv = *tv;
}
const struct timeval *packet_get_timeval(const struct packet *pkt)
{
return &pkt->meta.tv;
}
void packet_set_user_data(struct packet *pkt, void *data)
{
pkt->user_data = data;