This is a repository for Packet Batch that includes common files for all versions (Standard, AF_XDP, and The DPDK). This includes source files to parse JSON config files, command line parsing, and other useful functions.
- JSON-C - Used for parsing config files using the JSON syntax.
While I suggest building and installing the application using the independent versions (standard, AF_XDP, or the DPDK), you may build and install this repository separately if you want as well. You may use git
and make
. When cloning the repository, you will want to use the --recursive
flag to clone the needed submodule(s) as well (in this case, json-c). Otherwise, you will need to execute git submodule update --init
.
The following should work.
# Clone the Packet Batch Common repository.
git clone --recursive https://github.com/Packet-Batch/PB-Common.git
# Install build essentials/tools and needed libaries for JSON-C.
sudo apt install -y cmake build-essential clang autoconf libtool pkgconf
# Change current working directory to PB-Common/.
cd PB-Common/
# Execute ./build.sh file to build and install dependencies and main project which requires sudo privileges.
# WARNING - If you don't have sudo available on your system, please look at the ./build.sh file and execute make commands as root in order.
# NOTE - You may also look at the .github/workflows/build.yml.
# NOTE - The first argument represents the amount of threads to use with make. 0 uses the amount of available threads on the system and supplying no argument uses 1 thread.
./build.sh 0
# (Not Required) If you want to clean our build, use the following. It must be ran as root or with sudo because we're also cleaning our LibYAML sub-module.
sudo make clean