autoconf, cmake: fix generated pcap-config and libpcap.pc.

In libpcap.pc, don't put libraries into Libs.private if we can just put
the package to which the libraries belong in Requires.private and let
pkg-config do the work.

When configuring with CMake, make sure that we do *NOT* put library full
paths into the lists of libraries required when linking statically
against libpcap.

In the configure script, do a push settings/pop settings
operation before checking various libraries similar to what's done in
CMake files, to make sure that the results of the tests aren't affected
by tests done previously.

Have the macros for autoconf that run pcap-config take arbitrary
arguments rather than a single flag value, to allow testing with --libs
and --static.

This should fix issue #1062.

(cherry picked from commit 6493919a4c7cf15d3d4f9878b2f290dd36efafc0)
10 files changed
tree: 86f331385d71c34bcf9ec191f504ac2d90ca623d
  1. .github/
  2. ChmodBPF/
  3. cmake/
  4. doc/
  5. lbl/
  6. missing/
  7. msdos/
  8. pcap/
  9. rpcapd/
  10. testprogs/
  11. tests/
  12. .appveyor.yml
  13. .ci-coverity-scan-build.sh
  14. .cirrus.yml
  15. .gitattributes
  16. .gitignore
  17. .mailmap
  18. aclocal.m4
  19. arcnet.h
  20. atmuni31.h
  21. bpf_dump.c
  22. bpf_filter.c
  23. bpf_image.c
  24. build.sh
  25. build_common.sh
  26. build_matrix.sh
  27. CHANGES
  28. charconv.c
  29. charconv.h
  30. chmod_bpf
  31. cmake_uninstall.cmake.in
  32. cmakeconfig.h.in
  33. CMakeLists.txt
  34. config.guess
  35. config.h.in
  36. config.sub
  37. configure
  38. configure.ac
  39. CONTRIBUTING.md
  40. CREDITS
  41. diag-control.h
  42. dlpisubs.c
  43. dlpisubs.h
  44. etherent.c
  45. ethertype.h
  46. extract.h
  47. fad-getad.c
  48. fad-gifc.c
  49. fad-glifc.c
  50. fmtutils.c
  51. fmtutils.h
  52. ftmacros.h
  53. gencode.c
  54. gencode.h
  55. grammar.y.in
  56. ieee80211.h
  57. install-sh
  58. INSTALL.md
  59. libpcap.pc.in
  60. LICENSE
  61. llc.h
  62. Makefile-devel-adds
  63. Makefile.in
  64. mkdep
  65. nametoaddr.c
  66. nametoaddr.h
  67. nlpid.h
  68. nomkdep
  69. optimize.c
  70. optimize.h
  71. org.tcpdump.chmod_bpf.plist
  72. pcap-airpcap.c
  73. pcap-airpcap.h
  74. pcap-bpf.c
  75. pcap-bpf.h
  76. pcap-bt-linux.c
  77. pcap-bt-linux.h
  78. pcap-bt-monitor-linux.c
  79. pcap-bt-monitor-linux.h
  80. pcap-common.c
  81. pcap-common.h
  82. pcap-config.1
  83. pcap-config.in
  84. pcap-dag.c
  85. pcap-dag.h
  86. pcap-dbus.c
  87. pcap-dbus.h
  88. pcap-dll.rc
  89. pcap-dlpi.c
  90. pcap-dos.c
  91. pcap-dos.h
  92. pcap-dpdk.c
  93. pcap-dpdk.h
  94. pcap-enet.c
  95. pcap-filter.manmisc.in
  96. pcap-haiku.cpp
  97. pcap-int.h
  98. pcap-libdlpi.c
  99. pcap-linktype.manmisc.in
  100. pcap-linux.c
  101. pcap-namedb.h
  102. pcap-netfilter-linux.c
  103. pcap-netfilter-linux.h
  104. pcap-netmap.c
  105. pcap-netmap.h
  106. pcap-new.c
  107. pcap-nit.c
  108. pcap-npf.c
  109. pcap-null.c
  110. pcap-pf.c
  111. pcap-rdmasniff.c
  112. pcap-rdmasniff.h
  113. pcap-rpcap-int.h
  114. pcap-rpcap.c
  115. pcap-rpcap.h
  116. pcap-savefile.manfile.in
  117. pcap-septel.c
  118. pcap-septel.h
  119. pcap-sita.c
  120. pcap-sita.h
  121. pcap-sita.html
  122. pcap-snf.c
  123. pcap-snf.h
  124. pcap-snit.c
  125. pcap-snoop.c
  126. pcap-tc.c
  127. pcap-tc.h
  128. pcap-tstamp.manmisc.in
  129. pcap-types.h
  130. pcap-usb-linux-common.c
  131. pcap-usb-linux-common.h
  132. pcap-usb-linux.c
  133. pcap-usb-linux.h
  134. pcap-util.c
  135. pcap-util.h
  136. pcap.3pcap.in
  137. pcap.c
  138. pcap.h
  139. pcap_activate.3pcap
  140. pcap_breakloop.3pcap
  141. pcap_can_set_rfmon.3pcap
  142. pcap_close.3pcap
  143. pcap_compile.3pcap.in
  144. pcap_create.3pcap
  145. pcap_datalink.3pcap.in
  146. pcap_datalink_name_to_val.3pcap
  147. pcap_datalink_val_to_name.3pcap
  148. pcap_dump.3pcap
  149. pcap_dump_close.3pcap
  150. pcap_dump_file.3pcap
  151. pcap_dump_flush.3pcap
  152. pcap_dump_ftell.3pcap
  153. pcap_dump_open.3pcap.in
  154. pcap_file.3pcap
  155. pcap_fileno.3pcap
  156. pcap_findalldevs.3pcap
  157. pcap_freecode.3pcap
  158. pcap_get_required_select_timeout.3pcap
  159. pcap_get_selectable_fd.3pcap
  160. pcap_get_tstamp_precision.3pcap.in
  161. pcap_geterr.3pcap
  162. pcap_init.3pcap
  163. pcap_inject.3pcap
  164. pcap_is_swapped.3pcap
  165. pcap_lib_version.3pcap
  166. pcap_list_datalinks.3pcap.in
  167. pcap_list_tstamp_types.3pcap.in
  168. pcap_lookupdev.3pcap
  169. pcap_lookupnet.3pcap
  170. pcap_loop.3pcap
  171. pcap_major_version.3pcap
  172. pcap_next_ex.3pcap
  173. pcap_offline_filter.3pcap
  174. pcap_open_dead.3pcap.in
  175. pcap_open_live.3pcap
  176. pcap_open_offline.3pcap.in
  177. pcap_set_buffer_size.3pcap
  178. pcap_set_datalink.3pcap
  179. pcap_set_immediate_mode.3pcap.in
  180. pcap_set_promisc.3pcap
  181. pcap_set_protocol_linux.3pcap
  182. pcap_set_rfmon.3pcap
  183. pcap_set_snaplen.3pcap
  184. pcap_set_timeout.3pcap
  185. pcap_set_tstamp_precision.3pcap.in
  186. pcap_set_tstamp_type.3pcap.in
  187. pcap_setdirection.3pcap
  188. pcap_setfilter.3pcap
  189. pcap_setnonblock.3pcap
  190. pcap_snapshot.3pcap
  191. pcap_stats.3pcap
  192. pcap_statustostr.3pcap
  193. pcap_strerror.3pcap
  194. pcap_tstamp_type_name_to_val.3pcap
  195. pcap_tstamp_type_val_to_name.3pcap
  196. pflog.h
  197. portability.h
  198. ppp.h
  199. README.md
  200. rpcap-protocol.c
  201. rpcap-protocol.h
  202. savefile.c
  203. scanner.l
  204. sf-pcap.c
  205. sf-pcap.h
  206. sf-pcapng.c
  207. sf-pcapng.h
  208. sockutils.c
  209. sockutils.h
  210. sslutils.c
  211. sslutils.h
  212. sunatmpos.h
  213. TODO
  214. varattrs.h
  215. VERSION
