1PCAP_LIST_DATALINKS(3PCAP) PCAP_LIST_DATALINKS(3PCAP)
2
3
4
6 pcap_list_datalinks - get a list of link-layer header types supported
7 by a capture device
8
10 #include <pcap/pcap.h>
11
12 int pcap_list_datalinks(pcap_t *p, int **dlt_buf);
13
15 pcap_list_datalinks() is used to get a list of the supported data link
16 types of the interface associated with the pcap descriptor.
17 pcap_list_datalinks() allocates an array to hold the list and sets
18 *dlt_buf. The caller is responsible for freeing the array with
19 pcap_free_datalinks(3PCAP).
20
22 pcap_list_datalinks() returns the number of data link types in the
23 array on success and -1 on failure. If -1 is returned, pcap_geterr()
24 or pcap_perror() may be called with p as an argument to fetch or dis‐
25 play the error text.
26
28 pcap(3PCAP), pcap_geterr(3PCAP), pcap_free_datalinks(3PCAP), pcap-link‐
29 type(7)
30
31
32
33 5 April 2008 PCAP_LIST_DATALINKS(3PCAP)