Subject: traceroute patches

From: [email-masked] (David M. Meyer 503/346-1747)
Date: 25 Oct 1993 13:15:32 GMT

Here are some patches for traceroute that make it run on
	Solaris 2.x. The whole archive can be found on ftp.uoregon.edu
	on pub/Solaris2.x/src.

	Thanks,

	Dave

	David M. Meyer			Voice:     503/346-1747
	Senior Network Engineer		Pager:	   503/342-9458
	Office of University Computing	FAX:	   503/346-4397
	Computing Center		Internet:  [email-masked]
	University of Oregon
	1225 Kincaid
	Eugene, OR 97403	

-----

#!/bin/sh
# This is a shell archive (produced by shar 3.49)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# made 10/25/1993 13:14 UTC by meyer@cambium
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#   3676 -rw-r--r-- patch01
#    183 -rw-r--r-- traceroute.h
#
# ============= patch01 ==============
if test -f 'patch01' -a X"$1" != X"-c"; then
	echo 'x - skipping patch01 (File already exists)'
else
echo 'x - extracting patch01 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'patch01' &&
*** Makefile.orig	Mon Oct 25 05:59:27 1993
--- Makefile	Mon Oct 25 06:13:54 1993
***************
*** 27,33 ****
X  
X  # ARCH_K should be set to the output you get when you type "arch -k"
X  # on your system.  (Should be one of sun3, sun3x, sun4, or sun4c.)
! ARCH_K= sun4c
X  
X  # Set DESTDIR to the directory in which the traceroute executable will be
X  # installed.  /usr/etc is a good place to put a network debugging tool such
--- 27,33 ----
X  
X  # ARCH_K should be set to the output you get when you type "arch -k"
X  # on your system.  (Should be one of sun3, sun3x, sun4, or sun4c.)
! ARCH_K= sun4m
X  
X  # Set DESTDIR to the directory in which the traceroute executable will be
X  # installed.  /usr/etc is a good place to put a network debugging tool such
***************
*** 37,50 ****
X  
X  # You shouldn't need to change anything below this line.
X  
! CC= cc
! CFLAGS = -O
! KFLAGS= -fsoft -DKERNEL -D$(ARCH_K)
X  
X  # At the moment, the INCL variable isn't really needed for anything.
! INCL = -I.
! LIBS = 
! MANDIR= /usr/man/man8
X  
X  # SUN_INCL_DIR should be set to the full pathname of the system include
X  # directory in which ip_icmp.h lives.  For SunOS 4.0.3 and 4.0.3c, this is
--- 37,51 ----
X  
X  # You shouldn't need to change anything below this line.
X  
! INSTALL	=	/usr/ucb/install
! CC	=	gcc
! CFLAGS	= 	-O
! # KFLAGS= -fsoft -DKERNEL -D$(ARCH_K)
X  
X  # At the moment, the INCL variable isn't really needed for anything.
! INCL	=	-I.
! LIBS 	=	-lnsl -lsocket
! MANDIR 	=	/usr/local/man/man8
X  
X  # SUN_INCL_DIR should be set to the full pathname of the system include
X  # directory in which ip_icmp.h lives.  For SunOS 4.0.3 and 4.0.3c, this is
***************
*** 57,63 ****
X  SYS_OBJ_DIR= /sys/$(ARCH_K)/OBJ
X  
X  
! all: traceroute ip_icmp.o raw_ip.o
X  
X  traceroute: traceroute.c
X  	$(CC) $(CFLAGS) $(INCL) -o traceroute traceroute.c $(LIBS)
--- 58,64 ----
X  SYS_OBJ_DIR= /sys/$(ARCH_K)/OBJ
X  
X  
! all: traceroute 
X  
X  traceroute: traceroute.c
X  	$(CC) $(CFLAGS) $(INCL) -o traceroute traceroute.c $(LIBS)
***************
*** 69,78 ****
X  	$(CC) $(CFLAGS) $(KFLAGS) $(INCL) -c raw_ip.c
X  
X  install: all
! 	install -o root -g bin -m 4755 traceroute ${DESTDIR}
! 	install -o root -g staff -m 755 traceroute.8 ${MANDIR}
! 	install -o root -g staff -m 444 ip_icmp.o $(SYS_OBJ_DIR)
! 	install -o root -g staff -m 444 raw_ip.o $(SYS_OBJ_DIR)
X  	@ echo ""
X  	@ echo "Binaries and man page installed."
X  	@ echo ""
--- 70,79 ----
X  	$(CC) $(CFLAGS) $(KFLAGS) $(INCL) -c raw_ip.c
X  
X  install: all
! 	$(INSTALL) -o root -g bin -m 4755 traceroute ${DESTDIR}
! 	$(INSTALL) -o root -g staff -m 755 traceroute.8 ${MANDIR}
! #	$(INSTALL) -o root -g staff -m 444 ip_icmp.o $(SYS_OBJ_DIR)
! #	$(INSTALL) -o root -g staff -m 444 raw_ip.o $(SYS_OBJ_DIR)
X  	@ echo ""
X  	@ echo "Binaries and man page installed."
X  	@ echo ""
*** traceroute.c.orig	Mon Oct 25 05:58:35 1993
--- traceroute.c	Mon Oct 25 06:11:47 1993
***************
*** 191,197 ****
--- 191,201 ----
X  
X  #include <stdio.h>
X  #include <errno.h>
+ #ifdef	__STDC__
+ #include <string.h>
+ #else
X  #include <strings.h>
+ #endif
X  #include <sys/time.h>
X  
X  #include <sys/param.h>
***************
*** 208,213 ****
--- 212,219 ----
X  #include <netdb.h>
X  #include <ctype.h>
X  
+ #include	"traceroute.h"
+ 
X  #define	MAXPACKET	65535	/* max ip packet size */
X  #ifndef MAXHOSTNAMELEN
X  #define MAXHOSTNAMELEN	64
***************
*** 394,400 ****
--- 400,412 ----
X  		Printf(usage);
X  		exit(1);
X  	}
+ 
+ 
+ #ifdef   __STDC__
+ 	setvbuf(stderr, NULL, _IOLBF, 0);
+ #else
X  	setlinebuf (stdout);
+ #endif   /* __STDC__ */
X  
X  	(void) bzero((char *)&whereto, sizeof(struct sockaddr));
X  	to->sin_family = AF_INET;
SHAR_EOF
chmod 0644 patch01 ||
echo 'restore of patch01 failed'
Wc_c="`wc -c < 'patch01'`"
test 3676 -eq "$Wc_c" ||
	echo 'patch01: original size 3676, current size' "$Wc_c"
fi
# ============= traceroute.h ==============
if test -f 'traceroute.h' -a X"$1" != X"-c"; then
	echo 'x - skipping traceroute.h (File already exists)'
else
echo 'x - extracting traceroute.h (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'traceroute.h' &&
X
#ifdef	__STDC__
#define bcopy(src,dest,len)     (memmove((dest), (src), (len)))
#define bzero(dest,len)  	(memset((dest), (char)0, (len)))
#define index(s,c)		strchr((s),(c))
#endif
SHAR_EOF
chmod 0644 traceroute.h ||
echo 'restore of traceroute.h failed'
Wc_c="`wc -c < 'traceroute.h'`"
test 183 -eq "$Wc_c" ||
	echo 'traceroute.h: original size 183, current size' "$Wc_c"
fi
exit 0