tcpdump mailing list archives

Add WinPcap specific functions like pcap_open() to libpcap on Windows for binary compatibility


From: Yang Luo <hsluoyb () gmail com>
Date: Tue, 28 Jun 2016 14:22:24 +0800

Hi list,

When compiling WinDump (https://github.com/hsluoyz/WinDump) against the
latest libpcap's SDK, I encountered the following errors:

1>  Generating Code...
1>wpcap.lib(wpcap.dll) : error LNK2005: pcap_list_datalinks already defined
in datalinks.obj
1>wpcap.lib(wpcap.dll) : error LNK2005: pcap_datalink_val_to_description
already defined in dlnames.obj
1>wpcap.lib(wpcap.dll) : error LNK2005: bpf_dump already defined in
bpf_dump.obj
1>     Creating library x64\Debug\WinDump.lib and object
x64\Debug\WinDump.exp
1>addrtoname.obj : error LNK2019: unresolved external symbol endservent
referenced in function init_servarray
1>addrtoname.obj : error LNK2019: unresolved external symbol getservent
referenced in function init_servarray
1>addrtoname.obj : error LNK2001: unresolved external symbol __imp_eproto_db
1>Tcpdump.obj : error LNK2019: unresolved external symbol wsockinit
referenced in function main
1>Tcpdump.obj : error LNK2019: unresolved external symbol pcap_open
referenced in function main
1>x64\Debug\WinDump.exe : fatal error LNK1120: 5 unresolved externals


This is because libpcap doesn't have some functions that are available in
WinPcap, like pcap_open, pcap_findalldevs_ex, etc. And what's worse, these
functions are quite often used, nearly every application uses them.

I think this also might explains my previous post: "Why the wpcap.dll built
from the latest libpcap doesn't work for any existing applications?". The
missing procedures are just these ones.

So my thought is we need to add back those functions to libpcap on Windows,
the related source code files are remote-ext.h, pcap-new.c, etc, which
don't exist in libpcap. So are we OK with this?


Cheers,
Yang
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Current thread: