Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tcpdump for linux x86_64 #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added binaries/linux/x86_64/tcpdump
Binary file not shown.
29 changes: 29 additions & 0 deletions tcpdump/x86_64/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# this script runs inside an Alpine docker container created by ./set_up.sh

if ! command -v wget >/dev/null 2>&1; then
apk add wget
fi

wget https://www.tcpdump.org/release/tcpdump-4.9.3.tar.gz
tar -xvpf tcpdump-4.9.3.tar.gz
cd tcpdump-4.9.3 || (
echo "tcpdump source not found"
exit 1
)

apk add libpcap-dev || exit 1

LDFLAGS=-static ./configure || (
echo -e "\n\n Failed to configure,check the error output"
exit 1
)

make -j4 || (
echo -e "\n\n Failed to build tcpdump, check the error output"
exit 1
)

echo -e "\n\n TCPDUMP has been built:"
ls -lh "$PWD"/tcpdump
17 changes: 17 additions & 0 deletions tcpdump/x86_64/set_up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# set up Alpine docker container and copy our build script into it

if ! command -v docker >/dev/null 2>&1; then
echo "Please install Docker first"
exit 1
fi

docker pull alpine || (
echo "docker pull failed, make sure docker is usable"
exit 1
)

docker run --name alpine_tcpdump -it alpine /bin/sh -i
docker cp ./build.sh alpine_tcpdump:/root/build_tcpdump.sh
docker exec -it alpine_tcpdump /bin/sh /root/build_tcpdump.sh