Commit graph

29 commits

Author SHA1 Message Date
lohhiiccc
ef760ca01a build: make compiler variables overridable 2026-02-08 00:31:31 +01:00
lohhiiccc
865f9d0ccb refactor: move variable declarations to function beginnings 2026-02-07 20:38:19 +01:00
lohhiiccc
85543f3d19 fix(makefile)!: improve flags and type casts for stricter build and correctness
- Update Makefile:
  - Change test binary name to `libicmp.test`.
  - Add `-Wpedantic` and `-Wconversion` to global CFLAGS for stricter
    warnings.
  - Add dedicated `TEST_CFLAGS`.
  - Ensure test build uses `TEST_CFLAGS`.
- Refactor code for better correctness.

BREAKING CHANGE: Test binary is now named `libicmp.test` instead of
`test.out` and stricter compiler flags may trigger new warnings or
errors in code outside this patch.
2026-02-07 20:16:06 +01:00
lohhiiccc
97a9f24fc3 feat: extract_offending function 2026-02-07 11:15:42 +01:00
lohhiiccc
d3daf711b2 fix(send/echo): add byte order conversion for id and seq 2026-02-05 22:31:38 +01:00
lohhiiccc
6cda2e8db5 refactor: standardize code style and improve clarity 2026-02-05 22:26:49 +01:00
lohhiiccc
ace00ea0f2 feat: rework icmp_parse_ip_header
Extend icmp_parse_ip_header to allow optional extraction of destination
IP address and protocol from the IP header
2026-02-05 22:26:49 +01:00
lohhiiccc
84490efc8e feat: add helpers to extract id and sequence from replies 2026-01-30 23:49:31 +01:00
lohhiiccc
29904cbec6 refactor: use union instead of bit shifting for echo header 2026-01-27 21:36:26 +01:00
lohhiiccc
1c60852520 refactor: extract send error handling to separate function 2026-01-27 21:35:47 +01:00
lohhiiccc
06305696da refactor: remove unnecessary wrapper functions and redundant checks 2026-01-27 21:34:41 +01:00
lohhiiccc
e57d43de33 feat: add max_packets parameter to make icmp_process non-blocking 2026-01-27 21:30:49 +01:00
lohhiiccc
bd367b97dc fix: separate build and install steps and fix symlink 2026-01-27 05:28:49 +01:00
lohhiiccc
bfd61e3636 fix: use generic header_rest field instead of hardcoded id/seq 2026-01-27 05:04:38 +01:00
lohhiiccc
47fca07406 fix: update sources 2026-01-26 20:14:39 +01:00
lohhiiccc
a3c60158e9 test: add recv module unit tests 2026-01-26 20:14:24 +01:00
lohhiiccc
d938d0ca4d test: add send module unit tests 2026-01-26 20:14:11 +01:00
lohhiiccc
3c56ea024b feat: implement ICMP send/receive modules 2026-01-26 20:12:42 +01:00
lohhiiccc
10a10f6e0a fix: correct checksum byte order and use monotonic clock 2026-01-26 20:11:15 +01:00
lohhiiccc
8fb109e2a0 test: deduplicate helper function 2026-01-25 15:48:39 +01:00
lohhiiccc
7f79d4c8c4 feat(error): refactor error handling 2026-01-25 15:12:53 +01:00
lohhiiccc
34daac0361 fix(sources): update sources 2026-01-25 01:44:13 +01:00
lohhiiccc
d453ef8bed feat(packet): add ICMP/IP packet build and parse helpers 2026-01-25 01:44:00 +01:00
lohhiiccc
01e66a34fb feat(error): add icmp_should_retry for non-blocking retry support 2026-01-25 01:40:06 +01:00
lohhiiccc
b7be251a18 feat(handle): add public api init and destroy utilities
- Added `icmp_create`.
 - Added `icmp_destroy`.
 - Added `icmp_get_fd`.
 - Added unit tests.
2026-01-25 00:23:13 +01:00
lohhiiccc
9e35dd86bb feat(socket): add raw socket utilities with tests
- Added `socket_create`.
 - Added `socket_configure`.
 - Added socket error utilities
 - Added unit tests.
2026-01-24 23:19:57 +01:00
lohhiiccc
532c4b5dc7 feat(error): add ICMP error utilities with tests
- Added `icmp_set_error`.
 - Added `icmp_strerror`.
 - Added unit tests.
2026-01-24 22:38:49 +01:00
lohhiiccc
2e509336c7 feat(utils): add ICMP checksum and time utilities with tests
- Added `icmp_checksum`.
 - Added `icmp_get_time`.
 - Created unit tests for checksum and time.
 - Set `-D_POSIX_C_SOURCE=199309L` in CPPFLAGS for clock_gettime support.
2026-01-24 22:00:24 +01:00
lohhiiccc
9bd55cf24a Initial commit - libcimp 2026-01-24 16:04:09 +01:00