make timeout work, add setcap makefile rule

This commit is contained in:
2025-08-24 19:47:56 +02:00
parent b758a86083
commit 35c42d1f90
5 changed files with 28 additions and 16 deletions

View File

@ -53,7 +53,7 @@ typedef struct s_settings
{
t_host_list *hosts;
int count; // -c (--count)
int timeout; // -w (--timeout)
double timeout; // -w (--timeout)
double interval; //-i (--interval)
int linger; //-W (--linger)
int ttl; // --ttl
@ -66,6 +66,7 @@ typedef struct s_settings
short err;
char *name;
struct timeval last_send_time;
struct timeval start_time;
char current_ip[INET_ADDRSTRLEN];
} t_settings;
@ -111,7 +112,7 @@ uint16_t calc_checksum(void *ptr, size_t len);
double timediff(struct timeval *from);
void show_ping_res_line(t_waitlist *cur, t_settings *set, uint16_t seq, t_stats *stats, uint8_t ttl);
void waitlist_free(t_waitlist *lst);
t_waitlist *send_icmp(t_settings *set, struct addrinfo *host, uint16_t *seq, struct timeval *last, t_stats *stats);
t_waitlist *send_icmp(t_settings *set, struct addrinfo *host, uint16_t *seq, t_stats *stats);
t_waitlist *waitlist_remove(t_waitlist **lst, t_icmp_ip_reply *res, int is_ttl_exceeded);
void waitlist_add(t_waitlist **waitlist, t_waitlist *elem);
void receive_icmp(t_settings *set, t_waitlist **wl, t_stats *stats);