PCAP_LIST_TSTAMP_TYPES(3)
π NAME π
okay bestie, welcome to PCAP_LIST_TSTAMP_TYPES(3) from the Library Functions Manual β manual name folded right in, we're being cute but keeping every fact π
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 β¨
okay so pcap_list_tstamp_types() is literally your little detective for the interface associated with the pcap descriptor π΅οΈββοΈ it gets you a list of the supported time stamp types.
It allocates an array to hold the list and sets *tstamp_typesp to point to that array. If you want the whole menu of time stamp types, peek at pcap-tstamp(7) π
pcap_list_tstamp_types()β asks the interface attached to the pcap descriptor what time stamp types it supports, allocates the array for the list, and sets*tstamp_typespto point at it πpcap_free_tstamp_types()β the cleanup queen π§Ή the caller is responsible for freeing the array with this function, and it frees the list pointed to bytstamp_types.
bestie, do not ghost the free step β the caller is responsible for freeing that array with pcap_free_tstamp_types() π«Ά
πΈ RETURN VALUE πΈ
- success β
pcap_list_tstamp_types()returns the number of time stamp types in the array π₯ - failure β it returns
PCAP_ERRORπ - return value of one β means the only time stamp type supported is the one in the list, which is the capture device's default time stamp type π
- return value of zero β means the only time stamp type supported is
PCAP_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 π - if
PCAP_ERRORis returned,pcap_geterr(3)orpcap_perror(3)may be called withpas an argument to fetch or display the error text π«Ά
π 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. periodt.
π¦ SEE ALSO π¦
mwah π β this cutie is signed by the Library Functions Manual, dated 8 September 2019, page PCAP_LIST_TSTAMP_TYPES(3) π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- 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