Skip to content

A simple header-only Trivial File Transfer Protocol (TFTP) packets parsing and serialization library

License

Notifications You must be signed in to change notification settings

eoan-ermine/tftp_common

Repository files navigation

TFTP Common

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.

C++ Standard

Supported platforms

Platform name Windows Linux MacOS
Minimum required version 98 --- ---

Dependencies

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

Quick start

  1. Download and install CMake. Version 3.12.0 is the minimum required.
  2. Open a shell. Your development tools must be reachable from this shell through the PATH environment variable.
  3. Create a build directory, go to this directory:
mkdir build
cd build
  1. Execute this command in the shell replacing path/to/tftp_common/source/root with the path to the root of your tftp_common source tree:
cmake path/to/tftp_common/source/root
  1. 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.

  1. After tftp_common 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.

Options and variables

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_common/source

CMake variables

  • 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.

CMake targets

  • The format target (i.e ninja format) will run clang-format on all project files
  • The check-format target (i.e ninja check-format) will verify that project's code follows formatting conventions
  • The docs target (i.e ninja docs) will generate documentation using doxygen

About

A simple header-only Trivial File Transfer Protocol (TFTP) packets parsing and serialization library

Topics

Resources

License

Stars

Watchers

Forks