Obtains the link layer type for the packet capture device.
pcap Library (libpcap.a)
#include <pcap.h>
int pcap_datalink(pcap_t * p);
The pcap_datalink subroutine returns the link layer type of the packet capture device, for example, IFT_ETHER. This is useful in determining the size of the datalink header at the beginning of each packet that is read.
p | Points to the packet capture descriptor as returned by the pcap_open_live or the pcap_open_offline subroutine. |
The pcap_datalink subroutine returns the link layer type.
The pcap_close (pcap_close Subroutine) subroutine, pcap_open_live (pcap_open_live Subroutine) subroutine, pcap_open_offline (pcap_open_offline Subroutine) subroutine.