Name
pcap_list_datalinks — Prototype: int pcap_list_datalinks(pcap_t *p, int **dlt_buf);
Synopsis
Purpose: pcap_list_datalinks lists all data link
types supported by a capture device. Where multiple types are
supported, a particular data link type can be selected with
pcap_set_datalink.
pcap_list_datalinks returns the number of
supported data links on success, with dlt_buf
pointing to an array of data link type values. The function returns
-1 on error. The data link type values can be
converted to human-readable link types (such as the values in Table 10-2) using the
pcap_datalink_val_to_name or
pcap_datalink_val_to_description functions. You
can find an example of using pcap_list_datalinks
in the Section 10.2.4
section earlier in this chapter.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access