* Fixed warnings.

* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33969 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-11-09 22:19:56 +00:00
parent 4bd3cce627
commit 48cfade40f
+10 -10
View File
@@ -190,7 +190,7 @@ int main(int argc, char **argv)
int i; int i;
int ch, hold = 1, packlen, preload; int ch, hold = 1, packlen, preload;
int maxsize, fdmasks; int maxsize, fdmasks;
size_t maxsizelen; socklen_t maxsizelen;
u_char *datap, *packet; u_char *datap, *packet;
char *target, hnamebuf[MAXHOSTNAMELEN]; char *target, hnamebuf[MAXHOSTNAMELEN];
u_char ttl = MAXTTL, loop = 1, df = 0; u_char ttl = MAXTTL, loop = 1, df = 0;
@@ -376,7 +376,7 @@ int main(int argc, char **argv)
sizeof(hold)); sizeof(hold));
if (options & F_TTL) { if (options & F_TTL) {
if (IN_MULTICAST(ntohl(to->sin_addr.s_addr))) if (IN_MULTICAST(ntohl(to->sin_addr.s_addr)))
moptions |= MULTICAST_TTL; moptions |= MULTICAST_TTL;
else else
options |= F_HDRINCL; options |= F_HDRINCL;
@@ -393,7 +393,7 @@ int main(int argc, char **argv)
ip->ip_v = IPVERSION; ip->ip_v = IPVERSION;
ip->ip_hl = sizeof(struct ip) >> 2; ip->ip_hl = sizeof(struct ip) >> 2;
ip->ip_tos = tos; ip->ip_tos = tos;
ip->ip_id = 0; ip->ip_id = 0;
ip->ip_off = htons(df?IP_DF:0); ip->ip_off = htons(df?IP_DF:0);
ip->ip_ttl = ttl; ip->ip_ttl = ttl;
ip->ip_p = proto->p_proto; ip->ip_p = proto->p_proto;
@@ -432,7 +432,7 @@ int main(int argc, char **argv)
sizeof(saddr)) < 0) sizeof(saddr)) < 0)
err(1, "setsockopt IP_MULTICAST_IF"); err(1, "setsockopt IP_MULTICAST_IF");
/* /*
* When trying to send large packets, you must increase the * When trying to send large packets, you must increase the
* size of both the send and receive buffers... * size of both the send and receive buffers...
*/ */
@@ -660,7 +660,7 @@ void pr_pack(char *buf, int cc, struct sockaddr_in *from)
return; /* 'Twas not our ECHO */ return; /* 'Twas not our ECHO */
++nreceived; ++nreceived;
if (timing) { if (timing) {
bigtime_t tvi; bigtime_t tvi;
#ifndef icmp_data #ifndef icmp_data
pkttime = (char *)&icp->icmp_ip; pkttime = (char *)&icp->icmp_ip;
@@ -725,7 +725,7 @@ void pr_pack(char *buf, int cc, struct sockaddr_in *from)
if (!(options & F_VERBOSE)) if (!(options & F_VERBOSE))
return; return;
ip2 = (struct ip *) (buf + hlen + sizeof (struct icmp)); ip2 = (struct ip *) (buf + hlen + sizeof (struct icmp));
hlen2 = ip2->ip_hl << 2; hlen2 = ip2->ip_hl << 2;
if (cc >= hlen2 + 8 && check_icmph((struct ip *)(icp + if (cc >= hlen2 + 8 && check_icmph((struct ip *)(icp +
sizeof (struct icmp))) != 1) sizeof (struct icmp))) != 1)
return; return;
@@ -931,7 +931,7 @@ void finish(int sig)
{ {
(void)signal(SIGINT, SIG_IGN); (void)signal(SIGINT, SIG_IGN);
(void)signal(SIGALRM, SIG_IGN); (void)signal(SIGALRM, SIG_IGN);
summary(1); summary(1);
exit(nreceived ? 0 : 1); exit(nreceived ? 0 : 1);
} }
@@ -983,7 +983,7 @@ pr_icmph(icp)
if (icp->icmp_nextmtu != 0) if (icp->icmp_nextmtu != 0)
(void)printf("frag needed and DF set (MTU %d)\n", (void)printf("frag needed and DF set (MTU %d)\n",
ntohs(icp->icmp_nextmtu)); ntohs(icp->icmp_nextmtu));
else else
(void)printf("frag needed and DF set\n"); (void)printf("frag needed and DF set\n");
break; break;
case ICMP_UNREACH_SRCFAIL: case ICMP_UNREACH_SRCFAIL:
@@ -1143,7 +1143,7 @@ pr_icmph(icp)
#ifdef ICMP_MASKREPLY #ifdef ICMP_MASKREPLY
case ICMP_MASKREPLY: case ICMP_MASKREPLY:
(void)printf("Address Mask Reply (Mask 0x%08ld)\n", (void)printf("Address Mask Reply (Mask 0x%08ld)\n",
ntohl(icp->icmp_mask)); (long)ntohl(icp->icmp_mask));
break; break;
#endif #endif
default: default:
@@ -1253,7 +1253,7 @@ fill(bp, patp)
} }
} }
/* /*
* when we get types of ICMP message with parts of the orig. datagram * when we get types of ICMP message with parts of the orig. datagram
* we want to try to assure ourselves that it is from this instance * we want to try to assure ourselves that it is from this instance
* of ping, and not say, a refused finger connection or something * of ping, and not say, a refused finger connection or something