Changeset View
Changeset View
Standalone View
Standalone View
sbin/ping/ping.c
Show First 20 Lines • Show All 1,255 Lines • ▼ Show 20 Lines | pr_pack(char *buf, ssize_t cc, struct sockaddr_in *from, struct timespec *tv) | ||||
(void)printf("\nwrong data byte #%d should be 0x%x but was 0x%x", | (void)printf("\nwrong data byte #%d should be 0x%x but was 0x%x", | ||||
i, *dp, *cp); | i, *dp, *cp); | ||||
(void)printf("\ncp:"); | (void)printf("\ncp:"); | ||||
cp = (u_char*)(buf + hlen + | cp = (u_char*)(buf + hlen + | ||||
offsetof(struct icmp, icmp_data)); | offsetof(struct icmp, icmp_data)); | ||||
for (i = 0; i < datalen; ++i, ++cp) { | for (i = 0; i < datalen; ++i, ++cp) { | ||||
if ((i % 16) == 8) | if ((i % 16) == 8) | ||||
(void)printf("\n\t"); | (void)printf("\n\t"); | ||||
(void)printf("%2x ", *cp); | (void)printf(" %2x", *cp); | ||||
} | } | ||||
(void)printf("\ndp:"); | (void)printf("\ndp:"); | ||||
cp = &outpack[ICMP_MINLEN]; | cp = &outpack[ICMP_MINLEN]; | ||||
for (i = 0; i < datalen; ++i, ++cp) { | for (i = 0; i < datalen; ++i, ++cp) { | ||||
if ((i % 16) == 8) | if ((i % 16) == 8) | ||||
(void)printf("\n\t"); | (void)printf("\n\t"); | ||||
(void)printf("%2x ", *cp); | (void)printf(" %2x", *cp); | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} else { | } else { | ||||
/* | /* | ||||
* We've got something other than an ECHOREPLY. | * We've got something other than an ECHOREPLY. | ||||
▲ Show 20 Lines • Show All 408 Lines • Show Last 20 Lines |