README.md

LIBPCAP 1.x.y by The Tcpdump Group

To report a security issue please send an e-mail to security@tcpdump.org.

To report bugs and other problems, contribute patches, request a feature, provide generic feedback etc please see the guidelines for contributing.

The documentation directory has README files about specific operating systems and options.

Anonymous Git is available via:

https://github.com/the-tcpdump-group/libpcap.git

This directory contains source code for libpcap, a system-independent interface for user-level packet capture. libpcap provides a portable framework for low-level network monitoring. Applications include network statistics collection, security monitoring, network debugging, etc. Since almost every system vendor provides a different interface for packet capture, and since we‘ve developed several tools that require this functionality, we’ve created this system-independent API to ease in porting and to alleviate the need for several system-dependent packet capture modules in each application.

formerly from 	Lawrence Berkeley National Laboratory
		Network Research Group <libpcap@ee.lbl.gov>
		ftp://ftp.ee.lbl.gov/old/libpcap-0.4a7.tar.Z

Support for particular platforms and BPF

For some platforms there are README.{system} files that discuss issues with the OS‘s interface for packet capture on those platforms, such as how to enable support for that interface in the OS, if it’s not built in by default.

The libpcap interface supports a filtering mechanism based on the architecture in the BSD packet filter. BPF is described in the 1993 Winter Usenix paper ``The BSD Packet Filter: A New Architecture for User-level Packet Capture'' (compressed PostScript, gzipped PostScript, PDF).

Although most packet capture interfaces support in-kernel filtering, libpcap utilizes in-kernel filtering only for the BPF interface. On systems that don't have BPF, all packets are read into user-space and the BPF filters are evaluated in the libpcap library, incurring added overhead (especially, for selective filters). Ideally, libpcap would translate BPF filters into a filter program that is compatible with the underlying kernel subsystem, but this is not yet implemented.

BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, OpenBSD, DragonFly BSD, macOS, and Solaris 11; an older, modified and undocumented version is standard in AIX. {DEC OSF/1, Digital UNIX, Tru64 UNIX} uses the packetfilter interface but has been extended to accept BPF filters (which libpcap utilizes).

Linux has a number of BPF based systems, and libpcap does not support any of the eBPF mechanisms as yet, although it supports many of the memory mapped receive mechanisms. See the Linux-specific README for more information.

Note to Linux distributions and *BSD systems that include libpcap:

There's now a rule to make a shared library, which should work on Linux and *BSD, among other platforms.

It sets the soname of the library to libpcap.so.1; this is what it should be, NOT libpcap.so.1.x or libpcap.so.1.x.y or something such as that.

We‘ve been maintaining binary compatibility between libpcap releases for quite a while; there’s no reason to tie a binary linked with libpcap to a particular release of libpcap.