for classic pcap, pcap_datalink() returns the DLT_* types (linktype is converted via linktype_to_dlt when reading a packet)
for pcap-ng, pcap_datalink() retuns the LINKTYPE_* types (linktype is not converted when reading) as described here:
http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#appendixLinkTypes
Now, these constants are not exported (defined in pcap-common.c).
In order to use a generic api for reading pcap and pcap-ng, pcap_datalink() should return the DLT_* value for pcap-ng.
As a second option, the LINKTYPE_* values should be exported to a header file and a second function (pcap_linktype() or so) should be introduced to return the LINKTYPE_* values without conversion.
I've checked a fix into the trunk and 1.x branch to convert the LINKTYPE_ value to a DLT_ value in sf-pcap-ng.c.
Administrators of the "libpcap" SourceForge project have superseded this tracker item (formerly artifact 3032040, now bug 137) with issue 139 of the "libpcap" GitHub project.