From aca55a29f7b982e7a0bd9911d1d176561c8d7a84 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 7 Aug 2017 16:38:52 +0200 Subject: Add hardware timestamping support pcap provides a pcap_set_tstamp_type function, which can be used to request hardware timestamps from a supporting kernel. This patch adds support for aforementioned function as well as two new command line options to dumpcap, wireshark and tshark: --list-time-stamp-types List time stamp types supported for the interface --time-stamp-type Change the interface's timestamp method Name choice mimics those used by tcpdump(1), which already supports this feature. However, unlike tcpdump, we provide both options unconditionally. If Wireshark was configured without pcap_set_tstamp_type being available, --list-time-stamp-types reports an empty list. Change-Id: I418a4b2b84cb01949cd262aad0ad8427f5ac0652 Signed-off-by: Ahmad Fatoum Reviewed-on: https://code.wireshark.org/review/23113 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- capchild/capture_sync.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'capchild/capture_sync.c') diff --git a/capchild/capture_sync.c b/capchild/capture_sync.c index 96911bddae..9f3d0ca0b9 100644 --- a/capchild/capture_sync.c +++ b/capchild/capture_sync.c @@ -412,6 +412,10 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, inf argv = sync_pipe_add_arg(argv, &argc, ssampling); } #endif + if (interface_opts.timestamp_type) { + argv = sync_pipe_add_arg(argv, &argc, "--time-stamp-type"); + argv = sync_pipe_add_arg(argv, &argc, interface_opts.timestamp_type); + } } /* dumpcap should be running in capture child mode (hidden feature) */ @@ -1302,6 +1306,7 @@ sync_if_capabilities_open(const gchar *ifname, gboolean monitor_mode, const gcha argv = sync_pipe_add_arg(argv, &argc, "-i"); argv = sync_pipe_add_arg(argv, &argc, ifname); argv = sync_pipe_add_arg(argv, &argc, "-L"); + argv = sync_pipe_add_arg(argv, &argc, "--list-time-stamp-types"); if (monitor_mode) argv = sync_pipe_add_arg(argv, &argc, "-I"); if (auth) { -- cgit v1.2.3