Merge "Enable host builds of libpcap and only on linux" am: 58fd79c867
am: bf4ff54f31

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

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 file CONTRIBUTING in the libpcap source tree root.

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

LIBPCAP 1.x.y Now maintained by “The Tcpdump Group” https://www.tcpdump.org

Anonymous Git is available via: https://github.com/the-tcpdump-group/libpcap.git

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

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.

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''. A compressed PostScript version can be found at

ftp://ftp.ee.lbl.gov/papers/bpf-usenix93.ps.Z

or

https://www.tcpdump.org/papers/bpf-usenix93.ps.Z

and a gzipped version can be found at

https://www.tcpdump.org/papers/bpf-usenix93.ps.gz

A PDF version can be found at

https://www.tcpdump.org/papers/bpf-usenix93.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, and macOS; 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). Also, you can add BPF filter support to Ultrix using the kernel source and/or object patches available in:

https://www.tcpdump.org/other/bpfext42.tar.Z

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 README.linux file 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.

Current versions can be found at https://www.tcpdump.org.

  • The TCPdump group