libicmp/includes/internal/icmp_internal.h
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

23 lines
480 B
C

#ifndef ICMP_INTERNAL_H
#define ICMP_INTERNAL_H
/* Internal handle structure */
struct icmp_handle {
int fd;
int last_error;
char error_msg[256];
};
/* Error codes */
#define ICMP_OK 0
#define ICMP_ERR_PERMISSION -1
#define ICMP_ERR_SOCKET -2
#define ICMP_ERR_SEND -3
#define ICMP_ERR_RECV -4
#define ICMP_ERR_INVALID -5
#define ICMP_ERR_ENOMEM -6
/* Internal error handling functions */
void icmp_set_error(struct icmp_handle *h, int code, const char *msg);
#endif