1PCAP_LIST_DATALINKS(3PCAP) PCAP_LIST_DATALINKS(3PCAP)
2
3
4
6 pcap_list_datalinks, pcap_free_datalinks - get a list of link-layer
7 header types supported by a capture device, and free that list
8
10 #include <pcap/pcap.h>
11
12 int pcap_list_datalinks(pcap_t *p, int **dlt_buf);
13 void pcap_free_datalinks(int *dlt_list);
14
16 pcap_list_datalinks() is used to get a list of the supported link-layer
17 header types of the interface associated with the pcap descriptor.
18 pcap_list_datalinks() allocates an array to hold the list and sets
19 *dlt_buf to point to that array.
20
21 The caller is responsible for freeing the array with
22 pcap_free_datalinks(), which frees the list of link-layer header types
23 pointed to by dlt_list.
24
26 pcap_list_datalinks() returns the number of link-layer header types in
27 the array on success and -1 on failure. If -1 is returned,
28 pcap_geterr() or pcap_perror() may be called with p as an argument to
29 fetch or display the error text.
30
32 pcap(3PCAP), pcap_geterr(3PCAP), pcap_datalink_val_to_name(3PCAP),
33 pcap-linktype(7)
34
35
36
37 22 August 2010 PCAP_LIST_DATALINKS(3PCAP)