PCAP_GET_TSTAMP_PRECISION(3PCAP)

πŸ“¦
version 1.11.0 Β· 2 versions
  • 1.11.0 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.10.1 Β· centos-stream 9, nixpkgs unstable, ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

pcap_get_tstamp_precision β€” bestie, this one tells you the time stamp precision you're getting back in your captures πŸ•°οΈβœ¨


🌸 SYNOPSIS 🌸

#include <pcap/pcap.h>

int pcap_get_tstamp_precision(pcap_t *p);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk: pcap_get_tstamp_precision() hands you back the precision of the time stamp that gets returned in packet captures on that pcap descriptor. that's it. that's the whole job. she's a one-trick pony and she's slaying at it πŸ’…


✨ RETURN VALUE ✨

she returns either PCAP_TSTAMP_PRECISION_MICRO or PCAP_TSTAMP_PRECISION_NANO, which is basically the universe telling you that your pcap captures contain time stamps in microseconds or nanoseconds respectively πŸŽ€

not me checking which one I got before doing math on my timestamps… could NOT be me getting it wrong πŸ™ˆ

πŸ’œ 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 on something ancient, that's the vibe, no nano for you 😭


🌈 SEE ALSO 🌈


k that's the whole page bestie 🫢 go forth and timestamp accurately ✨

this was brought to you by the libpcap girlies, dated 23 August 2018 β€” 3PCAP, periodt πŸ‘‘πŸ’–

πŸ“¦ where this page comes from