A C implementation of a custom packet protocol for array serialization, deserialization, and integrity checking. This project demonstrates low-level data manipulation, bitwise operations, and robust testing practices.
- Packet Serialization: Convert integer arrays into network packets with custom headers and payloads.
- Packet Deserialization: Reconstruct arrays from received packets, handling fragmentation and corruption.
- Checksum Calculation: Ensure data integrity with a custom checksum algorithm.
- Packet Inspection: Print detailed packet contents for debugging and analysis.
.
βββ include/ # Public header(s)
β βββ hw1.h
βββ src/ # Core implementation
β βββ hw1.c
β βββ hw1_main.c
βββ tests/
β βββ include/ # Test argument headers
β βββ src/ # Test drivers and GoogleTest suites
β βββ expected_outputs/ # Reference outputs for validation
βββ CMakeLists.txt # Build configuration
This project uses CMake:
cmake -S . -B build
cmake --build build- The main executable:
hw1_main - All tests:
run_all_tests - Standalone Valgrind test drivers for memory checking
Unit and integration tests are written using GoogleTest. Run all tests with:
./build/run_all_testsValgrind test drivers are also available for memory analysis.
The main program (hw1_main.c) demonstrates how to print a packetβs contents.