pcap_datalink_val_to_name(3pcap)

pcap_datalink_val_to_name3pcap

Get a name or description for a link-layer header type value

Usage

#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);

Overview

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. NULL 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. NULL 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

The pcap_datalink_val_to_description_or_dlt() function first became available in libpcap release 1.10.0. In previous releases, pcap_datalink_val_to_description() would have to be called and, if it returned NULL, a default string would have to be constructed.

Releases

90 releases since Mac OS X 10.6; the text changed 7 times.

  1. 10.6–10.6.8
  2. 10.7–10.8.5
  3. 10.9–10.9.5
  4. 10.10–10.11.6
  5. 10.12–10.14.6
  6. 10.15–10.15.1
  7. 10.15.2–12.5
  8. 13.0–26.5

From libpcap 146 in macOS 26.5. Parsed by carta from the page's man source.