Diffs to scotty-0.7 for DEC Alpha OSF/1

Dan Mosedale (mosedale@genome.stanford.edu)
Mon, 18 Oct 1993 11:22:07 -0700 (PDT)

Here are some diffs that make scotty 0.7 and ntping run on Alpha OSF/1
1.2. I haven't extensively tested these, but so far so good... As
I've noted in the diffs, either the comment or the code in one spot in
ntping.c is wrong.

Dan Mosedale

diff -x Makefile -x *.o -r dist/dns.c alpha_osf12/dns.c
72a73
> #include "scotty.h"
189c190
< long ttl;

---
> 	ipaddr_t ttl;
364c365
< 			unsigned long x;
---
> 			ipaddr_t x;
diff -x Makefile -x *.o -r dist/ntping/ntping.c alpha_osf12/ntping/ntping.c
27a28,33
> #ifdef __alpha
> typedef unsigned int ipaddr_t;
> #else
> typedef unsigned long ipaddr_t;
> #endif
> 
155c161
< 	long mask;			/* mask/tstamp return val */
---
> 	ipaddr_t mask;			/* mask/tstamp return val */
313a320,329
> 
> /* alpha boxes are too fast for the empty loop; they end up getting divide
>  * by 0 errors while attempting to time stuff.  For what it's worth, either 
>  * the above comment or the "if n > 20" statement is wrong: usleep takes its 
>  * parameter in microseconds, not milliseconds.
>  */
> 
> #ifdef __alpha
> #define DELAY_WITH_GETTIMEOFDAY
> #else
314a331
> #endif
405c422
< 	long x = ntohl (addr->sin_addr.s_addr);
---
> 	ipaddr_t x = ntohl (addr->sin_addr.s_addr);
524c541
< 		unsigned long naddr;
---
> 		ipaddr_t naddr;
573c590
< 	long val = 0;
---
> 	ipaddr_t val = 0;
722c739
< 				val = ntohl (* (long *) icp->icmp_data);
---
> 				val = ntohl (* (ipaddr_t *) icp->icmp_data);
731,733c748,750
< 				       ntohl (((long *) icp->icmp_data) [0]),
< 				       ntohl (((long *) icp->icmp_data) [1]),
< 				       ntohl (((long *) icp->icmp_data) [2]));
---
> 				       ntohl(((ipaddr_t*)icp->icmp_data) [0]),
> 				       ntohl(((ipaddr_t*)icp->icmp_data) [1]),
> 				       ntohl(((ipaddr_t*)icp->icmp_data) [2]));
736,737c753,754
< 				       ntohl (((long *) icp->icmp_data) [1]) -
< 				       ntohl (((long *) icp->icmp_data) [0]));
---
> 				       ntohl(((ipaddr_t*)icp->icmp_data) [1]) -
> 				       ntohl(((ipaddr_t*)icp->icmp_data) [0]));
740,741c757,758
< 			    val = ntohl (((long *) icp->icmp_data) [1]) -
< 			      ntohl (((long *) icp->icmp_data) [0]);
---
> 			    val = ntohl (((ipaddr_t *) icp->icmp_data) [1]) -
> 			      ntohl (((ipaddr_t *) icp->icmp_data) [0]);
776c793
< 				long l = sfrom.sin_addr.s_addr;
---
> 				ipaddr_t l = sfrom.sin_addr.s_addr;
831c848
< 	ip->ip_hl = sizeof (struct ip) / sizeof (unsigned long);
---
> 	ip->ip_hl = sizeof (struct ip) / sizeof (ipaddr_t);
918c935
< 	    * (unsigned long *) datap = htonl ((tv.tv_sec % 86400) * 1000
---
> 	    * (ipaddr_t *) datap = htonl ((tv.tv_sec % 86400) * 1000
920c937
< 	    data_offset = sizeof (unsigned long);
---
> 	    data_offset = sizeof (ipaddr_t);
988c1005
< long mask;
---
> ipaddr_t mask;
1008c1025
<       printf ("%s %s\n", job->hname, (do_mask) ? mask_str ((long) 0) : 
---
>       printf ("%s %s\n", job->hname, (do_mask) ? mask_str ((ipaddr_t) 0) : 
diff -x Makefile -x *.o -r dist/rpc.c alpha_osf12/rpc.c
33a34
> #include "scotty.h"
100c101
<     rsocket->sin_addr.s_addr = * (unsigned long *) hp->h_addr;
---
>     rsocket->sin_addr.s_addr = * (ipaddr_t *) hp->h_addr;
diff -x Makefile -x *.o -r dist/scotty.c alpha_osf12/scotty.c
113,114c113,114
<     unsigned long addr;
<     unsigned long *paddr;
---
>     ipaddr_t addr;
>     ipaddr_t *paddr;
138c138
< 	    paddr = (unsigned long *) *host->h_addr_list++;
---
> 	    paddr = (ipaddr_t *) *host->h_addr_list++;
diff -x Makefile -x *.o -r dist/scotty.h alpha_osf12/scotty.h
32a33,41
> /* 
>  * Make sure things work on both 32 and 64 bit machines.
>  */
> #ifdef __alpha
> typedef unsigned int ipaddr_t;
> #else
> typedef unsigned long ipaddr_t;
> #endif
>