diff options
author | Guy Harris <gharris@sonic.net> | 2023-12-18 10:54:02 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2023-12-18 18:54:53 +0000 |
commit | dd6b58fcb8dd1db6f86fdd1eac550a3603814cb3 (patch) | |
tree | 24d44bd1be1a7f54b11326bd1676213ad1767d9b /sharkd.c | |
parent | b8bad2c7452b0686aa74324eb7f583b6cb3de68e (diff) |
Have a common provider routine to provide time stamps.
Replace various almost-the-same get_frame_ts routines with a common
routine.
Diffstat (limited to 'sharkd.c')
-rw-r--r-- | sharkd.c | 19 |
1 files changed, 1 insertions, 18 deletions
@@ -213,28 +213,11 @@ clean_exit: return ret; } -static const nstime_t * -sharkd_get_frame_ts(struct packet_provider_data *prov, guint32 frame_num) -{ - const frame_data *fd = NULL; - if (prov->ref && prov->ref->num == frame_num) { - fd = prov->ref; - } else if (prov->prev_dis && prov->prev_dis->num == frame_num) { - fd = prov->prev_dis; - } else if (prov->prev_cap && prov->prev_cap->num == frame_num) { - fd = prov->prev_cap; - } else if (prov->frames) { - fd = frame_data_sequence_find(prov->frames, frame_num); - } - - return (fd && fd->has_ts) ? &fd->abs_ts : NULL; -} - static epan_t * sharkd_epan_new(capture_file *cf) { static const struct packet_provider_funcs funcs = { - sharkd_get_frame_ts, + cap_file_provider_get_frame_ts, cap_file_provider_get_interface_name, cap_file_provider_get_interface_description, cap_file_provider_get_modified_block |