Changeset View
Changeset View
Standalone View
Standalone View
sbin/ping/ping.c
Show First 20 Lines • Show All 1,081 Lines • ▼ Show 20 Lines | |||||
pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv) | pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv) | ||||
{ | { | ||||
struct in_addr ina; | struct in_addr ina; | ||||
u_char *cp, *dp; | u_char *cp, *dp; | ||||
struct icmp *icp; | struct icmp *icp; | ||||
struct ip *ip; | struct ip *ip; | ||||
const void *tp; | const void *tp; | ||||
double triptime; | double triptime; | ||||
int dupflag, hlen, i, j, recv_len, seq; | int dupflag, hlen, i, j, recv_len; | ||||
uint16_t seq; | |||||
static int old_rrlen; | static int old_rrlen; | ||||
static char old_rr[MAX_IPOPTLEN]; | static char old_rr[MAX_IPOPTLEN]; | ||||
/* Check the IP header */ | /* Check the IP header */ | ||||
ip = (struct ip *)buf; | ip = (struct ip *)buf; | ||||
hlen = ip->ip_hl << 2; | hlen = ip->ip_hl << 2; | ||||
recv_len = cc; | recv_len = cc; | ||||
if (cc < hlen + ICMP_MINLEN) { | if (cc < hlen + ICMP_MINLEN) { | ||||
▲ Show 20 Lines • Show All 709 Lines • Show Last 20 Lines |