As reported in libpcap GitHub issue #560: https://github.com/the-tcpdump-group/libpcap/issues/560 pftop fails to build. The problem is that 1) it's including a *libpcap-internal* header file, pcap-int.h, which FreeBSD, for some reason, apparently sees fit to install as a system header file (thus not discouraging programmers from including pcap-int.h and potentially depending on internals that are not only subject to change from release to release but that have changed *quite* a bit over time), and 2) that header file has, in fact, changed to include another *libpcap-internal* header file, portability.h. I see nothing in any of the pftop code that even uses libpcap - it has what appears to be a private fork of libpcap's BPF compiler. libpcap's BPF compiler source files include pcap-int.h, but that's because they're *part of libpcap* and look at some data about the pcap_t for which they're compiling code; pftop's BPF compiler doesn't even have a pcap_t to look at. Ripping out the includes of pcap-int.h, and copying over any declarations or definitions needed for pftop, would fix this problem.
Created attachment 180130 [details] Patch to make sysutils/pcap include pcap/pcap.h instead of pcap-int.h Patching the code in sysutils/pftop to include <pcap/pcap.h> instead of "pcap-int.h" or <pcap-int.h> fixes the build on 12-current.
I have also performed runtime testing to confirm pftop still works with the patch.
I just ran into the same issue while building pftop. The patch works fine for me.
A commit references this bug: Author: dim Date: Fri May 26 20:01:01 UTC 2017 New revision: 441813 URL: https://svnweb.freebsd.org/changeset/ports/441813 Log: Fix building of sysutils/pftop on FreeBSD 12, where pcap-int.h has been removed. This patches the affected files to use <pcap/pcap.h> instead. Submitted by: woodsb02 Approved by: bapt PR: 217219 MFH: 2017Q2 Changes: head/sysutils/pftop/Makefile