ping6.c (91523) | ping6.c (92806) |
---|---|
1/* $KAME: ping6.c,v 1.126 2001/05/17 03:39:08 itojun Exp $ */ 2 3/* 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 64 unchanged lines hidden (view full) --- 73 The Regents of the University of California. All rights reserved.\n"; 74#endif /* not lint */ 75 76#ifndef lint 77#if 0 78static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; 79#endif 80static const char rcsid[] = | 1/* $KAME: ping6.c,v 1.126 2001/05/17 03:39:08 itojun Exp $ */ 2 3/* 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 64 unchanged lines hidden (view full) --- 73 The Regents of the University of California. All rights reserved.\n"; 74#endif /* not lint */ 75 76#ifndef lint 77#if 0 78static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; 79#endif 80static const char rcsid[] = |
81 "$FreeBSD: head/sbin/ping6/ping6.c 91523 2002-03-01 09:49:48Z ume $"; | 81 "$FreeBSD: head/sbin/ping6/ping6.c 92806 2002-03-20 17:55:10Z obrien $"; |
82#endif /* not lint */ 83 84/* 85 * Using the InterNet Control Message Protocol (ICMP) "ECHO" facility, 86 * measure round-trip-delays and packet loss across network paths. 87 * 88 * Author - 89 * Mike Muuss --- 200 unchanged lines hidden (view full) --- 290 char *argv[]; 291{ 292 struct itimerval itimer; 293 struct sockaddr_in6 from; 294 struct timeval timeout, *tv; 295 struct addrinfo hints; 296 fd_set *fdmaskp; 297 int fdmasks; | 82#endif /* not lint */ 83 84/* 85 * Using the InterNet Control Message Protocol (ICMP) "ECHO" facility, 86 * measure round-trip-delays and packet loss across network paths. 87 * 88 * Author - 89 * Mike Muuss --- 200 unchanged lines hidden (view full) --- 290 char *argv[]; 291{ 292 struct itimerval itimer; 293 struct sockaddr_in6 from; 294 struct timeval timeout, *tv; 295 struct addrinfo hints; 296 fd_set *fdmaskp; 297 int fdmasks; |
298 register int cc, i; | 298 int cc, i; |
299 int ch, fromlen, hold, packlen, preload, optval, ret_ga; 300 u_char *datap, *packet; 301 char *e, *target, *ifname = NULL; 302 int ip6optlen = 0; 303 struct cmsghdr *scmsgp = NULL; 304 int sockbufsize = 0; 305 int usepktinfo = 0; 306 struct in6_pktinfo *pktinfo = NULL; --- 1815 unchanged lines hidden (view full) --- 2122 2123/* 2124 * tvsub -- 2125 * Subtract 2 timeval structs: out = out - in. Out is assumed to 2126 * be >= in. 2127 */ 2128void 2129tvsub(out, in) | 299 int ch, fromlen, hold, packlen, preload, optval, ret_ga; 300 u_char *datap, *packet; 301 char *e, *target, *ifname = NULL; 302 int ip6optlen = 0; 303 struct cmsghdr *scmsgp = NULL; 304 int sockbufsize = 0; 305 int usepktinfo = 0; 306 struct in6_pktinfo *pktinfo = NULL; --- 1815 unchanged lines hidden (view full) --- 2122 2123/* 2124 * tvsub -- 2125 * Subtract 2 timeval structs: out = out - in. Out is assumed to 2126 * be >= in. 2127 */ 2128void 2129tvsub(out, in) |
2130 register struct timeval *out, *in; | 2130 struct timeval *out, *in; |
2131{ 2132 if ((out->tv_usec -= in->tv_usec) < 0) { 2133 --out->tv_sec; 2134 out->tv_usec += 1000000; 2135 } 2136 out->tv_sec -= in->tv_sec; 2137} 2138 --- 441 unchanged lines hidden (view full) --- 2580 printf("...\n"); 2581 return; 2582} 2583 2584void 2585fill(bp, patp) 2586 char *bp, *patp; 2587{ | 2131{ 2132 if ((out->tv_usec -= in->tv_usec) < 0) { 2133 --out->tv_sec; 2134 out->tv_usec += 1000000; 2135 } 2136 out->tv_sec -= in->tv_sec; 2137} 2138 --- 441 unchanged lines hidden (view full) --- 2580 printf("...\n"); 2581 return; 2582} 2583 2584void 2585fill(bp, patp) 2586 char *bp, *patp; 2587{ |
2588 register int ii, jj, kk; | 2588 int ii, jj, kk; |
2589 int pat[16]; 2590 char *cp; 2591 2592 for (cp = patp; *cp; cp++) 2593 if (!isxdigit(*cp)) 2594 errx(1, "patterns must be specified as hex digits"); 2595 ii = sscanf(patp, 2596 "%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x", --- 114 unchanged lines hidden --- | 2589 int pat[16]; 2590 char *cp; 2591 2592 for (cp = patp; *cp; cp++) 2593 if (!isxdigit(*cp)) 2594 errx(1, "patterns must be specified as hex digits"); 2595 ii = sscanf(patp, 2596 "%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x%2x", --- 114 unchanged lines hidden --- |