PCAP\_DATALINK\_VAL\_TO\_NAME(3PCAP) PCAP\_DATALINK\_VAL\_TO\_NAME(3PCAP)

# [NAME](#NAME)

pcap\_datalink\_val\_to\_name, pcap\_datalink\_val\_to\_description, pcap\_datalink\_val\_to\_description\_or\_dlt - get a name or description for a link-layer header type value

# [SYNOPSIS](#SYNOPSIS)

```
#include <pcap.h>
```

```
const char *pcap_datalink_val_to_name(int dlt);
const char *pcap_datalink_val_to_description(int dlt);
const char *pcap_datalink_val_to_description_or_dlt(int dlt);
```

# [DESCRIPTION](#DESCRIPTION)

**pcap\_datalink\_val\_to\_name**() translates a link-layer header type value to the corresponding link-layer header type name, which is the **DLT\_** name for the link-layer header type value with the **DLT\_** removed. A null pointer is returned if the type value does not correspond to a known **DLT\_** value.

**pcap\_datalink\_val\_to\_description**() translates a link-layer header type value to a short description of that link-layer header type. A null pointer is returned if the type value does not correspond to a known **DLT\_** value.

**pcap\_datalink\_val\_to\_description\_or\_dlt**() translates a link-layer header type value to a short description of that link-layer header type just like **pcap\_datalink\_val\_to\_description**(). If the type value does not correspond to a known **DLT\_** value, the string "DLT n" is returned, where n is the value of the dlt argument.

# [BACKWARD COMPATIBILITY](#BACKWARD_COMPATIBILITY)

The **pcap\_datalink\_val\_to\_description\_or\_dlt**() function first became available in libpcap release 1.9.1. In previous releases, **pcap\_datalink\_val\_to\_description**() would have to be called and, if it returned a null pointer, a default string would have to be constructed.

# [SEE ALSO](#SEE_ALSO)

[**pcap**(3PCAP)](/man/os/libpcap/pcap.3PCAP), [**pcap\_datalink**(3PCAP)](/man/os/libpcap/pcap_datalink.3PCAP), [**pcap\_list\_datalinks**(3PCAP)](/man/os/libpcap/pcap_list_datalinks.3PCAP), [**pcap\_datalink\_name\_to\_val**(3PCAP)](/man/os/libpcap/pcap_datalink_name_to_val.3PCAP)

6 September 2026

---

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