aboutsummaryrefslogtreecommitdiffstats
path: root/sharkd.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2023-12-18 10:54:02 -0800
committerGuy Harris <gharris@sonic.net>2023-12-18 18:54:53 +0000
commitdd6b58fcb8dd1db6f86fdd1eac550a3603814cb3 (patch)
tree24d44bd1be1a7f54b11326bd1676213ad1767d9b /sharkd.c
parentb8bad2c7452b0686aa74324eb7f583b6cb3de68e (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.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/sharkd.c b/sharkd.c
index c53db8e774..7b78ec9e5d 100644
--- a/sharkd.c
+++ b/sharkd.c
@@ -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