diff options
Diffstat (limited to '')
-rw-r--r-- | doc/README.NetBSD.md | 22 | ||||
-rw-r--r-- | doc/README.Win32.md | 200 | ||||
-rw-r--r-- | doc/README.aix.md | 17 | ||||
-rw-r--r-- | doc/README.solaris.md | 41 |
4 files changed, 280 insertions, 0 deletions
diff --git a/doc/README.NetBSD.md b/doc/README.NetBSD.md new file mode 100644 index 0000000..b49be0e --- /dev/null +++ b/doc/README.NetBSD.md @@ -0,0 +1,22 @@ +# Compiling tcpdump on NetBSD + +NetBSD has two libpcap libraries: one that is always installed as a part of the +OS and another that can be installed as a package from pkgsrc. Also the usual +method of compiling with the upstream libpcap in `../libpcap` is available. + +GCC, Clang, Autoconf and CMake are presumed to work, if this is not the case, +please report a bug as explained in the +[guidelines for contributing](../CONTRIBUTING.md). + +## NetBSD 9.3 + +* Upstream libpcap works. +* OS libpcap works. +* pkgsrc libpcap works. + +## NetBSD 9.2, 9.1 and 9.0 + +* Upstream libpcap works. +* OS libpcap cannot be used due to + [this bug](https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=55901). + diff --git a/doc/README.Win32.md b/doc/README.Win32.md new file mode 100644 index 0000000..b7e81d1 --- /dev/null +++ b/doc/README.Win32.md @@ -0,0 +1,200 @@ +Building tcpdump on Windows with Visual Studio +============================================== + +Unlike the UN*Xes on which libpcap can capture network traffic, Windows +has no network traffic capture mechanism that libpcap can use. +Therefore, libpcap requires a driver, and a library to access the +driver, provided by the Npcap or WinPcap projects. + +Those projects include versions of libpcap built to use that driver and +library; these instructions are for people who want to build libpcap +source releases, or libpcap from the Git repository, as a replacement +for the version provided with Npcap or WinPcap. + +Npcap and WinPcap SDK +--------------------- + +In order to build tcpdump, you will need to download Npcap and its +software development kit (SDK) or WinPcap and its software development +kit. + +Npcap is currently being developed and maintained, and offers many +additional capabilities that WinPcap does not. + +WinPcap is no longer being developed or maintained; it should be used +only if there is some other requirement to use it rather than Npcap, +such as a requirement to support versions of Windows earlier than +Windows Vista, which is the earliest version supported by Npcap. + +Npcap and its SDK can be downloaded from its [home page](https://npcap.com). +The SDK is a ZIP archive; create a folder on your `C:` drive, e.g. +`C:\npcap-sdk`, and put the contents of the ZIP archive into that folder. + +The WinPcap installer can be downloaded from +[here](https://www.winpcap.org/install/default.htm) +and the WinPcap Developer's Kit can be downloaded from +[here](https://www.winpcap.org/devel.htm). + +Required build tools +-------------------- + +The Developer's Kit is a ZIP archive; it contains a folder named +`WpdPack`, which you should place on your `C:` drive, e.g. `C:\WpdPack`. + +Building tcpdump on Windows requires Visual Studio 2015 or later. The +Community Edition of Visual Studio can be downloaded at no cost from +[here](https://visualstudio.microsoft.com). + +Additional tools are also required. Chocolatey is a package manager for +Windows with which those tools, and other tools, can be installed; it +can be downloaded from [here](https://chocolatey.org). + +It is a command-line tool; a GUI tool, Chocolatey GUI, is provided as a +Chocolatey package, which can be installed from the command line: + +``` +choco install chocolateygui +``` + +For convenience, the `choco install` command can be run with the `-y` +flag, forcing it to automatically answer all questions asked of the user +with "yes": + +``` +choco install -y chocolateygui +``` + +The required tools are: + +### CMake ### + +libpcap does not provide supported project files for Visual Studio +(there are currently unsupported project files provided, but we do not +guarantee that they will work or that we will continue to provide them). +It does provide files for CMake, which is a cross-platform tool that +runs on UN\*Xes and on Windows and that can generate project files for +UN\*X Make, the Ninja build system, and Visual Studio, among other build +systems. + +Visual Studio 2015 does not provide CMake; an installer can be +downloaded from [here](https://cmake.org/download/). + +When you run the installer, you should choose to add CMake to the system +`PATH` for all users and to create the desktop icon. + +CMake can also be installed as the Chocolatey package `cmake`: + +``` +choco install -y cmake +``` + +Visual Studio 2017 and later provide CMake, so you will not need to +install CMake if you have installed Visual Studio 2017 or later. They +include built-in support for CMake-based projects as described +[here](https://devblogs.microsoft.com/cppblog/cmake-support-in-visual-studio/). + +For Visual Studio 2017, make sure "Visual C++ tools for CMake" is +installed; for Visual Studio 2019, make sure "C++ CMake tools for +Windows" is installed. + +Git +--- + +An optional tool, required only if you will be building from a Git +repository rather than from a release source tarball, is Git. Git is +provided as an optional installation component, "Git for Windows", with +Visual Studio 2017 and later. + +Building from the Visual Studio GUI +----------------------------------- + +### Visual Studio 2017 ### + +Open the folder containing the libpcap source with Open > Folder. +Visual Studio will run CMake; however, you will need to indicate where +the Npcap or WinPcap SDK is installed. + +To do this, go to Project > "Change CMake Settings" > tcpdump and: + +Choose which configuration type to build, if you don't want the default +Debug build. + +In the CMakeSettings.json tab, change cmakeCommandArgs to include + +``` +-DPacket_ROOT={path-to-sdk} +``` + +where `{path-to-sdk}` is the path of the directory containing the Npcap or +WinPcap SDK. Note that backslashes in the path must be specified as two +backslashes. + +Save the configuration changes with File > "Save CMakeSettings.json" or +with Control-S. + +Visual Studio will then re-run CMake. If that completes without errors, +you can build with CMake > "Build All". + +### Visual Studio 2019 ### + +Open the folder containing the libpcap source with Open > Folder. +Visual Studio will run CMake; however, you will need to indicate where +the Npcap or WinPcap SDK is installed. + +To do this, go to Project > "CMake Settings for tcpdump" and: + +Choose which configuration type to build, if you don't want the default +Debug build. + +Scroll down to "Cmake variables and cache", scroll through the list +looking for the entry for Packet_ROOT, and either type in the path of +the directory containing the Npcap or WinPcap SDK or use the "Browse..." +button to browse for that directory. + +Save the configuration changes with File > "Save CMakeSettings.json" or +with Control-S. + +Visual Studio will then re-run CMake. If that completes without errors, +you can build with Build > "Build All". + +Building from the command line +------------------------------ + +Start the appropriate Native Tools command line prompt. + +Change to the directory into which you want to build tcpdump, possibly +after creating it first. One choice is to create it as a subdirectory +of the tcpdump source directory. + +Run the command + +``` +cmake "-DPacket_ROOT={path-to-sdk}" -G {generator} {path-to-tcpdump-source} +``` + +`{path-to-sdk}` is the path of the directory containing the Npcap or +WinPcap SDK. + +`{generator}` is the string "Visual Studio N YYYY", where `N` is the +version of Visual Studio and `YYYY` is the year number for that version; +if you are building a 64-bit version of tcpdump, `YYYY` must be followed +by a space and "Win64". For example, to build a 32-bit version of +tcpdump with Visual Studio 2017, `{generator}` would be "Visual Studio +15 2017" and to build a 64-bit version of tcpdump with Visual Studio +2017, `{generator}` would be "Visual Studio 15 2017 Win64". + +`{path-to-tcpdump-source}` is the pathname of the top-level source +directory for tcpdump. + +Run the command + +``` +msbuild /m /nologo /p:Configuration={configuration} tcpdump.sln +``` + +where `{configuration}` can be "Release", "Debug", or "RelWithDebInfo". + +Building with MinGW +------------------- + +(XXX - this should be added) diff --git a/doc/README.aix.md b/doc/README.aix.md new file mode 100644 index 0000000..3bfa550 --- /dev/null +++ b/doc/README.aix.md @@ -0,0 +1,17 @@ +# Compiling tcpdump on AIX + +* Autoconf works everywhere. + +## AIX 7.1/POWER7 + +* Only local libpcap is suitable. +* CMake 3.16.0 does not work. +* GCC 8.3.0 and XL C 12.1.0.0 work. +* System m4 does not work, GNU m4 1.4.17 works. + +## AIX 7.2/POWER8 + +* Only local libpcap is suitable. +* GCC 7.2.0 and XL C 13.1.3.6 work. +* System m4 does not work, GNU m4 1.4.17 works. + diff --git a/doc/README.solaris.md b/doc/README.solaris.md new file mode 100644 index 0000000..afdd8f7 --- /dev/null +++ b/doc/README.solaris.md @@ -0,0 +1,41 @@ +# Compiling tcpdump on Solaris and related OSes + +* Autoconf works everywhere. + +## OmniOS r151042/AMD64 + +* Both system and local libpcap are suitable. +* CMake 3.23.1 works. +* GCC 11.2.0 and Clang 14.0.3 work. + +## OpenIndiana 2021.04/AMD64 + +* Both system and local libpcap are suitable. +* CMake 3.21.1 works. +* GCC 7.5.0 and GCC 10.3.0 work, Clang 9.0.1 works. + +For reference, the tests were done using a system installed from +`OI-hipster-text-20210430.iso` plus the following packages: +```shell +xargs -L1 pkg install <<ENDOFTEXT +developer/build/autoconf +developer/build/cmake +developer/gcc-10 +developer/clang-90 +ENDOFTEXT +``` + +## Oracle Solaris 11.4.42/AMD64 + +* Both system and local libpcap are suitable. +* GCC 11.2 and Clang 11.0 work. + +For reference, the tests were done on a VM booted from `sol-11_4-vbox.ova` +and updated to 11.4.42.111.0 plus the following packages: +```shell +xargs -L1 pkg install <<ENDOFTEXT +developer/build/autoconf +developer/gcc +developer/llvm/clang +ENDOFTEXT +``` |