Path: utzoo!mnetor!uunet!husc6!mailrus!ames!pasteur!ucbvax!LANL.GOV!cpw%sneezy From: cpw%sneezy@LANL.GOV (C. Philip Wood) Newsgroups: comp.protocols.tcp-ip Subject: Re: IP Options and ICMP Messages Message-ID: <8803232141.AA10688@sneezy> Date: 23 Mar 88 21:41:36 GMT Sender: uucp@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 68 To all those who picked up the network exercising stuff from lambda.lanl.gov. I gave you a bum [ls]srr.sh. Due to my lack of understanding how BSD4.3 handles the loose/strict source route option on output, the lsrr and ssrr scripts are in error. It is not intuitive that BSD UNIX will strip off the first address in the option to use as a destination, ignoring the destination requested via an open system call. I have another script 'sr' which takes the above into account. For example: sr loose 192.5.16.33 26.3.0.103 26.0.0.90 ships an icmp echo packet to the lanl gateway via gateways 192.5.16.33 and 26.3.0.103. What the heck, here's the script (BTW, the ping is a modified Muuse ping): #! /bin/sh # # Los Alamos National Laboratory # # Copyright, 1988. The Regents of the University of California. This software # was produced under a U.S. Government contract (W-7405-ENG-36) by Los Alamos # National Laboratory, which is operated by the University of # California for the U.S. Department of Energy. The U.S. Government is # licensed to use, reproduce, and distribute this software. Permission is # granted to the public to copy and use this software without charge, provided # that this Notice and any statement of authorship are reproduced on all # copies. Neither the Government nor the University makes any warranty, # express or implied, or assumes any liability or responsibility for the use # of this software. # # ICMP ECHO with IP Loose/Strict Source and Record Route # # "@(#)sr.sh 1.1 (LANL) 3/23/88" # Usage=" Usage: sr {loose,strict} destination(1), destination(2) ... destination(n) " NOP=1 SRPOINTER="4" PING=/usr/local/etc/ping TYPE=-v list="" if [ $# -lt 3 ] ; then echo "$Usage" exit 1 fi if [ $1 = loose ]; then SR=131 elif [ $1 = strict ]; then SR=137 else echo "$Usage" exit 1 fi shift SRLEN=`expr 3 + \( $# \* 4 \)` GW1=$1 # it dont matter what host you "open a connection to" for i do list="$list -o d$i" done $PING $TYPE \ -o d${NOP} \ -o d${SR} \ -o d${SRLEN}.${SRPOINTER} \ $list \ $GW1 12 1