MicroTCP is a lightweight TCP implementation written in C. The project is modularly organized with libraries, utilities, and demo (Mini-REDIS fileserver) in order to test it.
CMAKEversion 3.18 or higherClangcompiler (GCC is not suggested)POSIXlibraryPthreadlibrary
-
Navigate to the project root directory.
-
Create a build directory:
$ mkdir build $ cd build -
To configure the project:
$ cmake ..
Use the following options to enable specific modes:
DEBUG_MODE: Enable debug-specific features; Extensive logging, sanitizers, etc.VERBOSE_MODE: Enables verbose logging, focuses mainly on microTCP-specific logs, excluding memory logging or other lower-level details (not recommended for benchmarking).OPTIMIZED_MODE: Enables optimizations that break the initial constraints of the project. (Recommended for benchmarking)IWYU-ENABLE: Enables Include-What-You-Use. This is for developers/maintainers as there is no advantaje for users of MicroTCP or mini-REDIS.
For example:
$ cmake -DDEBUG_MODE=ON -DVERBOSE_MODE=ON ..
or
$ cmake -DOPTIMIZED_MODE=ON ..
-
To build the project:
$ make
After building, the project, you can navigate to:
$ build/executablesIn the directory mention above you will find two programs; The server, and the client-side of my Mini-REDIS application.
- If any issues arise, verify that the CMake version meets the minimum requirement.
- Enabling
DEBUG_MODEactivates complete logging, including detailed memory and system-level logs, also it activatessanitizers. In case you manually change my cmake, make sure that you do not use sanitizers that clash with each other (ex. -fsanitize=memory,address) VERBOSE_MODE- Also cmake is configured to support Include-What-You-Use inorder to provide warnings in case something is missing from the redundant or is missing from the #included headers. That way we can avoid inclusion inheritance. Also it helps minimize binary sizes, as you only include what you need and opposed to single headers, but in case something is removed it breaks the project, or adds overhead to each binary.