「🏗️」 wip: TODO
This commit is contained in:
@ -49,6 +49,7 @@ void process_icmp(char *buf, int bytes, struct sockaddr_in *addr, int seq,
|
||||
|
||||
append_time(rtt);
|
||||
|
||||
// TODO: fix the time and put the hostname with the ip
|
||||
printf("%d bytes from %s: icmp_seq=%d ttl=%d time=%.3f\n", bytes - len,
|
||||
inet_ntoa(addr->sin_addr), icmp->icmp_seq, ip->ip_ttl, rtt);
|
||||
}
|
||||
|
@ -81,6 +81,7 @@ int send_ping(int socket, struct sockaddr_in *dest, options_t opt) {
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
// TODO: fix this shitty loop
|
||||
int ping(args_t *args) {
|
||||
int ret;
|
||||
options_t opt = init_opt(args);
|
||||
|
@ -61,10 +61,12 @@ bool check_for_timeout(struct timeval start, options_t opt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: fix the packet loss
|
||||
void print_stats(void) {
|
||||
printf("--- %s ping statistics ---\n", address);
|
||||
printf("%d packets transmitted, %d packets received, %.0f%% packet loss\n",
|
||||
tx_count, rx_count, (tx_count - rx_count / 2.0) * 100);
|
||||
// TODO: fix this shit
|
||||
printf("round-trip min/avg/max/stddev = %.3f/%.3f/%.3f/%.3f\n",
|
||||
get_min_rtt(), get_avg_rtt(), get_max_rtt(), get_stddev_rtt());
|
||||
}
|
||||
|
Reference in New Issue
Block a user