A simple header-only Trivial File Transfer Protocol (TFTP) packets parsing and serialization library.
RFC 1350 (TFTP Protocol Revision 2) compilant, RFC 2347 (TFTP Option Extension) support. RFC 2348 (TFTP Blocksize Option), RFC 2349 (TFTP Timeout Interval and Transfer Size Options) compatible.
Platform name | Windows | Linux | MacOS |
Minimum required version | 98 | --- | --- |
Dependency name | Minimum required version | Ubuntu 22.04 |
---|---|---|
C++ | C++17 | sudo apt-get install build-essential |
Doxygen (optional) | --- | sudo apt-get install doxygen |
ClangFormat (development, optional) | --- | sudo apt-get install clang-format |
- Download and install CMake. Version 3.12.0 is the minimum required.
- Open a shell. Your development tools must be reachable from this shell through the PATH environment variable.
- Create a build directory, go to this directory:
mkdir build
cd build
- Execute this command in the shell replacing
path/to/tftp/source/root
with the path to the root of your tftp source tree:
cmake path/to/tftp/source/root
- After CMake has finished running, proceed to use IDE project files, or start the build from the build directory:
cmake --build .
The --build option tells cmake to invoke the underlying build tool (make, ninja, xcodebuild, msbuild, etc.)
The underlying build tool can be invoked directly, of course, but the --build option is portable.
- After tftp has finished building, install it from the build directory:
cmake --build . --target install
The --target option with install parameter in addition to the --build option tells cmake to build the install target.
Variables customize how the build will be generated. Options are boolean variables, with possible values ON/OFF. Options and variables are defined on the CMake command line like this:
cmake -DVARIABLE=value path/to/tftp/source
BUILD_TESTS: BOOL
Adds test build targets as a dependencies of the default build target. Defaults to OFF.
BUILD_EXAMPLES: BOOL
Adds examples build targets as a dependencies of the default build target. Defaults to OFF.
- The
format
target (i.eninja format
) will run clang-format on all project files - The
check-format
target (i.eninja check-format
) will verify that project's code follows formatting conventions - The
docs
target (i.eninja docs
) will generate documentation using doxygen