PCAP_LIST_TSTAMP_TYPES(3PCAP)
okay so bestie, welcome to PCAP_LIST_TSTAMP_TYPES(3PCAP) β the manual page thatβs literally giving βwhich time stamp types can my capture device serve, and how do I free that list after?β energy. β¨
π NAME π
pcap_list_tstamp_types,pcap_free_tstamp_typesβ get a list of time stamp types supported by a capture device, and free that list. π
β¨ SYNOPSIS β¨
#include <pcap/pcap.h>
int pcap_list_tstamp_types(pcap_t *p, int **tstamp_typesp);
void pcap_free_tstamp_types(int *tstamp_types);
π DESCRIPTION π
pcap_list_tstamp_types() is used to get a list of the supported time stamp types of the interface associated with the pcap descriptor. It allocates an array to hold the list and sets *tstamp_typesp to point to the array. See pcap-tstamp(7) for a list of all the time stamp types. π
The caller is responsible for freeing the array with pcap_free_tstamp_types(), which frees the list pointed to by tstamp_types. So yeah, cleanup is your main character moment, not libpcapβs. π«Ά
π₯ RETURN VALUE π₯
pcap_list_tstamp_types() returns the number of time stamp types in the array on success and PCAP_ERROR on failure.
- Return value
1? That means the only time stamp type supported is the one in the list, which is the capture deviceβs default time stamp type. Slay, singular. π - Return value
0? That means the only time stamp type supported isPCAP_TSTAMP_HOST, which is the capture deviceβs default time stamp type. (Only older versions of libpcap will return that; newer versions will always return one or more types.) Iconic legacy behavior, ngl. π°οΈ
If PCAP_ERROR is returned, pcap_geterr(3PCAP) or pcap_perror(3PCAP) may be called with p as an argument to fetch or display the error text. So you can get the tea on what went wrong. π
π BACKWARD COMPATIBILITY π
These functions became available in libpcap release 1.2.1. In previous releases, the time stamp type cannot be set; only the default time stamp type offered by a capture source is available. So if youβre time-traveling to older libpcap, adjust your expectations, bestie. β³
π SEE ALSO π
pcap(3PCAP)pcap_tstamp_type_val_to_name(3PCAP)pcap-tstamp(7)
mwah π β source/version: PCAP_LIST_TSTAMP_TYPES(3PCAP), dated 8 September 2019.
π¦ 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
- centos-stream 10: libpcap-devel 14:1.10.4-8.el10 Β· ISC AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC
- debian bookworm: libpcap0.8-dev 1.10.3-1
- 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 noble: libpcap0.8-dev 1.10.4-4.1ubuntu3
- ubuntu noble: libpcap0.8-dev 1.10.4-4.1ubuntu3.1
- 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) 1994, 1996, 1997 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms