---
name: "pcap_free_tstamp_types"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/pcap_free_tstamp_types"
---

# pcap\_free\_tstamp\_types(3)

get a list of time stamp types supported by a capture device, and free that list

## 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. **pcap\_list\_tstamp\_types**() allocates an array to hold the list and sets *\*tstamp\_typesp* to point to the array. See [**pcap-tstamp**(7)](/pcap-tstamp/7.md) 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*.

## RETURN VALUE

**pcap\_list\_tstamp\_types**() returns the number of time stamp types in the array on success and **PCAP\_ERROR** on failure. A return value of one means that the only time stamp type supported is the one in the list, which is the capture device's default time stamp type.  A return value of zero means that 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)](/pcap_geterr/3.md) or [**pcap\_perror**(3)](/pcap_perror/3.md) 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.

## SEE ALSO

[**pcap**(3)](/pcap/3.md), [**pcap\_tstamp\_type\_val\_to\_name**(3)](/pcap_tstamp_type_val_to_name/3.md), [**pcap-tstamp**(7)](/pcap-tstamp/7.md)
