https://github.com/eoan-ermine/tftp
A simple header-only Trivial File Transfer Protocol (TFTP) packets parsing and serialization library
https://github.com/eoan-ermine/tftp
header-only tftp tftp-protocol
Last synced: 4 months ago
JSON representation
A simple header-only Trivial File Transfer Protocol (TFTP) packets parsing and serialization library
- Host: GitHub
- URL: https://github.com/eoan-ermine/tftp
- Owner: eoan-ermine
- License: unlicense
- Created: 2022-12-03T20:01:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-14T18:34:14.000Z (over 1 year ago)
- Last Synced: 2025-08-07T21:49:46.105Z (10 months ago)
- Topics: header-only, tftp, tftp-protocol
- Language: C++
- Homepage: https://eoanermine.com/tftp_common/
- Size: 2.04 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TFTP Common
A simple header-only Trivial File Transfer Protocol (*TFTP*) packets parsing and serialization library.
[RFC 1350](https://datatracker.ietf.org/doc/html/rfc1350) (*TFTP Protocol Revision 2*) compilant, [RFC 2347](https://datatracker.ietf.org/doc/html/rfc2347) (*TFTP Option Extension*) support. [RFC 2348](https://datatracker.ietf.org/doc/html/rfc2348) (*TFTP Blocksize Option*), [RFC 2349](https://datatracker.ietf.org/doc/html/rfc2349) (*TFTP Timeout Interval and Transfer Size Options*) compatible.
    [](https://eoanermine.com/tftp/)
## 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:
```shell
mkdir build
cd build
```
4. Execute this command in the shell replacing `path/to/tftp/source/root` with the path to the root of your tftp source tree:
```shell
cmake path/to/tftp/source/root
```
5. After CMake has finished running, proceed to use IDE project files, or start the build from the build directory:
```shell
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.
6. After tftp has finished building, install it from the build directory:
```shell
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:
```shell
cmake -DVARIABLE=value path/to/tftp/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