PCAP_LIST_TSTAMP_TYPES(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– 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_typesp to 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 by tstamp_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_ERROR is returned, pcap_geterr(3) or pcap_perror(3) may be called with p as 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