PCAP_SET_TSTAMP_PRECISION(3PCAP)
π NAME π
okay bestie, this is PCAP_SET_TSTAMP_PRECISION(3PCAP) β yep, the 3PCAP manual β and the actual name is pcap_set_tstamp_precision: it sets the time stamp precision returned in captures. Sheβs specific, sheβs useful, she slays. π
β¨ SYNOPSIS β¨
#include <pcap/pcap.h>
int pcap_set_tstamp_precision(pcap_t *p, int tstamp_precision);
πΈ DESCRIPTION πΈ
So pcap_set_tstamp_precision() sets the precision of the time stamp you want for packets captured on the pcap descriptor, using the type you pass in tstamp_precision. Iconic behavior. π
π¨ important vibe check: it must be called on a pcap descriptor created bypcap_create(3PCAP)that has not yet been activated bypcap_activate(3PCAP). No activating it first, bestie β thatβs not the move. π
There are two time stamp precisions supported, microseconds and nanoseconds. You can use the options:
PCAP_TSTAMP_PRECISION_MICROβ request microsecond precision.PCAP_TSTAMP_PRECISION_NANOβ request nanosecond precision.
By default, time stamps are in microseconds. Periodt. β
π RETURN VALUE π
pcap_set_tstamp_precision() returns:
0on success, if the specified time stamp precision is expected to be supported by the capture device β we love a supportive device π«ΆPCAP_ERROR_TSTAMP_PRECISION_NOTSUPif the capture device does not support the requested time stamp precision β the device said no πPCAP_ERROR_ACTIVATEDif called on a capture handle that has been activated β you activated it first, bestie, and the function noticed π
π¦ BACKWARD COMPATIBILITY π¦
This function became available in libpcap release 1.5.1 π. In previous releases, time stamps from a capture device or savefile are always given in seconds and microseconds. So if youβre time-traveling in old libpcap, thatβs the deal. π°οΈ
π₯ SEE ALSO π₯
pcap(3PCAP)pcap_get_tstamp_precision(3PCAP)pcap-tstamp(7)
xoxo, the PCAP_SET_TSTAMP_PRECISION(3PCAP) page from libpcap π β dated 23 August 2018 π
π¦ where this page comes from
- alpine 3.22: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- alpine 3.23: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- alpine 3.24: libpcap-doc 1.10.7-r0 Β· BSD-3-Clause
- debian trixie: libpcap0.8-dev 1.10.5-2
- fedora 43: libpcap-devel 14:1.10.5-3.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.5-3.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.7-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 43: libpcap-devel 14:1.10.7-1.fc43 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.6-2.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.6-2.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.7-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- fedora 44: libpcap-devel 14:1.10.7-1.fc44 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- nixos 26.05: libpcap 1.10.7
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libpcap-devel 1.10.5-160000.5.1 Β· BSD-3-Clause
- ubuntu questing: libpcap0.8-dev 1.10.5-2ubuntu2
- ubuntu resolute: libpcap0.8-dev 1.10.6-1ubuntu1 Β· BSD-3-clause-var3
- ubuntu resolute: libpcap0.8-dev 1.10.6-1ubuntu1.1 Β· BSD-3-clause-var3
- ubuntu stonking: libpcap0.8-dev 1.10.7-1ubuntu1 Β· BSD-3-clause-var3
- Copyright (c) 2013, Michal Sekletar
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms