26 lines
634 B
C
26 lines
634 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
|
|
#define ICMP_ERR_EAGAIN -7
|
|
|
|
/* Internal error handling functions */
|
|
void icmp_set_error(struct icmp_handle *h, int code, const char *msg);
|
|
void icmp_set_error_fmt(struct icmp_handle *h, int code, const char *fmt, ...);
|
|
void icmp_clear_error(struct icmp_handle *h);
|
|
|
|
#endif
|