PCAP\_LIST\_TSTAMP\_TYPES(3PCAP) PCAP\_LIST\_TSTAMP\_TYPES(3PCAP)

# [NAME](#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](#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](#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)](/man/os/libpcap/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*.

# [RETURN VALUE](#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**(3PCAP)](/man/os/libpcap/pcap_geterr.3PCAP) or [**pcap\_perror**(3PCAP)](/man/os/libpcap/pcap_perror.3PCAP) may be called with *p* as an argument to fetch or display the error text.

# [BACKWARD COMPATIBILITY](#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](#SEE_ALSO)

[**pcap**(3PCAP)](/man/os/libpcap/pcap.3PCAP), [**pcap\_tstamp\_type\_val\_to\_name**(3PCAP)](/man/os/libpcap/pcap_tstamp_type_val_to_name.3PCAP), [**pcap\_set\_tstamp\_type**(3PCAP)](/man/os/libpcap/pcap_set_tstamp_type.3PCAP), [**pcap-tstamp**(7)](/man/os/libpcap/pcap-tstamp.7)

8 September 2019

---

Document: pcap_free_tstamp_types(3pcap) from libpcap 1.11.0-r0 (Chainguard OS)
Source: https://github.com/the-tcpdump-group/libpcap.git
