This commit is contained in:
18
waitpacket.c
18
waitpacket.c
@ -220,12 +220,12 @@ log_ipv4(int status, int sequence)
|
||||
rel_id = relativize_id(sequence, &ip_id);
|
||||
else
|
||||
rel_id = 0;
|
||||
printf("\033[1;36m长度=%d ip=%s ttl=%d %sid%s%d ", ip_size, inet_ntoa(src),
|
||||
printf("len=%d ip=%s ttl=%d %sid%s%d ", ip_size, inet_ntoa(src),
|
||||
ip->ttl,
|
||||
(ntohs(ip->frag_off) ? "DF " : ""),
|
||||
(rel_id ? "=+" : "="), ip_id);
|
||||
if (opt_verbose && !opt_quiet)
|
||||
printf("tos=%x ip长度=%u\n", ip->tos, htons(ip->tot_len));
|
||||
printf("tos=%x ip_len=%u\n", ip->tos, htons(ip->tot_len));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -233,7 +233,7 @@ log_ipv6(int status, int sequence)
|
||||
{
|
||||
char tmp[1024];
|
||||
|
||||
printf("\033[1;35m长度=%d ip=%s ttl=%d ", ip_size, inet_ntop(opt_af, &src6, tmp, sizeof(tmp)),
|
||||
printf("len=%d ip=%s ttl=%d ", ip_size, inet_ntop(opt_af, &src6, tmp, sizeof(tmp)),
|
||||
ip6->hoplimit);
|
||||
if (opt_verbose && !opt_quiet)
|
||||
printf("tc=%x flowlabel=%u\n", (ip6->tc1 << 4) | ip6->tc2, (ip6->flowlabel1 << 16) | ip6->flowlabel2);
|
||||
@ -242,8 +242,10 @@ log_ipv6(int status, int sequence)
|
||||
static void
|
||||
log_ip(int status, int sequence)
|
||||
{
|
||||
if(status == S_RECV)
|
||||
printf("DUP! ");
|
||||
if(status == S_RECV){
|
||||
printf("[重传]DUP! ");
|
||||
dup_count++;
|
||||
}
|
||||
if(ip->version == 4)
|
||||
log_ipv4(status, sequence);
|
||||
else
|
||||
@ -416,7 +418,7 @@ int recv_icmp6(void *packet, size_t size)
|
||||
status = rtt(&icmp_seq, 0, &ms_delay);
|
||||
log_ip(status, icmp_seq);
|
||||
|
||||
printf("icmp_seq=%d 往返时间=%.2f 毫秒\n", icmp_seq, ms_delay);
|
||||
printf("icmp_seq=%d rtt=%.2f ms\n", icmp_seq, ms_delay);
|
||||
notrace = 1;
|
||||
return 1;
|
||||
}
|
||||
@ -480,7 +482,7 @@ int recv_udp(void *packet, size_t size)
|
||||
status = rtt(&sequence, ntohs(udp.uh_dport), &ms_delay);
|
||||
if (!opt_quiet) {
|
||||
log_ip(status, sequence);
|
||||
printf("seq=%d 往返时间=%.2f 毫秒\n", sequence, ms_delay);
|
||||
printf("seq=%d rtt=%.2f ms\n", sequence, ms_delay);
|
||||
}
|
||||
if (opt_incdport && !opt_force_incdport)
|
||||
dst_port++;
|
||||
@ -545,7 +547,7 @@ int recv_tcp(void *packet, size_t size)
|
||||
if (flags[0] == '\0') strcat(flags, "none");
|
||||
|
||||
log_ip(status, sequence);
|
||||
printf("源端口=%d 标志=%s seq=%d win=%d 往返时间=%.2f 毫秒\n",
|
||||
printf("sport=%d flags=%s seq=%d win=%d rtt=%.2f ms\n",
|
||||
ntohs(tcp.th_sport), flags, sequence,
|
||||
ntohs(tcp.th_win), ms_delay);
|
||||
|
||||
|
Reference in New Issue
Block a user