#!/bin/rc # # command: /bin/boddle /n/dump/1999/0103/sys/src/cmd/ip/arpd.c arpd.c # srcdir: /n/dump/1999/0103/sys/src/cmd/ip # version: 917090536 # date: Sat Jan 23 11:22:16 GMT 1999 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 917090536 exit interrupt } while(~ $1 -*){ switch($1){ case -X doextract=yes case -* usage } shift } switch($#*){ case 0 srcdir=/n/dump/1999/0103/sys/src/cmd/ip case 1 srcdir=$1 case * usage } if(! ~ $doextract yes){ echo This shell file contains a bundle of diffs representing changes echo to original source files in the Plan 9 distribution. It will run echo against the files in echo ' ' $srcdir echo '(unless overridden by the optional source directory argument)' echo and create a directory 917090536 containing the updated files. echo It will NOT automatically update the original files. echo echo Invoke with argument -X to perform the actual extraction. exit 0 } rm -rf 917090536 mkdir 917090536 target=917090536/arpd.c echo -n '917090536/arpd.c: ' if(! test -f $srcdir/arpd.c || ! test -r $srcdir/arpd.c){ echo $srcdir/arpd.c unreadable exit unreadable } sum=`{sum < $srcdir/arpd.c} if(! ~ 9fa2e5675731 $sum(1)^$sum(2)){ echo $srcdir/arpd.c is not the original distribution file exit original } cp $srcdir/arpd.c 917090536/arpd.c ed 917090536/arpd.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM arpd.c' 266a } Pend * freepkt(Pend *p) { Pend *n; n = p->next; free(p->data); free(p); return n; . 263a else if(t >= f->expire) *l = freepkt(f); . 261,262c *l = freepkt(f); . 259d 254a t = time(0); . 253a long t; . 250c ippending(uchar *ip) . 244c ippending(entry.ipaddr); . 161a p->expire = t + Lifetime; p->data = malloc(pktlen); if(p->data == 0) { free(p); return; } . 159a if(p == 0) return; . 158a t = time(0); for(l = &phead; (f = *l) != 0 && t >= f->expire;) *l = freepkt(f); . 136a long t; . 135c Pend *p, **l, *f; . 37c void ippending(uchar*); Pend *freepkt(Pend*); . 31a enum { Lifetime = 10, /* seconds before expiry */ }; . 29c char *data; . 27a long expire; . wq //GO.SYSIN DD VADIM arpd.c sum=`{sum < 917090536/arpd.c} if(~ 295c9a9c6121 $sum(1)^$sum(2)) echo if not{ echo 917090536/arpd.c checksum error creating updated file exit checksum }